Skip to content

FINERACT-2455: Auto-generate externalId for WC discount fee transactions#5865

Merged
adamsaghy merged 2 commits into
apache:developfrom
openMF:FINERACT-2455/wc-discount-fee-external-id
Jun 1, 2026
Merged

FINERACT-2455: Auto-generate externalId for WC discount fee transactions#5865
adamsaghy merged 2 commits into
apache:developfrom
openMF:FINERACT-2455/wc-discount-fee-external-id

Conversation

@oleksii-novikov-onix
Copy link
Copy Markdown
Contributor

Description

Describe the changes made and why they were made. (Ignore if these details are present on the associated Apache Fineract JIRA ticket.)

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.

@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2455/wc-discount-fee-external-id branch 4 times, most recently from 388fbaf to f977955 Compare May 27, 2026 12:46
@MarianaDmytrivBinariks MarianaDmytrivBinariks force-pushed the FINERACT-2455/wc-discount-fee-external-id branch from a696497 to cadb635 Compare May 28, 2026 07:21
Copy link
Copy Markdown
Contributor

@galovics galovics left a comment

Choose a reason for hiding this comment

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

One thing I'm not sure about in the validator change.

WorkingCapitalLoanDataValidator.java:

-        if (expectedDisbursementDate != null && approvedOnDate != null && DateUtils.isBefore(expectedDisbursementDate, approvedOnDate)) {
+        if (expectedDisbursementDate != null && DateUtils.isBefore(expectedDisbursementDate, approvedOnDate)) {

Why remove the approvedOnDate != null guard? In validateApproval the error accumulation pattern means approvedOnDate can still be null past the notNull() check (the error is collected, not thrown). If the caller omits approvedOnDate, DateUtils.isBefore(date, null) will NPE rather than producing a proper validation error.

@oleksii-novikov-onix oleksii-novikov-onix marked this pull request as ready for review May 28, 2026 09:54
@oleksii-novikov-onix
Copy link
Copy Markdown
Contributor Author

oleksii-novikov-onix commented May 28, 2026

One thing I'm not sure about in the validator change.

WorkingCapitalLoanDataValidator.java:

-        if (expectedDisbursementDate != null && approvedOnDate != null && DateUtils.isBefore(expectedDisbursementDate, approvedOnDate)) {
+        if (expectedDisbursementDate != null && DateUtils.isBefore(expectedDisbursementDate, approvedOnDate)) {

Why remove the approvedOnDate != null guard? In validateApproval the error accumulation pattern means approvedOnDate can still be null past the notNull() check (the error is collected, not thrown). If the caller omits approvedOnDate, DateUtils.isBefore(date, null) will NPE rather than producing a proper validation error.

Hello @galovics , DateUtils.isBefore is null-safe on both arguments, when the second argument is null, it returns false.

@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2455/wc-discount-fee-external-id branch from cadb635 to cf67850 Compare May 29, 2026 07:33
Copy link
Copy Markdown
Contributor

@adamsaghy adamsaghy left a comment

Choose a reason for hiding this comment

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

LGTM

@oleksii-novikov-onix oleksii-novikov-onix force-pushed the FINERACT-2455/wc-discount-fee-external-id branch from cf67850 to a75d1c7 Compare June 1, 2026 08:43
@adamsaghy adamsaghy dismissed galovics’s stale review June 1, 2026 13:48

Asked and answered.

@adamsaghy adamsaghy merged commit c37910b into apache:develop Jun 1, 2026
173 of 176 checks passed
@adamsaghy adamsaghy deleted the FINERACT-2455/wc-discount-fee-external-id branch June 1, 2026 13:48
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