Aman-Mittal opened a new issue, #783:
URL: https://github.com/apache/fineract-backoffice-ui/issues/783

   ## Summary
   
   Fixed and recurring deposit accounts can be opened, approved, activated and 
closed. Closing has two restrictions:
   
   - It can only *withdraw* the proceeds.
   - Nothing captures what should happen at maturity.
   
   So an institution can't offer the usual term-deposit options: auto-renew, 
transfer to the customer's savings account, or pay interest to savings. It also 
can't add a charge to a deposit account.
   
   This continues the term-deposit servicing epic #295, where close / premature 
close (#297) and transactions (#298) are done. #764 covers the view not 
*showing* maturity data.
   
   ## Evidence (`main` @ `8da1086f`)
   
   - `src/app/features/products/fixed-deposits/fixed-deposit-form.component.ts` 
has 0 references to `maturityInstruction`, `linkAccount`, `transferInterest` or 
`charges`.
   - `src/app/features/products/deposit-closure-dialog.component.ts` loads 
`onAccountClosureOptions` from the close template, then keeps only **Withdraw 
Deposit (100)** (`loadOptions`, ~line 160). Transfer to savings (200) and the 
reinvest options (300 / 400) are deliberately filtered out because the dialog 
can't collect their extra fields.
   - No deposit screen calls `postSavingsaccountsSavingsAccountIdCharges`.
   
   ## Platform support
   
   - **Account create / update:**
     - `POST` / `PUT /v1/fixeddepositaccounts[/{id}]` and 
`/v1/recurringdepositaccounts` accept `maturityInstructionId`, `linkAccountId` 
(the customer's savings account) and `transferInterestToSavings`.
     - The account template returns `maturityInstructionOptions` and the 
client's eligible savings accounts.
   - **Close / premature close:** `onAccountClosureId` is one of 
`DepositAccountOnClosureType`:
     - `TRANSFER_TO_SAVINGS` (200) needs `toSavingsAccountId` and a transfer 
description.
     - `REINVEST_PRINCIPAL_AND_INTEREST` (300) and `REINVEST_PRINCIPAL_ONLY` 
(400) renew the deposit.
   - **Charges:** `POST /v1/savingsaccounts/{accountId}/charges`. Deposit 
accounts are savings-type accounts, and the template lists the charges valid 
for them.
   
   ## Proposed implementation
   
   1. **Account form:** add **Maturity instruction**, **Linked savings 
account** (filtered to the client's active savings) and **Transfer interest to 
savings**. Show them on the account view.
   2. **Closure dialog:** offer every option the template returns. For 
*Transfer to savings*, collect `toSavingsAccountId`, defaulting to the linked 
account. For *Reinvest*, show the resulting new deposit term before confirming.
   3. **Charges:** add a Charges tab on deposit accounts with **Add charge**. 
Pay and waive follow the outcome of #754.
   
   ## RBAC
   
   | Action | Permission code | Typically granted to |
   |---|---|---|
   | View deposit | `READ_FIXEDDEPOSITACCOUNT` / `READ_RECURRINGDEPOSITACCOUNT` 
| deposit officers, auditors |
   | Set maturity instruction / linked account (create) | 
`CREATE_FIXEDDEPOSITACCOUNT` / `CREATE_RECURRINGDEPOSITACCOUNT` | deposit 
officer |
   | Change them later | `UPDATE_FIXEDDEPOSITACCOUNT` / 
`UPDATE_RECURRINGDEPOSITACCOUNT` | deposit officer / branch manager |
   | Close at maturity | `CLOSE_FIXEDDEPOSITACCOUNT` / 
`CLOSE_RECURRINGDEPOSITACCOUNT` | branch manager / teller |
   | Premature close | `PREMATURECLOSE_FIXEDDEPOSITACCOUNT` / 
`PREMATURECLOSE_RECURRINGDEPOSITACCOUNT` | branch manager |
   | Add charge | `CREATE_SAVINGSACCOUNTCHARGE` | deposit officer |
   | Pick a linked savings account | `READ_SAVINGSACCOUNT` | — |
   
   All codes are in `scripts/permission-codes.json`.
   
   - Writes pass with the exact code **or** `ALL_FUNCTIONS`. With maker-checker 
on, closure commands are queued for `<CODE>_CHECKER`.
   - A transfer-to-savings closure moves money into another account, so the 
dialog must explain a missing `READ_SAVINGSACCOUNT` instead of showing an empty 
account list.
   
   ### UI expectations
   
   - Gate each new control with `[appRequiresPermission]`.
   - Gate Premature close and Close separately, since they use different codes.
   - A read-only user sees maturity details but no enabled controls.
   
   ## Acceptance criteria
   
   - [ ] An FD/RD account can be opened with a maturity instruction and a 
linked savings account, and both are shown on the view.
   - [ ] Close and premature close can transfer to savings or reinvest, and the 
resulting transfer or new deposit is visible.
   - [ ] A charge can be added to a deposit account.
   - [ ] Every action is gated on its own code.
   - [ ] Unit tests cover the payloads per closure type and the gating.
   


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