Skip to content

O3-5199: make Bill.cashier optional - #157

Open
RajPrakash681 wants to merge 3 commits into
openmrs:mainfrom
RajPrakash681:make-bill-cashier-optional
Open

O3-5199: make Bill.cashier optional#157
RajPrakash681 wants to merge 3 commits into
openmrs:mainfrom
RajPrakash681:make-bill-cashier-optional

Conversation

@RajPrakash681

Copy link
Copy Markdown
Contributor

Summary

  • Bill.cashier is now optional — bills do not belong to cashiers, payments do
  • Removed forced auto-assignment of cashier on bill creation in BillResource
  • Updated loadBillCashPoint to handle null cashier gracefully
  • Added Liquibase migration to drop NOT NULL constraint on cashier_bill.provider_id

@RajPrakash681 RajPrakash681 changed the title O3-5199:make Bill.cashier optional O3-5199: make Bill.cashier optional Apr 6, 2026
@codecov-commenter

codecov-commenter commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 30.00000% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 27.09%. Comparing base (b52412a) to head (ad90e47).

Files with missing lines Patch % Lines
...module/billing/web/rest/resource/BillResource.java 0.00% 14 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #157      +/-   ##
============================================
+ Coverage     27.04%   27.09%   +0.04%     
- Complexity      497      500       +3     
============================================
  Files           190      190              
  Lines          4337     4333       -4     
  Branches        492      493       +1     
============================================
+ Hits           1173     1174       +1     
+ Misses         3062     3057       -5     
  Partials        102      102              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@NethmiRodrigo NethmiRodrigo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of things:

  1. Please add some tests
  2. In the ReceiptGenerator, bill.getCashier() is now nullable but no null guard was added here — this NPEs when printing a receipt for a cashier-less bill
  3. In SequentialReceiptNumberGenerator bill.getCashier().getId() called without null check in CASHIER and CASHIER_AND_CASH_POINT grouping cases — NPE on bill creation when cashier is null

Comment thread omod/src/main/resources/liquibase.xml Outdated
onDelete="SET NULL" onUpdate="CASCADE"/>
</changeSet>

<changeSet id="openmrs.billing-005-make-bill-cashier-optional" author="rjnt4">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changeset ID openmrs.billing-005-make-bill-cashier-optional is missing the date component; project convention is openmrs.billing-005-YYYYMMDD-description (see openmrs.billing-004-20260320-add-provider-id-to-bill-payment). Also the author should be your name.

@RajPrakash681
RajPrakash681 force-pushed the make-bill-cashier-optional branch from ce54a6e to 706bb0b Compare April 10, 2026 12:41
@RajPrakash681
RajPrakash681 force-pushed the make-bill-cashier-optional branch from 9effa4f to 8b375d7 Compare April 29, 2026 14:05
@RajPrakash681
RajPrakash681 force-pushed the make-bill-cashier-optional branch from 8b375d7 to 9e9a012 Compare April 29, 2026 14:07
@RajPrakash681

Copy link
Copy Markdown
Contributor Author

@NethmiRodrigo could you please take another look at this? I’ve made the changes based on your suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants