Rebuild payments around the invoice + transaction model - #45
Merged
Abdulmajidkhan007 merged 1 commit intoSep 9, 2026
Merged
Abdulmajidkhan007 merged 1 commit into
Abdulmajidkhan007 merged 1 commit into
Conversation
The backend replaced the payment model: an invoice is now created
automatically after the twelfth lesson and its amount is frozen, while
each payment is a separate transaction attached to it. `InvoiceDto` lost
`student`, `status` and `type`, `PUT /invoice/{id}` and
`POST /invoice/return` are gone, and `Enrollment.monthlyFee` was dropped.
The screen was still written against the old shape, so the student,
status and type columns rendered empty and both write actions pointed at
endpoints that no longer exist.
The page now shows invoices and payment activity side by side, and the
primary action is recording a payment — the thing an administrator
actually does daily. Invoice creation is not offered: `InvoiceCreateDto`
takes a JPA `Enrollment` rather than an id, so no client can call it.
The invoice's student is resolved from the student list the screen
already loads, since the DTO carries only an id.
`/student/me` lost its groupId parameter and its status field in the same
backend change; the balance is now student-wide, so the query no longer
waits for the group list.
Known backend problems found while doing this are written up in
docs/backend-notes.md — the refund transaction moves the balance the
wrong way, and invoice creation is uncallable.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7ST2QLMxbKy7uj1gTp85n
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.
The backend replaced the payment model: an invoice is now created automatically after the twelfth lesson and its amount is frozen, while each payment is a separate transaction attached to it.
InvoiceDtoloststudent,statusandtype,PUT /invoice/{id}andPOST /invoice/returnare gone, andEnrollment.monthlyFeewas dropped. The screen was still written against the old shape, so the student, status and type columns rendered empty and both write actions pointed at endpoints that no longer exist.The page now shows invoices and payment activity side by side, and the primary action is recording a payment — the thing an administrator actually does daily. Invoice creation is not offered:
InvoiceCreateDtotakes a JPAEnrollmentrather than an id, so no client can call it. The invoice's student is resolved from the student list the screen already loads, since the DTO carries only an id./student/melost its groupId parameter and its status field in the same backend change; the balance is now student-wide, so the query no longer waits for the group list.Known backend problems found while doing this are written up in docs/backend-notes.md — the refund transaction moves the balance the wrong way, and invoice creation is uncallable.
Claude-Session: https://claude.ai/code/session_01B7ST2QLMxbKy7uj1gTp85n