feat(working-capital): manage breach, near-breach, delinquency actions and originators - #402
Closed
Aman-Mittal wants to merge 1 commit into
Closed
feat(working-capital): manage breach, near-breach, delinquency actions and originators#402Aman-Mittal wants to merge 1 commit into
Aman-Mittal wants to merge 1 commit into
Conversation
…s and originators Four Working Capital endpoints existed on the backend but had no UI: delinquency actions, breach actions, near-breach actions and per-loan loan-originator attach/detach. The loan detail screen now carries write paths for all four, with three new guarded routes (UPDATE_WORKINGCAPITALLOAN) and their action forms. Also in this branch: - api: sync the generated client against apache/fineract:latest (schemaCount 1472 -> 1475). The interop loan-repayment command gained a request body, so interop-transfers now sends dateFormat/locale rather than calling with none. - guidance: the dashboard tour's second step targeted a bare `ul`, which matched the sidebar's nav list before the System Status card it describes; it now targets `.status-list`. The tour's Exit/Back/Next/Finish buttons were hardcoded English and are translated. - search: results were dismissed by the blur timeout racing the click, silently swallowing navigation on a slow render. Result items now preventDefault on mousedown so the searchbar never blurs on a result click. - e2e: new specs for working-capital actions, the dashboard tour, and RBAC dimensions rbac-backend-restricted-user does not reach (multi-permission routes, ALL_FUNCTIONS_READ, a second action-level gate, reload persistence). - e2e: `npm run seed:demo-data` populates a backend with a representative dataset for manual sanity testing, as its own `demo-seed` Playwright project so it never runs as a side effect of the `backend` project in CI.
7 tasks
Member
Author
|
Superseded by #408. That branch is this one rebased, with a second commit adding a Vitest runner and a CI ratchet for the deprecated Karma suite. The working-capital commit here is unchanged and carried over intact, so nothing from this PR is lost — it is the first of the two commits on #408, and closes the same issues (#396–#401). Closing this to keep one branch under review rather than two overlapping ones. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #396, #397, #398, #399, #400, #401. Completes the epic in #395.
Description
A Working Capital loan was read-only in this UI. Four capabilities the backend already exposes — delinquency actions, breach actions, near-breach actions, and per-loan loan-originator attach/detach — had no entry point, so recording a breach action meant leaving the back office and calling Fineract directly.
The main change adds those four write paths. Working through them surfaced several defects and coverage gaps in the same neighbourhood, which are included here rather than deferred; each is filed as its own sub-issue so it can be judged on its own terms.
Working Capital actions (#396)
wc-loan-view: breach actions, near-breach actions, originators.UPDATE_WORKINGCAPITALLOAN, plus a "New Action" affordance on the existing delinquency actions tab.WC_LOANS.*translation keys;hiandkocarry the new keys with the same coverage gap as the rest of those files (Hindi and Korean are 18% translated, so both languages render mostly in English #255).API client sync and the interop call it breaks (#397)
public/api/fineract.jsonre-synced againstapache/fineract:latest(1472 → 1475 schemas), with provenance updated to the new digest. The sync givesPOST /interoperation/transactions/{accountId}/loanrepaymenta request body where it previously took none — every field optional, so the existing bodyless call still compiled while sending nothing. It now sendsdateFormatandlocale, matching every other Fineract command on that screen.Dashboard tour highlighted the wrong element (#398)
The tour's second step used
targetSelector: 'ul', which resolves to the first<ul>in the document — the sidebar'snav-list, not the System Status card its copy describes. Now targets.status-list. The tour's own Exit/Back/Next/Finish buttons were hardcoded English and now resolve throughCOMMON.*.Global search swallowed result clicks (#399)
Results were hidden by a 150 ms blur timeout that the click had to beat. Under a slow render the timeout won, the list collapsed, and the click landed on nothing — no navigation, no error. Result items now
preventDefault()onmousedownso the searchbar never blurs for a result click; the timeout remains as a fallback for Escape and click-outside.RBAC coverage (#400)
rbac-multi-permission.spec.tscovers four dimensionsrbac-backend-restricted-user.spec.tsdoes not reach: OR semantics on multi-permission routes,ALL_FUNCTIONS_READagainst Fineract's real permission catalogue rather than a mocked session, a second action-level gate, and whether a restricted session survives a page reload rather than only a fresh login. Follows the existing spec's shape — every refusal asserted both as "router sent them to Access Denied" and as "Fineract returned 403", since the guard is defence-in-depth and showing only the client half invites the wrong conclusion.Demo data seeding (#401)
npm run seed:demo-datapopulates a fresh backend with a representative dataset — office, staff, centre, group, an active loan, a loan pending approval, savings, a fixed deposit, a share account, a journal entry, reports — and prints what it created. Composed entirely from existingseed-api.tshelpers, so there is no second seeding implementation to keep in step.It is its own Playwright project (
demo-seed) rather than a member of or dependency ofBACKEND_SPECS: nothing in it asserts anything, so it must never run as a side effect of--project=backendin CI. It also does not depend on thesetupproject, so it works against a backend nothing else has touched.Checklist
npm run lintcleannpm run format:checkcleannpm run i18n:check— no missing keysnpm run check:route-permissions— 309 screens, 119 nav entries, guard order and visibility agreenpm run typecheck:e2ecleannpm run check:licenses— no Category X or unclassified licencesTesting notes
The Working Capital endpoints are Fineract 1.15.0+ and not reachable on the public community sandbox, so
working-capital-loan-actions.spec.tsmocks them.rbac-multi-permission.spec.tsneeds a real backend and is registered inBACKEND_SPECS.