Skip to content

FINERACT-2455: Add loan origination support to working capital loans#5971

Open
Cocoa-Puffs wants to merge 2 commits into
apache:developfrom
openMF:FINERACT-2455-loan-origination-for-working-capital-loans
Open

FINERACT-2455: Add loan origination support to working capital loans#5971
Cocoa-Puffs wants to merge 2 commits into
apache:developfrom
openMF:FINERACT-2455-loan-origination-for-working-capital-loans

Conversation

@Cocoa-Puffs

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.

@Cocoa-Puffs Cocoa-Puffs force-pushed the FINERACT-2455-loan-origination-for-working-capital-loans branch from c02872e to d897083 Compare June 10, 2026 13:09
@adamsaghy

Copy link
Copy Markdown
Contributor

@Cocoa-Puffs Please review the failing checks

@Cocoa-Puffs Cocoa-Puffs force-pushed the FINERACT-2455-loan-origination-for-working-capital-loans branch 3 times, most recently from b1fab89 to 80f3b2f Compare June 16, 2026 12:04
.orElseThrow(() -> new WorkingCapitalLoanNotFoundException(loanId));

if (!loan.getLoanStatus().isSubmittedAndPendingApproval()) {
throw new WorkingCapitalLoanApplicationNotInSubmittedStateCannotBeDeletedException(loanId);

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.

I think we are throwing the wrong exception here. WorkingCapitalLoanApplicationNotInSubmittedStateCannotBeDeletedException talks about deleting the loan, not detaching the originator: "Working Capital Loan with identifier " + id + " cannot be deleted in its current state."

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.

replaced with the appropriate exception

@RequiredArgsConstructor
@Transactional
@ConditionalOnProperty(value = "fineract.module.loan-origination.enabled", havingValue = "true")
public class WorkingCapitalLoanOriginatorWritePlatformService implements LoanOriginatorWritePlatformService {

@oleksii-novikov-onix oleksii-novikov-onix Jun 18, 2026

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.

Design concern: WorkingCapitalLoanOriginatorWritePlatformService is forced to implement LoanOriginatorWritePlatformService, including create/update/delete, which it can't implement This also requires marking the LoanOriginatorLinkingServiceImpl as @Primary.

Suggestions:

  1. Either drop implements LoanOriginatorWritePlatformService (the handlers already inject the concrete type, so @Primary becomes unnecessary)
  2. Or extract a narrow attach/detach-only interface that both modules implement.

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.

Dropped the implements

@Cocoa-Puffs Cocoa-Puffs force-pushed the FINERACT-2455-loan-origination-for-working-capital-loans branch from 02cffff to 0ec8a04 Compare June 19, 2026 07:44
@ruzeynalov ruzeynalov force-pushed the FINERACT-2455-loan-origination-for-working-capital-loans branch from 0ec8a04 to 4cab072 Compare June 19, 2026 16:21
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