When an ORG_INVOICED payment is refunded AFTER it was already rolled into a PAID invoice, the current code only unbills the payment (nulls billableToOrgInvoiceId) but does NOT update the OrganizationInvoice amount/items. A proper credit-note or invoice adjustment system is needed.
Reference: PR #655 review round 5, refunds/route.ts TODO comment.
When an ORG_INVOICED payment is refunded AFTER it was already rolled into a PAID invoice, the current code only unbills the payment (nulls billableToOrgInvoiceId) but does NOT update the OrganizationInvoice amount/items. A proper credit-note or invoice adjustment system is needed.
Reference: PR #655 review round 5, refunds/route.ts TODO comment.