care_fe icon indicating copy to clipboard operation
care_fe copied to clipboard

Fix: Show custom error message for Record Payment Form

Open shubham220420 opened this issue 1 week ago • 3 comments

Proposed Changes

Fixes #13618

  • i18n was unable to to translate custom message because t(..) was called at modular scope
  • Moved form Schema inside the PaymentReconciliationSheet component
  • correct use of UseMemo hook
  • Now custom validation messages are clearly visible Screenshot 2025-11-19 143923 Screenshot 2025-11-19 143933

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • [x] Add specs that demonstrate the bug or test the new feature.
  • [x] Update product documentation.
  • [x] Ensure that UI text is placed in I18n files.
  • [x] Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • [x] Request peer reviews.
  • [x] Complete QA on mobile devices.
  • [x] Complete QA on desktop devices.
  • [x] Add or update Playwright tests for related changes

Summary by CodeRabbit

  • Bug Fixes

    • Better localization for payment reconciliation validation messages.
    • Corrected calculation of returned and tendered amounts for payments.
  • Improvements

    • Form now initializes defaults, synchronizes location, and resets when the payment sheet opens/closes (supports onSuccess).
    • Payment datetime validation relaxed (no future-date enforcement).
    • Improved behavior for cash vs. non-cash payment flows and dynamic amount updates.

✏️ Tip: You can customize this high-level summary in your review settings.

shubham220420 avatar Dec 16 '25 13:12 shubham220420