shivaansh0610-LUFFY opened a new pull request, #675: URL: https://github.com/apache/fineract-backoffice-ui/pull/675
## What and why This PR addresses the **deferred-income item (#3) from #672** by fixing a display gap in the loan view's **Capitalized Income** tab. The tab already receives five fields from Fineract for each row: * `amount` * `amortizedAmount` * `unrecognizedAmount` * `amountAdjustment` * `chargedOffAmount` However, the UI only rendered the first three, so `amountAdjustment` and `chargedOffAmount` were fetched by the existing request but never displayed. While investigating #672, I also checked the `/deferredincome` endpoint referenced by the issue. It is a deprecated alias of the existing Capitalized Income functionality, using the same response model and the same `enableIncomeCapitalization` flag. Because the existing Capitalized Income tab is already wired to this data, this PR does not introduce a second tab or add a new request against the deprecated route. Instead, it exposes the two fields that the client was already receiving, with no additional API calls. ### Scope of #672 This PR is intentionally limited to the deferred-income display gap: * **#3 — Deferred income:** addressed here by displaying `amountAdjustment` and `chargedOffAmount`. * **#1/#2 — GLIM/GSIM:** remain open; these are larger features that the issue itself identifies as requiring their own design. * **#4 — Loan term variations:** was already implemented in an earlier change and is unrelated to this PR. ## Changes * Added `amountAdjustment` to the Capitalized Income table. * Added `chargedOffAmount` to the Capitalized Income table. * Added the corresponding `LOANS.*` translation keys. * Extended the loan-view test setup to provide Capitalized Income rows. * Added a test covering both newly displayed fields and their values. No new API request or backend change is required. ## Verification The following checks pass: * `npm run typecheck:e2e` * `npm run format:check` * `npm run lint` * `npm run i18n:check` * `npm run test:unit` (scoped to `loan-view.component.test.ts`): **46/46 passing** * `npx playwright test --project=mocked e2e/loan-schedule-type-gating.spec.ts`: **6/6 passing** The new unit test specifically verifies that both previously omitted columns render with the expected values. The change was exercised with mocked data only. No backend behavior or API contract was modified, so a real-Fineract run was not performed. ## Screenshots and recording The attached before/after evidence shows the Capitalized Income tab changing from **3 displayed columns to all 5 fields returned by Fineract**, using the same synthetic mocked loan data. ### Before <img width="908" height="147" alt="Capitalized Income tab before the fix" src="https://github.com/user-attachments/assets/1797984b-73fe-4cfe-8b46-75289d1be18f" /> ### After <img width="908" height="147" alt="Capitalized Income tab after the fix" src="https://github.com/user-attachments/assets/f5d3b833-6aca-4da0-9d94-57a886c9ea53" /> ### Before / After comparison https://github.com/user-attachments/assets/55660321-3506-473e-b9c1-24e79b298948 The capture details and the mocked-data setup are documented in the accompanying README. ## AI assistance (optional) * Tool / model: * Harness / workflow: ## Checklist * [x] I did not hand-edit generated files under `src/app/api/`. * [x] New component or service code uses the adapter boundary in `src/app/core/adapters/` instead of direct browser globals or imperative third-party APIs. *(N/A — no new component or service was added.)* * [x] User-facing strings use translation keys. *(Added `LOANS.AMOUNT_ADJUSTMENT` and `LOANS.CHARGED_OFF_AMOUNT` to `en.json`.)* * [x] I added or updated tests appropriate to this change. *(Added coverage verifying both newly displayed fields.)* * [x] UI workflow changes include suitable e2e coverage, including real-backend testing where relevant. *(This is a display-only change using data from an existing request; the existing mocked coverage for this tab passes, and no backend behavior was changed.)* * [x] Commits are signed — see [[Commit Signing](https://chatgpt.com/c/CONTRIBUTING.md#commit-signing)](CONTRIBUTING.md#commit-signing) in CONTRIBUTING.md. * [x] I followed the [[AI-assisted contributions guidance](https://chatgpt.com/c/CONTRIBUTING.md#ai-assisted-contributions)](CONTRIBUTING.md#ai-assisted-contributions). * [x] If this adds a feature or changes a workflow, I raised it on [[[email protected]](https://lists.apache.org/[email protected])](https://lists.apache.org/[email protected]) first — or it is a bug fix, refactor or test change, where that does not apply. *(This is a bug fix: the existing tab was not rendering two fields already returned by the API.)* -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
