O3-5197: Each payment should have an associated Cashier#109
O3-5197: Each payment should have an associated Cashier#109wikumChamith wants to merge 2 commits intoopenmrs:mainfrom
Conversation
wikumChamith
commented
Feb 10, 2026
- Adds a cashier (Provider) field to Payment so each payment tracks which cashier processed it
- Validates that all new payments have an associated cashier via BillValidator AOP
- Exposes cashier in the Payment REST resource for create and read operations
- Adds Liquibase migration to add provider_id column to cashier_bill_payment table (nullable for legacy data)
|
|
||
| @Getter | ||
| @Setter | ||
| private Provider cashier; |
There was a problem hiding this comment.
Wouldn't it make sense to make this a User rather than Provider?
There was a problem hiding this comment.
Yeah, but Bill is using Provider.
There was a problem hiding this comment.
I don’t think either should be a provider...
There was a problem hiding this comment.
I don't think we should do a last-minute data model change 🙂 Let’s do this after the release.
There was a problem hiding this comment.
Since this isn't something we need in the release, I think we should merge this whole thing in after the release
| } | ||
| for (Payment payment : bill.getPayments()) { | ||
| if (payment != null && !payment.getVoided() && payment.getCashier() == null) { | ||
| errors.reject("billing.payment.error.cashierRequired", "Each payment must have an associated cashier"); |
There was a problem hiding this comment.
When adding strings referencing codes, it's good to add the code (and string) to the message.properties so we can actually localize it.
There was a problem hiding this comment.
We don't have a message.properties file in this module. Should I add a one in this PR, or is it going to be a separate PR?
There was a problem hiding this comment.
@ibacher Sorry, there is a messages.properties file in this module. For some reason, it didn’t show up in the file search I did earlier. I’ve updated it with the missing values.
|
@ibacher any updates on this? |
|
Can we hold off on this until we get the release out of the way in the case that this might require changes to the frontend? Unless the cashier is automatically set from the context authenticated user? Also, do we do that, and if not, why? |