Admin Console
Use this utility to seed verified country packs, debug visibility, fix scoping, apply VAT patches, and verify upgrade safeguards.
Upsert CountryPack and CountryPackVersion records for KE, GH, AE, CA, US, EU with verified tax rates. All versions set to "draft" status.
Print exactly what's stored in CountryPack and CountryPackVersion tables with tenant scoping checks.
Set tenantId = null for all country packs (KE, GH, AE, CA, US, EU, UK, NG) to make them global.
Apply NG 1.0.2 (cash-basis + VAT withheld boxW) and GH 1.0.1 (last working day deadline rule). Creates draft versions for review.
Verify that all safeguards are in place: immutable snapshots (appliedPayload), no auto-apply, functions exist, audit logging ready.
Workflow:
- Click "Run Seed" to upsert KE, GH, AE, CA, US, EU packs with verified rates (status=draft)
- Click "Run Debug" to see what's stored and check for scoping issues
- If scopingIssues.hasIssues = true, click "Fix Scoping" to set tenantId = null (make global)
- Click "Apply VAT Patches" to create NG 1.0.2 (cash-basis + boxW) and GH 1.0.1 (last working day)
- Click "Verify Safeguards" to ensure immutable snapshots and upgrade functions are in place
- If snapshots missing, click "Run Migration Now" to populate appliedPayload for all tenants
- Go to AdminPacks page, use "Drafts" filter to see all draft packs, then "Publish" them
Safeguard Model:
- • Immutable Snapshot: TenantCountryPack.appliedPayload never changes except on manual upgrade
- • Overrides Preserved: TenantCountryOverride survives all upgrades
- • Effective = Base + Overlay: Runtime merges applied + overrides
- • No Auto-Apply: Publishing never auto-applies to tenants
- • Manual Preview → Apply: Users preview diff, then explicitly apply