feat(billing): replace Record Payment UUID field with an invoice picker #218
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-191-record-payment-invoice-picker"
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?
The Record Payment modal collected the target invoice via a free-text "Invoice ID (UUID, optional)" input, which no user can be expected to know or paste, and on save silently coerced a non-empty but unparseable UUID to Null (an unapplied payment), detaching a money record from its invoice on a single-character typo with no warning.
Replace the input with a dependent Select populated from
GET /invoices?company_id=<id>. The list re-fetches whenever the selected company changes (reading thecompany_idsignal inside the resource subscribes it), each option shows the human invoice number plus amount and status keyed by the invoice UUID, and a leading explicit "(Unapplied payment)" blank choice stays selectable. A company with no invoices yields a valid unapplied-only control rather than a broken one.Because the picker can only ever yield the explicit blank or a valid UUID, the silent-coercion path is gone: an empty value is a deliberate unapplied payment while a non-empty unparseable value is now a hard inline error. Switching companies also clears any previously picked invoice so a stale cross-company UUID cannot be submitted.
#MAPPS-191