Overhaul the app's color system by replacing all hardcoded Tailwind color classes with semantic theme variables to ensure consistent theming across all components, pages, and tests. Additional changes: - Add assigned date support for order item status updates: add `assignedDate` field to the order item status PATCH API, implement server-side normalization/validation, and add corresponding tests - Refactor purchase order PDF workflows to use the consolidated `purchase_orders.documents` field instead of the legacy separate `purchase_order_pdfs` collection - Fix quote number parsing and formatting to support both dashed (Q-YYYY-MM-NNN) and dashless (QYYYYMMNNN) formats - Rename `driver_pool` item status to `collection_pool` across the codebase - Add null handling for order item quantities and pricing to display "—" for missing values - Improve filter tab styling: make mobile tabs scrollable, prevent text wrapping, hide scrollbar - Add new utility scripts, API routes, migrations, and polish small UI/UX fixes including tsconfig updates and theme hook improvements
71 lines
No EOL
2.5 KiB
Python
71 lines
No EOL
2.5 KiB
Python
import os, json, urllib.request
|
|
|
|
# Read PB_URL from .env.local
|
|
pb_url = None
|
|
with open('.env.local') as f:
|
|
for line in f:
|
|
if line.startswith('NEXT_PUBLIC_POCKETBASE_URL'):
|
|
pb_url = line.split('=', 1)[1].strip().strip('"').strip("'").strip()
|
|
break
|
|
|
|
print(f"PB_URL: {pb_url}")
|
|
|
|
# Auth
|
|
req = urllib.request.Request(
|
|
pb_url + '/api/collections/_superusers/auth-with-password',
|
|
data=json.dumps({"identity": "david.els1@outlook.com", "password": "1234567890"}).encode(),
|
|
headers={"Content-Type": "application/json"},
|
|
)
|
|
with urllib.request.urlopen(req) as r:
|
|
token = json.load(r)['token']
|
|
print(f"Auth token: {token[:40]}...")
|
|
|
|
# Schema for purchase_orders
|
|
req = urllib.request.Request(
|
|
pb_url + '/api/collections/pbc_1342968361',
|
|
headers={"Authorization": token},
|
|
)
|
|
with urllib.request.urlopen(req) as r:
|
|
d = json.load(r)
|
|
print("\n=== purchase_orders fields ===")
|
|
for f in d.get('fields', []):
|
|
opts = f.get('options', {}) or {}
|
|
max_files = opts.get('maxFiles', '')
|
|
max_size = opts.get('maxSize', '')
|
|
extras = f" (maxFiles={max_files}, maxSize={max_size})" if 'file' in f.get('type','') else ""
|
|
print(f" {f.get('name','?'):30} {f.get('type','?'):15}{extras}")
|
|
|
|
# Sample record
|
|
req = urllib.request.Request(
|
|
pb_url + '/api/collections/pbc_1342968361/records?perPage=1',
|
|
headers={"Authorization": token},
|
|
)
|
|
with urllib.request.urlopen(req) as r:
|
|
d = json.load(r)
|
|
items = d.get('items', [])
|
|
if items:
|
|
print(f"\n=== Sample record keys ({len(items[0].keys())} keys) ===")
|
|
for k in items[0].keys():
|
|
v = items[0][k]
|
|
if isinstance(v, list):
|
|
print(f" {k}: list[{len(v)}]")
|
|
elif isinstance(v, str) and len(v) > 60:
|
|
print(f" {k}: {v[:60]}...")
|
|
else:
|
|
print(f" {k}: {v!r}")
|
|
else:
|
|
print("\nNo records found")
|
|
|
|
# Check purchase_order_pdfs still exists
|
|
req = urllib.request.Request(
|
|
pb_url + '/api/collections/pbc_4269390732/records?perPage=2&sort=-created',
|
|
headers={"Authorization": token},
|
|
)
|
|
try:
|
|
with urllib.request.urlopen(req) as r:
|
|
d = json.load(r)
|
|
print(f"\n=== purchase_order_pdfs (still active?) — {d.get('totalItems', 0)} rows ===")
|
|
for it in d.get('items', [])[:2]:
|
|
print(f" {it.get('id')}: file={it.get('file')}, status={it.get('status')}, created={it.get('created')}")
|
|
except Exception as e:
|
|
print(f"\npurchase_order_pdfs check failed: {e}") |