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

   ## Summary
   
   Loan products can enable **buy-down fees** and **capitalized income** 
(#190), and the loan screen shows their amortization tabs (#186). There is no 
way to *post* either transaction, or to adjust one, from the loan. The tabs are 
therefore always empty unless the transactions were created through the API.
   
   ## Evidence (`main` @ `8da1086f`)
   
   - `src/app/features/loans/loan-view.component.ts` has 
`TAB.capitalizedIncome` (and the buy-down fee tab), rendering read-only tables 
(lines ~773, ~1365).
   - No action, route or command map entry exists for `buyDownFee`, 
`buyDownFeeAdjustment`, `capitalizedIncome` or `capitalizedIncomeAdjustment`. 
`git grep` finds no reference in `src/app/features` or `src/app/core/guards`.
   
   ## Platform support
   
   - `POST /v1/loans/{loanId}/transactions?command=buyDownFee` and 
`?command=capitalizedIncome` post the transaction (amount, date, payment 
details, external id).
   - `buyDownFeeAdjustment` / `capitalizedIncomeAdjustment` adjust a previously 
posted one; the original transaction is referenced in the request.
   - `GET /v1/loans/{loanId}/transactions/template?command=…` provides the 
defaults.
   - Fineract then generates the matching `*_AMORTIZATION` transactions, which 
the existing tabs already list.
   
   ## Proposed implementation
   
   - Add **Buy-down fee** and **Capitalized income** actions, shown only when 
the loan's product has the feature enabled and the loan is active.
   - Add an **Adjust** row action on each tab entry.
   - Reuse `loan-transaction-form.component.ts` with template-driven defaults.
   - Refresh the tabs, transactions and summary afterwards.
   
   ## RBAC
   
   | Action | Permission code | Typically granted to |
   |---|---|---|
   | View tabs | `READ_LOAN` | lending roles, accountants, auditors |
   | Post buy-down fee | `BUYDOWNFEE_LOAN` | loan officer / dealer-finance 
operations |
   | Adjust buy-down fee | `BUYDOWNFEEADJUSTMENT_LOAN` | operations supervisor, 
finance |
   | Post capitalized income | `CAPITALIZEDINCOME_LOAN` | loan officer / 
operations |
   | Adjust capitalized income | `CAPITALIZEDINCOMEADJUSTMENT_LOAN` | 
operations supervisor, finance |
   
   All codes are in `scripts/permission-codes.json`.
   
   - Writes pass with the exact code **or** `ALL_FUNCTIONS`, and reads with 
`ALL_FUNCTIONS_READ`.
   - With maker-checker on, the command is queued for `<CODE>_CHECKER`, and the 
UI should say "submitted for approval".
   - Adjustments change deferred-income accounting, so keep them separate from 
the posting permission. Don't fall back to `UPDATE_LOAN`.
   
   ### UI expectations
   
   - Add the four commands to `LOAN_COMMAND_PERMISSIONS`, after verifying them 
with the probe described in `command-permissions.ts`.
   - Gate the buttons with `[appRequiresPermission]`.
   - Read-only users see the tabs but no enabled actions.
   
   ## Acceptance criteria
   
   - [ ] Both transactions can be posted and adjusted on a loan whose product 
enables them, and the tabs and amortization update.
   - [ ] Actions are hidden when the product doesn't enable the feature.
   - [ ] Each action is gated on its own code.
   - [ ] Unit tests cover the payloads 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