Skip to content

(feat) O3-5413: Add REFUND_REQUESTED and REFUNDED bill statuses#108

Open
UjjawalPrabhat wants to merge 4 commits intoopenmrs:mainfrom
UjjawalPrabhat:feat/O3-5413-refund-status
Open

(feat) O3-5413: Add REFUND_REQUESTED and REFUNDED bill statuses#108
UjjawalPrabhat wants to merge 4 commits intoopenmrs:mainfrom
UjjawalPrabhat:feat/O3-5413-refund-status

Conversation

@UjjawalPrabhat
Copy link

@UjjawalPrabhat UjjawalPrabhat commented Feb 10, 2026

Summary

This PR adds backend support for the frontend to enable refund requests and approval for paid bills.

  • Add REFUND_REQUESTED and REFUNDED to BillStatus enum
  • Allow PAID → REFUND_REQUESTED and REFUND_REQUESTED → REFUNDED status transitions, enforcing REFUND_MONEY privilege for issuing refunds
  • Guard synchronizeBillStatus() from overwriting refund statuses during payment recalculation

Related Issue

O3-5413

@UjjawalPrabhat
Copy link
Author

@NethmiRodrigo @wikumChamith @ibacher Could you please review this PR?

@ELVIS-KATO
Copy link

@UjjawalPrabhat thank you for the work done, the changes LGTM, but if you don't mind, For when rejecting a refund request (REFUND_REQUESTED → PAID), consider clearing the refund request metadata for clarity. (Optional but could make the system cleaner when cleared)

Copy link
Contributor

@NethmiRodrigo NethmiRodrigo left a comment

Choose a reason for hiding this comment

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

Thanks @UjjawalPrabhat, but can we have a separate endpoint to handle refunds ?

@NethmiRodrigo
Copy link
Contributor

consider clearing the refund request metadata for clarity. (Optional but could make the system cleaner when cleared)

The whole point of recording that metadata is to have this record for reporting or auditing purposes so clearing it would be bad

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 10.00000% with 45 lines in your changes missing coverage. Please review.
✅ Project coverage is 26.51%. Comparing base (1778231) to head (1a04d9e).

Files with missing lines Patch % Lines
...module/billing/web/rest/resource/BillResource.java 0.00% 37 Missing ⚠️
...ling/web/rest/controller/BillRefundController.java 0.00% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main     #108      +/-   ##
============================================
- Coverage     26.73%   26.51%   -0.22%     
- Complexity      487      489       +2     
============================================
  Files           190      191       +1     
  Lines          4309     4359      +50     
  Branches        486      493       +7     
============================================
+ Hits           1152     1156       +4     
- Misses         3056     3102      +46     
  Partials        101      101              

☔ 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.

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.

4 participants