WEB-957: Add externalId to Working Capital Loan discount fee#3602
WEB-957: Add externalId to Working Capital Loan discount fee#3602oleksii-novikov-onix wants to merge 1 commit into
Conversation
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Service Contract Extension src/app/loans/loans.service.ts |
WorkingCapitalLoanDiscountUpdateRequest interface adds optional externalId?: string field to establish the data contract for both components. |
Disburse Component Discount External ID Support src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts, src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.html |
Angular imports updated with DestroyRef and takeUntilDestroyed for lifecycle cleanup. DisburseComponent injects DestroyRef, adds maxExternalIdLength constant, and configures a new discountExternalId form control with max-length validation and a form-level validator requiring it to differ from externalId. A subscription to discountAmount changes clears discountExternalId when discount amount is null, empty, or non-positive. Template conditionally renders the external ID field when discount amount exceeds zero, with inline error messages for validation failures. |
Update Discount Component Discount External ID Support src/app/loans/loans-view/loan-account-actions/update-discount/update-discount.component.ts, src/app/loans/loans-view/loan-account-actions/update-discount/update-discount.component.html |
UpdateDiscountComponent adds maxExternalIdLength constant, configures a new externalId form control with max-length validation, and includes externalId from form values in the submission payload to applyWorkingCapitalLoanAccountCommand. Template renders a labeled input field with max-length error messaging. |
Internationalization src/assets/translations/*.json (12 languages: cs-CS, de-DE, en-US, es-CL, es-MX, fr-FR, it-IT, ko-KO, lt-LT, lv-LV, ne-NE, pt-PT, sw-SW) |
Translation strings added for the "Discount External Id" label, validation message ("Discount External Id must differ from External Id"), and max-length error ("External Id is too long") across all supported languages. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
- openMF/web-app#3436: Extends the existing working-capital "update discount" flow by adding
externalIdtoWorkingCapitalLoanDiscountUpdateRequestand wiring it throughUpdateDiscountComponent. - openMF/web-app#3447: Both PRs modify the working-capital disbursement UI logic in
disburse.component.ts/htmlby extending form controls and validation logic. - openMF/web-app#3419: Both PRs modify
DisburseComponentlifecycle and submission logic for working capital disbursement operations.
Suggested reviewers
- alberto-art3ch
- adamsaghy
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and specifically describes the main change: adding an externalId field to Working Capital Loan discount fees across UI components, service interfaces, and translations. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
| Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Description
Describe the changes made and why they were made instead of how they were made. List any dependencies that are required for this change.
Related issues and discussion
#{Issue Number}
Screenshots, if any
Checklist
Please make sure these boxes are checked before submitting your pull request - thanks!
If you have multiple commits please combine them into one commit by squashing them.
Read and understood the contribution guidelines at
web-app/.github/CONTRIBUTING.md.Summary by CodeRabbit