fix(billing): add an edit path for recorded payments #246

Merged
vas2000-work merged 1 commit from fix/MAPPS-235-payment-edit-path into main 2026-06-17 23:46:09 +02:00
Owner

PaymentRow was delete-only and the modal always POSTed, so correcting a mistaken amount or method meant deleting the payment and re-entering it from scratch.

PaymentRow now carries an Edit action that reopens the payment modal seeded from the row. RecordPaymentModal accepts an optional payment_id plus seed values: when the id is set it PUTs to /payments/{id} (titled "Edit Payment", submit "Save Changes"); otherwise it POSTs to /payments as before. RemotePayment now also deserializes company_id and notes so the edit form can be fully seeded.

On the server side (the shared billing module mirrored from mokosh-server) this adds PUT /payments/{payment_id} -> update_payment alongside the existing delete, an UpdatePaymentRequest model, and a service method that rewrites the payment row and reconciles the affected invoice(s). Balances are recomputed from the live payment sum so a changed amount, a moved invoice link, or an unapply all settle correctly, and a payment still cannot be applied to a void/written-off invoice.

#MAPPS-235

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

PaymentRow was delete-only and the modal always POSTed, so correcting a mistaken amount or method meant deleting the payment and re-entering it from scratch. PaymentRow now carries an Edit action that reopens the payment modal seeded from the row. RecordPaymentModal accepts an optional payment_id plus seed values: when the id is set it PUTs to /payments/{id} (titled "Edit Payment", submit "Save Changes"); otherwise it POSTs to /payments as before. RemotePayment now also deserializes company_id and notes so the edit form can be fully seeded. On the server side (the shared billing module mirrored from mokosh-server) this adds PUT /payments/{payment_id} -> update_payment alongside the existing delete, an UpdatePaymentRequest model, and a service method that rewrites the payment row and reconciles the affected invoice(s). Balances are recomputed from the live payment sum so a changed amount, a moved invoice link, or an unapply all settle correctly, and a payment still cannot be applied to a void/written-off invoice. #MAPPS-235 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
fix(billing): add an edit path for recorded payments
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m43s
6966f9bfad
PaymentRow was delete-only and the modal always POSTed, so correcting a mistaken amount or method meant deleting the payment and re-entering it from scratch.

PaymentRow now carries an Edit action that reopens the payment modal seeded from the row. RecordPaymentModal accepts an optional payment_id plus seed values: when the id is set it PUTs to /payments/{id} (titled "Edit Payment", submit "Save Changes"); otherwise it POSTs to /payments as before. RemotePayment now also deserializes company_id and notes so the edit form can be fully seeded.

On the server side (the shared billing module mirrored from mokosh-server) this adds PUT /payments/{payment_id} -> update_payment alongside the existing delete, an UpdatePaymentRequest model, and a service method that rewrites the payment row and reconciles the affected invoice(s). Balances are recomputed from the live payment sum so a changed amount, a moved invoice link, or an unapply all settle correctly, and a payment still cannot be applied to a void/written-off invoice.

#MAPPS-235

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
vas2000-work force-pushed fix/MAPPS-235-payment-edit-path from 6966f9bfad
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 1m43s
to fd464e4568
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 1m14s
2026-06-17 23:16:13 +02:00
Compare
vas2000-work force-pushed fix/MAPPS-235-payment-edit-path from fd464e4568
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 1m14s
to d875d088d5
All checks were successful
Check / clippy + fmt + tests (pull_request) Successful in 2m17s
Create release / Create release from merged PR (pull_request) Has been skipped
2026-06-17 23:32:27 +02:00
Compare
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/mokosh-apps!246
No description provided.