Skip to content

FINERACT-176: During allocation and settle cash for a cashier if valid inputs are not given then error message displayed as Unknown data integrity issue#5473

Open
edk12564 wants to merge 1 commit intoapache:developfrom
edk12564:FINERACT-176
Open

Conversation

@edk12564
Copy link

@edk12564 edk12564 commented Feb 10, 2026

JIRA: FINERACT-176

  • Fixed missing throw exception for validation errors in Teller Module

ReportedBy: subramanyasn

Issue

Before any changes, the backend was returning a error.msg.teller.unknown.data.integrity.issue when there is no input on cash transactions in the teller module. This was because the error was being built in the validator, but there was no throw statement.

I verified using Postman, and replicated the issue on the backend.
Screenshot 2026-02-10 at 4 44 18 PM

Here is the proper validation with error as expected (after changes).
Screenshot 2026-02-10 at 5 23 58 PM

I also verified this issue by testing on a dev server. The issue was circumvented by greying out the Submit button when no input is entered. However, I believe it's better to handle this issue in the backend, since it's expected behavior.
Screenshot 2026-02-10 at 4 38 52 PM

Fix

Added throwExceptionIfValidationWarningsExist(() to the validateForCashTxnForCashier method in the TellerCommandFromApiJsonDeserializer.

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Write the commit message as per our guidelines
  • Acknowledge that we will not review PRs that are not passing the build ("green") - it is your responsibility to get a proposed PR to pass the build, not primarily the project's maintainers.
  • Create/update unit or integration tests for verifying the changes made.
  • Follow our coding conventions.
  • Add required Swagger annotation and update API documentation at fineract-provider/src/main/resources/static/legacy-docs/apiLive.htm with details of any API changes
  • This PR must not be a "code dump". Large changes can be made in a branch, with assistance. Ask for help on the developer mailing list.

Your assigned reviewer(s) will follow our guidelines for code reviews.

@IOhacker
Copy link
Contributor

Hello, make sure that the PR title is "FINERACT-176: During allocation and settle cash for a cashier if valid inputs are not given then error message displayed as Unknown data integrity issue"

@edk12564 edk12564 changed the title FINERACT-176 fixed missing throw exception in Teller module FINERACT-176: During allocation and settle cash for a cashier if valid inputs are not given then error message displayed as Unknown data integrity issue Feb 11, 2026
@edk12564
Copy link
Author

edk12564 commented Feb 11, 2026

Hello, make sure that the PR title is "FINERACT-176: During allocation and settle cash for a cashier if valid inputs are not given then error message displayed as Unknown data integrity issue"

Just changed! Sorry about that.

@edk12564
Copy link
Author

edk12564 commented Feb 11, 2026

Hey @IOhacker, do you think you could run the tests again for me? I just investigated the test failure, and wrote my findings below. I think it might be just flaky tests.

Originally, I thought the tests were failing because there was a test that expected a different output than the error I threw. However, after looking more deeply, the tests failed seem to be unrelated. testSavingsInterestPosting_Works_ForMultipleAccounts and testLoanCOBPartitioningQuery don't seem to touch the validateForCashTxnForCashier method. To reconfirm, I ran locally and didn't get any failures.

Screenshot 2026-02-10 at 7 46 27 PM Screenshot 2026-02-10 at 7 49 32 PM

final String currencyCode = this.fromApiJsonHelper.extractStringNamed(CURRENCY_CODE, element);
baseDataValidator.reset().parameter(CURRENCY_CODE).value(currencyCode).notExceedingLengthOf(3);

throwExceptionIfValidationWarningsExist(dataValidationErrors);
Copy link
Contributor

Choose a reason for hiding this comment

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

Please cover with a unit or integration tests!

Copy link
Author

@edk12564 edk12564 Feb 11, 2026

Choose a reason for hiding this comment

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

Yes sir! I'll get on it now.

Copy link
Author

@edk12564 edk12564 Feb 12, 2026

Choose a reason for hiding this comment

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

All done! I tried to follow other existing tests for my code, but please let me know if I missed anything.

- Fixed missing throw exception for validation errors in Teller Module
- added unit tests to confirm changes to TellerCommandFromApiJsonDeserializer

ReportedBy: subramanyasn
@IOhacker
Copy link
Contributor

LGTM

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