Aman-Mittal opened a new pull request, #307:
URL: https://github.com/apache/fineract-backoffice-ui/pull/307

   Closes #296. Closes #297. Part of #295.
   
   ## The screen these actions belong on did not render at all
   
   Before anything else could be added, the deposit account detail page had to 
start working. It fetched the account like this:
   
   ```ts
   const service = (this.isRD ? this.rdService : this.fdService) as unknown as 
Record<string, unknown>;
   const method = this.isRD ? 'retrieveOne18' : 'retrieveOne14';
   const call = service[method] as (id: number) => { subscribe: … };
   call(this.accountId).subscribe(…);
   ```
   
   Neither name exists on either generated service — they are the only two 
references to `retrieveOne` in the whole source tree. So the lookup produced 
`undefined` and calling it threw:
   
   ```
   TypeError: call is not a function
       at _DepositAccountViewComponent.loadData
       at _DepositAccountViewComponent.ngOnInit
   ```
   
   The template is wrapped in `@if (account())`, so the page rendered as 
**nothing**. Every fixed and recurring deposit account opened to a blank 
screen. Confirmed in a browser before changing anything: zero body text, no 
`.view-container`, that error on the console.
   
   The double cast through `Record<string, unknown>` is what let it compile. 
ADR-0001 stabilises operation names precisely so a rename becomes a compile 
error instead of a blank page; calling the generated methods by name is the 
point.
   
   ## What that unblocks
   
   The platform exposes ten commands on these accounts — `reject`, 
`withdrawnByApplicant`, `approve`, `undoapproval`, `activate`, 
`calculateInterest`, `postInterest`, `close`, `prematureClose`, 
`calculatePrematureAmount` — and the UI offered none of them. It now offers the 
lifecycle set, gated on the status booleans Fineract returns beside the id 
rather than on `status.value`, which is the server's English label and moves 
with its locale.
   
   ## Three things a mock would not have caught
   
   Each verified against a running platform:
   
   | | |
   |---|---|
   | `undoapproval` **refuses** `locale` and `dateFormat` | …which every other 
command here requires. The payload is built per command rather than uniformly — 
a single shared body makes exactly this one fail. |
   | Closing requires `onAccountClosureId`, and rejects `withdrawBalance` | The 
closure type is mandatory and the platform enumerates the four choices **per 
account** via `?command=close`. `withdrawBalance` — what the savings screens 
send — is not a parameter these commands accept. Hence the closure dialog. |
   | A premature closure has a price | `calculatePrematureAmount` returns what 
the client actually receives. The dialog quotes it rather than leaving a teller 
to guess. |
   
   Only "Withdraw Deposit" is offered as a closure type for now. The other 
three each need a second input this dialog does not collect — an account to 
transfer to, or terms to re-invest on — and offering a choice that then fails 
is worse than not offering it.
   
   ## Dates
   
   Command dates are floored at the date the platform already stamped: 
submission for an approval, approval for an activation. Those are written in 
the **tenant's** timezone, so a browser in a different one sends a day the 
command refuses. Same defect as #303, same fix.
   
   ## Verifying it
   
   `e2e/deposit-account-servicing.spec.ts` drives approve → undo approval → 
approve → activate → premature close through the screens against a real 
Fineract, and asserts the menu changes with the status. A second test rejects 
an application and asserts nothing further is offered.
   
   The account is seeded through the API and everything after it is driven 
through the UI — the same split `createActiveLoan` uses, and for the same 
reason: the deposit product and account forms have their own coverage, and 
re-walking them here would make an interest-rate-chart failure read as a broken 
approve button.
   
   | | |
   |---|---|
   | `deposit-account-servicing.spec.ts` (real backend) | 2 passed |
   | `deposit-account-view.component.spec.ts` | 7 new |
   | Full unit suite | 874 passed |
   | `npm run lint`, `npm run i18n:check`, `npm run build`, `tsc` | clean |
   
   ## Not in this PR
   
   #298 — the transactions tab with undo, and the fixed-deposit transaction 
form. It overlaps #278 and #279, which are both marked `good first issue`, and 
I would rather not take those out of the newcomer queue.
   


-- 
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]

Reply via email to