-
Notifications
You must be signed in to change notification settings - Fork 2.3k
FINERACT-2048: Make amount/recurrence fields optional for DUES standing instruction type #5362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
FINERACT-2048: Make amount/recurrence fields optional for DUES standing instruction type #5362
Conversation
64c6783 to
e79298c
Compare
…ng instruction type
e79298c to
45c1a11
Compare
| .notNull(); | ||
| baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName).value(recurrenceFrequency) | ||
| .notNull(); | ||
| if (standingInstructionType == null || !StandingInstructionType.fromInt(standingInstructionType).isDuesAmoutTransfer()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
standingInstructionType == null || !StandingInstructionType.fromInt(standingInstructionType).isDuesAmoutTransfer()
You are using this logic in repeatedly throughout the code change i think you can extract this into a helper function
| baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceFrequencyParamName).value(recurrenceFrequency) | ||
| .notNull(); | ||
| if (standingInstructionType == null || !StandingInstructionType.fromInt(standingInstructionType).isDuesAmoutTransfer()) { | ||
| baseDataValidator.reset().parameter(StandingInstructionApiConstants.recurrenceIntervalParamName).value(recurrenceInterval) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little bit complicated. and if conditions can be merged, also of there is any business rule that is implemented make sure to document that helper function
Business rules should be explicit and self-documenting
while the Github Action is not run here is a pro tip you can run the check on your forked repo and add testcase for more coverage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aman-Mittal Thank you so much for your guidance and suggestions. I will improve the PR and update shortly.
|
Hi @Aman-Mittal,
|
4a6b71c to
0238e93
Compare
…ng instruction type - Add isAmountRequired() and isRecurrenceRequired() helper methods - Replace repetitive conditional patterns - Add comprehensive JavaDoc - Add unit tests for validation logic - Apply Spotless code formatting
0238e93 to
979f939
Compare
Description
Modified StandingInstructionDataValidator.java to make amount, interval, recurrence frequency, and on month day fields optional when standing instruction type is "DUES". These fields are automatically picked from the loan repayment schedule for DUES type instructions, so they should not be required during validation.
Changes:
JIRA ticket : https://issues.apache.org/jira/browse/FINERACT-2048
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
Your assigned reviewer(s) will follow our guidelines for code reviews.