Repository navigation
fix(groups): importes, estado y porcentajes de los pagos coherentes - #16
Merged
bpstack merged 1 commit intoOct 12, 2026
Merged
Conversation
- payment-rules.ts: statusFor, reconcilePayment and checkPercentages, the
rules decided on 2026-10-11: what was paid never exceeds what is owed,
marking a payment paid fills in what was paid, the status follows the
amounts ("requested" stays until money arrives), and a group's
percentages add up to 100 at most.
- group-payment-controller.ts: create, update, status and amount-paid
apply them; a broken rule answers 400 with GROUP_PAYMENT_OVERPAID or
GROUP_PAYMENT_PERCENTAGE_OVER_100.
- group-payment-repository.ts: the total recalculation also sets the
status from the new amount; updateAmountPaid goes, it had no other user.
- error-codes.ts, errors.json (es, en), errorCodeMessage.ts: the two codes.
- payment-rules.test.ts: the rules and the four endpoints.
Why: more paid than owed was accepted, a payment could be paid with
nothing paid, a new group total left statuses behind, and percentages
could exceed 100. Checked in the browser and with curl against the local
database: an overpayment is refused with its text, marking paid fills in
5000, a 120 % total is refused, and lowering and restoring the group total
moves the statuses and puts them back.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cambios
GROUP_PAYMENT_OVERPAID); marcar un pago como pagado rellena lo pagado.GROUP_PAYMENT_PERCENTAGE_OVER_100).Por qué
Se aceptaba pagar de más y un pago podía marcarse como pagado sin importe, con estados que no cuadraban con las cantidades. Decidido el 2026-10-11.