Workflow-App/Workflow/scripts/_probe_res_docs2.py
sjcoetzeesj-coder 11d0178ab1 feat: commit Workflow app source; move CIPC credentials to env
Adds the full Next.js app (app/, components/, lib/, scripts/, assets/,
docs/, Dockerfile, compose, configs) to version control.

Security:
- CIPC BizPortal customer-code logins (Login 1 + Login 3) now read
  CIPC_LOGIN1_CODE / CIPC_LOGIN1_PASSWORD / CIPC_LOGIN3_CODE /
  CIPC_LOGIN3_PASSWORD from .env.local instead of source.
- BizPortal personal login in apply-bizportal route reads
  BIZPORTAL_ID_NO / BIZPORTAL_PASSWORD.
- Added .env.example as the committed template.

.gitignore excludes .env*, node_modules, .next, logs, sqlite, Playwright
storage_state.json (live CIPC cookies), scratch dirs, client PDFs and
debug screenshots.
2026-10-18 15:21:45 +02:00

42 lines
No EOL
1.7 KiB
Python

import json, urllib.request, urllib.parse
from pathlib import Path
ROOT = Path(r"C:\Users\SJ\.minimax-agent\projects\JEI")
env = {}
for line in (ROOT / ".env.local").read_text(encoding="utf-8").splitlines():
line = line.strip()
if line and not line.startswith("#") and "=" in line:
k, v = line.split("=", 1)
env[k.strip()] = v.strip().strip('"').strip("'")
PB = env.get("NEXT_PUBLIC_PB_URL") or env["PB_URL"]
TOK = env["PB_TOKEN"]
def get(path, **q):
url = f"{PB}{path}"
if q:
url += "?" + urllib.parse.urlencode(q)
req = urllib.request.Request(url, headers={"Authorization": TOK})
with urllib.request.urlopen(req, timeout=60) as r:
return json.loads(r.read().decode())
def dump(cid, rid, label):
r = get(f"/api/collections/{cid}/records/{rid}", expand="company,director,attendees")
print(f"=== {label} {rid}")
for k, v in sorted(r.items()):
if k in ("collectionId", "collectionName"):
continue
s = json.dumps(v, ensure_ascii=False)
if len(s) > 220:
s = s[:220] + "…"
print(f" {k}: {s}")
print()
dump("pbc_266170881", "e0dbxprazb70rqx", "RESOLUTION (signed)")
dump("ysterbaard_director_resignations", "8cfie18uhgy0n0o", "RESIGNATION")
# Does the signed resolution reference the same company/director as the resignation?
res = get("/api/collections/pbc_266170881/records/e0dbxprazb70rqx", expand="company")
resi = get("/api/collections/ysterbaard_director_resignations/records/8cfie18uhgy0n0o", expand="company,director")
print("resolution company:", (res.get("expand") or {}).get("company"))
print("resignation company:", (resi.get("expand") or {}).get("company"))
print("resignation director:", (resi.get("expand") or {}).get("director"))