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

   ## Summary
   
   A share product's dividend can be declared and deleted, but it can't be 
**approved**, and the per-account breakdown can't be viewed. Fineract posts 
dividends to share accounts only after approval, so every dividend declared 
from this UI stays pending forever.
   
   ## Evidence (`main` @ `8da1086f`)
   
   `src/app/core/adapters/api/api-surface.json` lists, under 
`SelfDividendService`, only `getShareproductProductIdDividend`, 
`postShareproductProductIdDividend` and 
`deleteShareproductProductIdDividendDividendId`. There is no `GET 
…/dividend/{dividendId}` and no `PUT …/dividend/{dividendId}?command=approve`.
   
   ## Platform support
   
   `ShareDividendApiResource` (`/v1/shareproduct/{productId}/dividend`):
   
   - `GET /{dividendId}` returns the declared dividend with the amount computed 
for each share account (paged; supports `offset`, `limit`, `accountNo`).
   - `PUT /{dividendId}?command=approve` approves the payout. The amounts are 
then credited to each account's linked savings account by the dividend posting 
job.
   - `DELETE /{dividendId}` is allowed only while the dividend is pending. This 
is already used.
   
   ## Proposed implementation
   
   - Make each dividend row open a detail view: header (period, total amount, 
status) plus the paged per-account table, searchable by account number.
   - Add **Approve** on pending dividends, behind a confirmation that states 
the total amount and number of accounts. Hide **Delete** once a dividend is 
approved.
   - Show the status (pending / approved / posted) in the list.
   
   ## RBAC
   
   | Action | Permission code | Typically granted to |
   |---|---|---|
   | View dividends and detail | `READ_DIVIDEND_SHAREPRODUCT` | share 
administrators, finance, auditors |
   | Declare dividend | `CREATE_DIVIDEND_SHAREPRODUCT` | share administrator |
   | Approve dividend payout | `APPROVE_DIVIDEND_SHAREPRODUCT` | 
board-delegated finance approver; should not be the declarer |
   | Delete pending dividend | `DELETE_DIVIDEND_SHAREPRODUCT` | share 
administrator |
   
   All codes are in `scripts/permission-codes.json`.
   
   - Writes pass with the exact code **or** `ALL_FUNCTIONS`.
   - Approving a dividend distributes money to members, so it is a natural 
maker-checker candidate (`APPROVE_DIVIDEND_SHAREPRODUCT_CHECKER`). The UI 
should report "submitted for approval" when it is queued.
   
   ### UI expectations
   
   - Guard the detail route on `READ_DIVIDEND_SHAREPRODUCT`.
   - Gate Approve and Delete with `[appRequiresPermission]`.
   - A read-only user can browse dividends but sees no enabled actions.
   
   ## Acceptance criteria
   
   - [ ] A declared dividend can be opened (per-account amounts shown) and 
approved, and its status updates.
   - [ ] Delete is unavailable after approval.
   - [ ] Approve is gated on `APPROVE_DIVIDEND_SHAREPRODUCT`.
   - [ ] Unit tests cover the approve payload, the detail paging 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