Skip to content

FINERACT-2455: WC - allow business step update by resolving the step family per COB job - #6423

Open
oleksii-novikov-onix wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455/wc-cob-business-step-update
Open

FINERACT-2455: WC - allow business step update by resolving the step family per COB job#6423
oleksii-novikov-onix wants to merge 1 commit into
apache:developfrom
openMF:FINERACT-2455/wc-cob-business-step-update

Conversation

@oleksii-novikov-onix

@oleksii-novikov-onix oleksii-novikov-onix commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Working Capital COB business steps could not be configured.

ConfigJobParameterServiceImpl checked every update against one list of available steps, built once at startup for the Loan family (afterPropertiesSet() cached the result for LOAN). The job name from the request was not used to pick the step family, so any payload containing a Working Capital step was rejected with "... Business steps are not configurable for this job.", including every PUT to /jobs/WORKING_CAPITAL_LOAN_CLOSE_OF_BUSINESS/steps.

The fix resolves the step family per job. BusinessStepCategoryService now describes one family: its category, its COB job name and its business step base type. ConfigJobParameterServiceImpl injects all implementations and looks up the one whose job name matches the request. WorkingCapitalLoanBusinessStepCategoryServiceImpl registers the Working Capital family, LoanBusinessStepCategoryServiceImpl keeps the Loan one.

The same change closes two related defects.

Loan steps could be saved onto the Working Capital job, because they passed the check against the cached Loan list. The result was a configuration that never ran. The execution map is built by intersecting the configured step names with the beans of the job's own family, so it came out empty, the batch job stopped in the partitioner, and inline COB failed with "Execution map is empty!".

A request that carried valid Loan step names was accepted under any job name and wrote rows into m_batch_business_steps that no job would ever read. Unknown job names now return 400.

Removing the startup cache also removes an applicationContext.getBean() call during context refresh and a mutable field shared between requests. Available steps are resolved per request instead.

API behaviour

GET /jobs/{jobName}/available-steps now also accepts a COB job name such as WORKING_CAPITAL_LOAN_CLOSE_OF_BUSINESS. The old category name (loan, any case) still works, and the response still echoes back the value that was passed in.

PUT /jobs/{jobName}/steps returns 400 for a name that is not a configurable COB job. A category name like loan used to be accepted here together with valid Loan steps, and wrote rows under that name which no job ever executed.

Testing

Six scenarios were added to WorkingCapital_COB.feature: available steps for the WC job name, the WC job rejecting a Loan step, the Loan job rejecting a WC step, an unknown job name being rejected, a reorder of all eight WC steps read back through the API, and a WC COB run on a reordered configuration. Scenarios that touch the configuration save it before and restore it after, so a failure cannot leak into the rest of the suite.

BusinessConfigurationApiTest needed no changes. shouldReturnApplyChargeToOverdueLoanStepConfigByJobCategory still sends the category name loan and still gets it back as the response jobName.

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.
  • If merging this PR resolves a JIRA issue, I will mark that issue as resolved and set "Fix Version/s" appropriately.
  • I followed the AI Policy.

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

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.

1 participant