You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fineract.apache.org by "Aman-Mittal (via GitHub)" <gi...@apache.org> on 2026/10/16 07:58:27 UTC

[I] Working Capital loans and products: show and edit custom datatables (m_wc_loan, m_wc_loan_product) [fineract-backoffice-ui]

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: issues-unsubscribe@fineract.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Working Capital loans and products: show and edit custom datatables (m_wc_loan, m_wc_loan_product) [fineract-backoffice-ui]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal commented on issue #776:
URL: https://github.com/apache/fineract-backoffice-ui/issues/776#issuecomment-6211176441

   ## Business process flow
   
   ```mermaid
   flowchart TD
       A["Open WC loan or product"] --> B["GET /datatables?apptable=m_wc_loan"]
       B --> C{"For each table:<br/>READ_table or ALL_FUNCTIONS_READ?"}
       C -- No --> X["Tab not shown"]
       C -- Yes --> D["Tab shows rows"]
       D --> E{"Add / Edit / Delete"}
       E --> F{"CREATE_ / UPDATE_ / DELETE_ table code?"}
       F -- No --> N["Control disabled"]
       F -- Yes --> G["POST / PUT / DELETE /datatables/:table/:loanId"]
       S["New WC loan application"] --> T{"Entity datatable check on m_wc_loan CREATE?"}
       T -- Yes --> U["Collect mandatory datatable fields before submit"]
       T -- No --> V["Submit normally"]
   ```
   
   ## UI mockup
   
   ```text
   ┌ Working Capital Loan #000123 ────────────────────────────────────────────┐
   │ Details │ Schedule │ Transactions │ Charges │ Breach │ ▶ wc_invoice_info │
   ├──────────────────────────────────────────────────────────────────────────┤
   │ wc_invoice_info                                       [+ Add] [✎ Edit]   │ ← CREATE_/UPDATE_wc_invoice_info
   │ Invoice number     INV-88213                                             │
   │ Buyer name         Acme Retail Ltd                                       │
   │ Invoice due date   2026-12-15                                            │
   │                                                       [🗑 Delete]         │ ← DELETE_wc_invoice_info
   └──────────────────────────────────────────────────────────────────────────┘
   (Read-only auditor: same tab, no enabled buttons)
   ```
   


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Working Capital loans and products: show and edit custom datatables (m_wc_loan, m_wc_loan_product) [fineract-backoffice-ui]

Posted by "Aman-Mittal (via GitHub)" <gi...@apache.org>.
Aman-Mittal closed issue #776: Working Capital loans and products: show and edit custom datatables (m_wc_loan, m_wc_loan_product)
URL: https://github.com/apache/fineract-backoffice-ui/issues/776


-- 
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: issues-unsubscribe@fineract.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org