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

   ## Summary
   
   Fineract lets an institution attach custom datatables to Working Capital 
loans (`m_wc_loan`) and products (`m_wc_loan_product`). This UI has no place to 
view or enter that data, so any extra fields an institution has defined, such 
as KYC references or collateral notes, can't be captured for these loans.
   
   ## Evidence (`main` @ `8da1086f`)
   
   - Regular loans render `<app-entity-datatables apptableName="m_loan">` 
(`src/app/features/loans/loan-view.component.ts:1313`). Clients, groups, 
centres, offices and deposit accounts do the same.
   - `src/app/features/working-capital/**` has no `app-entity-datatables` and 
no reference to `m_wc_loan` or `m_wc_loan_product`.
   
   ## Platform support
   
   - `fineract-core` `EntityTables` declares `WC_LOAN("m_wc_loan", …, 
"wc_loan_id")` and `WC_LOAN_PRODUCT("m_wc_loan_product", …, 
"wc_product_loan_id")`.
   - `GET /v1/datatables?apptable=m_wc_loan` lists the registered tables.
   - `/v1/datatables/{table}/{entityId}` supports GET / POST / PUT / DELETE.
   - Entity datatable checks can make a table mandatory on the loan's `CREATE` 
(`EntityTables.WC_LOAN` declares `CREATE`).
   
   ## Proposed implementation
   
   - Add a **Datatables** tab to `wc-loan-view` and to the Working Capital 
product view using `EntityDatatablesComponent` with `apptableName="m_wc_loan"` 
/ `"m_wc_loan_product"`.
   - On the loan application form, respect entity datatable checks registered 
for `m_wc_loan` on create. Collect the mandatory datatable fields, or explain 
why the submission was refused.
   
   ## RBAC
   
   Datatable permissions are generated per table. Registering a table creates 
`READ_<table>`, `CREATE_<table>`, `UPDATE_<table>` and `DELETE_<table>`.
   
   | Action | Permission code | Typically granted to |
   |---|---|---|
   | See the tab / read rows | `READ_<table>` (or `ALL_FUNCTIONS_READ`) | 
lending roles, auditors |
   | Add a row | `CREATE_<table>` | loan officer |
   | Edit a row | `UPDATE_<table>` | loan officer, supervisor |
   | Delete a row | `DELETE_<table>` | supervisor |
   | Parent screen | `READ_WORKINGCAPITALLOAN` / 
`READ_WORKINGCAPITALLOANPRODUCT` | — |
   
   Fineract checks this with `AppUser.hasNotPermissionForDatatable(table, 
accessType)`: a read passes with `READ_<table>`, `ALL_FUNCTIONS_READ` or 
`ALL_FUNCTIONS`; a write needs the exact code or `ALL_FUNCTIONS`.
   
   ### UI expectations
   
   - Show only the tables the user can read.
   - Hide or disable Add / Edit / Delete per table code with 
`AuthService.hasPermission` / `[appRequiresPermission]`.
   - A read-only auditor sees the rows but no enabled write controls.
   
   ## Acceptance criteria
   
   - [ ] Datatables registered on `m_wc_loan` / `m_wc_loan_product` appear as 
tabs, and rows can be added, edited and deleted.
   - [ ] A mandatory create-time datatable check is honoured on the application 
form.
   - [ ] Gating is per table code.
   - [ ] Unit tests cover the tab rendering, the permission filtering and the 
create-check handling.
   


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