feat(shares,tasks): centralized Additional Shares approval queue, remove unused Share Savings Debit

- Add Approval Center tab "Share Addition Requests": lists every pending additional-share tranche
  across all accounts (backed by the new /v1/shareadditionrequests endpoint), with a detail popup
  showing the board resolution and the route-specific proof of funding (voucher(s) for cash, or the
  linked savings account for savings). Approve/Reject call the same native
  approveadditionalshares/rejectadditionalshares commands the account-page buttons already used.
- Remove "Debit from Savings" dialog/button and the "Share Savings Debit" Checker Inbox tab -- zero
  rows ever recorded on either tenant since it was built.
- Remove "Approve Additional Shares"/"Reject Additional Shares" from the account-page menu now that
  every tranche is reviewed from the centralized queue instead.
- Harden SharesButtonsConfiguration.removeButton(): a not-found name fed to splice(-1, 1) was quietly
  deleting the LAST button in the array instead of doing nothing -- removing the two menu entries
  above would otherwise have silently broken the rest of the Active-account button bar.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-30 21:42:33 +05:30
co-authored by Claude Sonnet 5
parent 44b23ef110
commit e89b1cfc23
17 changed files with 767 additions and 655 deletions
@@ -43,32 +43,17 @@ export class SharesButtonsConfiguration {
icon: 'hand-holding-usd',
taskPermissionName: 'CREATE_JOURNALENTRY'
},
{
// The same settlement for a member who banks here: debits their linked savings for the
// share value plus entry fee instead of taking cash at the counter. Raises a request
// rather than posting, because no cashier has counted anything to check it against.
name: 'Debit from Savings',
icon: 'money-check-alt',
taskPermissionName: 'CREATE_JOURNALENTRY'
},
{
name: 'Apply Additional Shares',
icon: 'arrow-right',
taskPermissionName: 'APPLYADDITIONAL_SHAREACCOUNT'
},
{
name: 'Approve Additional Shares',
icon: 'arrow-right',
taskPermissionName: 'APPROVEADDITIONAL_SHAREACCOUNT'
},
{
name: 'Reject Additional Shares',
icon: 'arrow-left',
taskPermissionName: 'REJECTADDITIONAL_SHAREACCOUNT'
}
// 'Redeem Shares' is intentionally not offered here — a share withdrawal must go
// through the Clerk Dashboard maker-checker flow (Clerk Dashboard > My Share Requests),
// never a direct one-step action from this view.
// 'Approve Additional Shares' / 'Reject Additional Shares' are intentionally not offered
// here — every pending tranche across every account is reviewed and actioned from the
// Approval Center's Share Addition Requests queue instead, so a checker never has to know
// which account to open. 'Redeem Shares' is likewise not offered here — a share withdrawal
// must go through the Clerk Dashboard maker-checker flow (Clerk Dashboard > My Share
// Requests), never a direct one-step action from this view.
];
break;
case 'Submitted and pending approval':
@@ -147,7 +132,11 @@ export class SharesButtonsConfiguration {
removeButton(name: string) {
const buttonNames = this.buttonsArray.map((entry) => entry.name);
const index = buttonNames.indexOf(name);
this.buttonsArray.splice(index, 1);
// -1 (not found) fed straight to splice would delete the LAST button instead of doing nothing —
// splice treats a negative index as "from the end", not "no match".
if (index > -1) {
this.buttonsArray.splice(index, 1);
}
}
removeOption(name: string) {