fix: erpsetup dunning read rule, migration seed test, usage events 500 #137

Merged
sharang merged 3 commits from fix/erpsetup-dunning-and-small into main 2026-11-17 12:10:38 +00:00
3 Commits
Author SHA1 Message Date
Sharang ParnerkarandClaude Opus 5.5 37032e649e fix(usage): malformed tenant id lists no events on postgres
ci / shared (pull_request) Successful in 12s
ci / test (pull_request) Successful in 8m27s
ci / image (pull_request) Skipped
pgx reports an invalid UUID from rows.Err, not from Query, so GET /v1/usage/events?tenant_id=not-a-uuid answered 500 on Postgres and 200 on the memory store. It now returns an empty list on both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:55:28 +01:00
Sharang ParnerkarandClaude Opus 5.5 524f5009d3 test(migrations): intake reports keep their workspace (0030)
TestSeed_canInsertAndQuery deleted a tenant that had intake reports, which 0030 forbids on purpose (reports outlive their workspace). The intake rows now sit on a workspace of their own; the test checks that its delete is refused and the rows stay, and the cascade check keeps the other tenant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:55:28 +01:00
Sharang ParnerkarandClaude Opus 5.5 b02bf254bc feat(erpsetup): registry user may read dunning, read only
The late-payment ladder (#134) reads Dunnings, which ERPNext lets only the Accounts roles read. The registry's API user holds Sales User only. erpsetup now adds a level-0 read rule for Sales User on Dunning through Frappe's permission manager (which first copies the standard rules, as the Role Permissions Manager UI does) and cuts a broader rule back to read only. The spec.go comment no longer claims Accounts User. Live ERP: the same rule was added by hand on 17.11.; the next run reports it as existing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 12:55:28 +01:00