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.
41 lines
1.6 KiB
Python
41 lines
1.6 KiB
Python
"""Test whether null is preserved for number fields in PB EMP201 collection."""
|
|
import os, requests, pathlib
|
|
for line in pathlib.Path(r'C:\Users\SJ\.minimax-agent\projects\Workflow\.env.local').read_text().splitlines():
|
|
if line.strip() and '=' in line and not line.startswith('#'):
|
|
k, v = line.split('=', 1)
|
|
os.environ.setdefault(k.strip(), v.strip())
|
|
token = os.environ['PB_TOKEN']
|
|
h = {'Authorization': f'Bearer {token}', 'Content-Type': 'application/json'}
|
|
|
|
# Try PATCH with explicit null for paye_amount on a not_filed row
|
|
rec = 'uw1xwj3srpua9u6' # ULTRAFIN
|
|
r = requests.patch(
|
|
f'https://pb.agent.apphub.co.za/api/collections/ysterbaard_SARS_EMP201_PAYE/records',
|
|
headers=h, # WRONG — use the records/{id} endpoint
|
|
timeout=15,
|
|
)
|
|
# Get current state first
|
|
r = requests.get(
|
|
f'https://pb.agent.apphub.co.za/api/collections/ysterbaard_SARS_EMP201_PAYE/records',
|
|
headers=h, params={'filter': f'company_period_key="uw1xwj3srpua9u6:202608"'}, timeout=15,
|
|
)
|
|
r.raise_for_status()
|
|
rec_id = r.json()['items'][0]['id']
|
|
print(f'ULTRAFIN record id: {rec_id}')
|
|
|
|
# Now PATCH with explicit null
|
|
r = requests.patch(
|
|
f'https://pb.agent.apphub.co.za/api/collections/ysterbaard_SARS_EMP201_PAYE/records/{rec_id}',
|
|
headers=h, json={
|
|
'paye_amount': None,
|
|
'sdl_amount': None,
|
|
'uif_amount': None,
|
|
'total_payable': None,
|
|
}, timeout=15,
|
|
)
|
|
print(f'PATCH with null: status={r.status_code}')
|
|
d = r.json()
|
|
print(f' paye_amount: {d.get("paye_amount")!r}')
|
|
print(f' sdl_amount: {d.get("sdl_amount")!r}')
|
|
print(f' uif_amount: {d.get("uif_amount")!r}')
|
|
print(f' total_payable: {d.get("total_payable")!r}')
|