Make invoice payment activation idempotent and auditable #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
packages/db/src/billing-store.tsre-applies subscription activation every timemarkInvoicePaidis called, even when the invoice is alreadypaid, and it does not write an admin audit-log entry.Why this matters
Repeated admin calls can rewrite billing periods, create duplicate
cycle_resetledger rows, and leave no audit trail for a high-impact billing action.Acceptance criteria
markInvoicePaidbecomes idempotent for already-paid invoices.mark-paidcalls.