-
Notifications
You must be signed in to change notification settings - Fork 2.5k
FINERACT-2455: Working Capital Loan Charge - Product Creation & Template #5847
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
Draft
somasorosdpc
wants to merge
1
commit into
apache:develop
Choose a base branch
from
openMF:FINERACT-2455/working-capital-charge-product-support
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
fineract-doc/src/docs/en/chapters/features/charges-template-filters.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| == Template API Filtering | ||
|
|
||
| The charge template API is enhanced to support filtered responses for charge creation. | ||
|
|
||
| Previously, the template endpoint returned every possible configuration option regardless of applicability. This behavior remains unchanged when no filter parameters are provided. | ||
|
|
||
| With this enhancement, the API supports hierarchical filtering of template options to reduce irrelevant configuration values for Working Capital Loan charge products. | ||
|
|
||
| === Filtering Levels | ||
|
|
||
| Filtering is applied in the following order: | ||
|
|
||
| 1. `chargeAppliesTo` | ||
| - filters and returns only applicable `chargeTimeType`s | ||
| 2. `chargeTimeType` | ||
| - filters and returns only applicable `chargeCalculationType`s | ||
|
|
||
| Each filtering level depends on the previous level being provided. | ||
|
|
||
| === chargeAppliesTo Filter | ||
|
|
||
| A new query parameter is introduced: | ||
|
|
||
| [source,http] | ||
| ---- | ||
| GET /charges/template?chargeAppliesTo=<value> | ||
| ---- | ||
|
|
||
| When `chargeAppliesTo` is specified, the API returns only the template fields and dropdown options applicable to the selected entity type. | ||
|
|
||
| Supported values include: | ||
| * `Working Capital Loan` | ||
|
|
||
| === chargeTimeType Filter | ||
|
|
||
| An additional filtering level is available when `chargeAppliesTo` is also provided: | ||
|
|
||
| [source,http] | ||
| ---- | ||
| GET /charges/template?chargeAppliesTo=<value>&chargeTimeType=<value> | ||
| ---- | ||
|
|
||
| Supported values for WCP Loans: | ||
|
|
||
| * `Specified due date` | ||
|
|
||
| The API response filters the available `chargeCalculationType` options based on the selected charge time type. | ||
|
|
||
| == Backward Compatibility | ||
|
|
||
| If no query parameters are provided, the template API continues to return all available options to preserve legacy behavior. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
fineract-doc/src/docs/en/chapters/features/working-capital-charges.adoc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| = Working Capital Loan Charges | ||
|
|
||
| This documentation focuses on Working Capital Loan-related charge changes. | ||
|
|
||
| == Create/Update Charge | ||
|
|
||
| Creates or updates a charge product applicable to Working Capital Loans. | ||
|
|
||
| === Supported Fields | ||
|
|
||
| ==== Mandatory Fields | ||
|
|
||
| * `chargeAppliesTo` | ||
| ** Must be set to `5`, as the `WorkingCapitalLoan` enum identifier is `5`. | ||
|
|
||
| * `chargeTimeType` | ||
|
|
||
| * `chargeCalculationType` | ||
|
|
||
| * `name` | ||
| ** Must be unique across all charge products. | ||
|
|
||
| * `amount` | ||
|
|
||
| * `active` | ||
| ** Boolean value. | ||
|
|
||
| * `currencyCode` | ||
| ** Refer to the template API for supported currency codes. | ||
|
|
||
| * `locale` | ||
| ** Refer to the available platform locales. | ||
|
|
||
| * `penalty` | ||
| ** Boolean value. | ||
|
|
||
| ==== Optional Fields | ||
|
|
||
| * `chargePaymentMode` | ||
| ** Defaults to `regular` when not provided. | ||
|
|
||
| === Supported Values | ||
|
|
||
| ==== chargeAppliesTo | ||
|
|
||
| * `WorkingCapitalLoan` | ||
|
|
||
| [NOTE] | ||
| ==== | ||
| `Loan`, `Savings`, `Client`, and `Shares` charge entities are outside the scope of this documentation. | ||
| ==== | ||
|
|
||
| ==== chargeTimeType | ||
|
|
||
| * `specified due date` | ||
|
|
||
| ==== chargeCalculationType | ||
|
|
||
| * `flat` |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I'm not convinced returning
nullis safe here. Today it's probably unreachable sincevalidWorkingCapitalLoanValues()only containsSPECIFIED_DUE_DATE, but if more time types are added to working capital loans later, any caller iterating the result will get an NPE. Wouldn't it make more sense to return an empty list (orCollections.emptyList()) as the fallback? Thoughts?