Skip to content

FINERACT-2455: WC - Transaction Type - Repayment#5760

Draft
mariiaKraievska wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2455/working-capital-transaction-type-repayment
Draft

FINERACT-2455: WC - Transaction Type - Repayment#5760
mariiaKraievska wants to merge 1 commit intoapache:developfrom
openMF:FINERACT-2455/working-capital-transaction-type-repayment

Conversation

@mariiaKraievska
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.

@adamsaghy
Copy link
Copy Markdown
Contributor

@mariiaKraievska please rebase

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2455/working-capital-transaction-type-repayment branch 2 times, most recently from efa67c2 to fed79a3 Compare April 10, 2026 12:16
@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2455/working-capital-transaction-type-repayment branch 2 times, most recently from 3cb9188 to 3002a02 Compare April 13, 2026 12:17
final DataValidatorBuilder baseDataValidator = new DataValidatorBuilder(dataValidationErrors)
.resource(WorkingCapitalLoanConstants.RESOURCE_NAME);

final LocalDate transactionDate = this.fromApiJsonHelper.parameterHasValue(WorkingCapitalLoanConstants.transactionDateParamName,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we actually want to use the actualDisbursementDate for fallback, instead of the transcationDate parameter? Is it really the same?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you 👍 I removed the fallback. For WCL repayment we now accept only transactionDate.

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2455/working-capital-transaction-type-repayment branch from 3002a02 to dee3550 Compare April 13, 2026 13:20
BigDecimal result = BigDecimal.ZERO;
for (ProjectedPayment payment : model.payments()) {
if (payment.paymentNo() > 0 && payment.npvValue() != null && payment.npvValue().getAmount() != null) {
result = result.add(Objects.requireNonNullElse(payment.npvValue().getAmount(), BigDecimal.ZERO), mc);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Objects.requireNonNullElse(payment.npvValue().getAmount(), BigDecimal.ZERO) is redundant, the if guard above already ensures getAmount() != null

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Simplify to result = result.add(payment.npvValue().getAmount(), mc)

@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2455/working-capital-transaction-type-repayment branch 2 times, most recently from 51ecea1 to 7969bb6 Compare April 13, 2026 17:13
@mariiaKraievska mariiaKraievska force-pushed the FINERACT-2455/working-capital-transaction-type-repayment branch from 7969bb6 to 13b494c Compare April 13, 2026 17:54
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.

5 participants