feat(shares): add Share Account Closure maker-checker workflow

Clerk submits a closure request only once a share account holds zero
shares; manager validates (shares still zero, account active, no active
loan/guarantee, KYC/AML standing, maker!=checker) and approves, which
executes the real Fineract "close" command. The direct native "Close"
action is removed from the account menu — it silently force-redeemed any
remaining shares, bypassing the withdrawal approval flow entirely — and
replaced with an "Eligible for Closure" banner. When a withdrawal approval
brings a share account's holding to zero, a closure request is now
auto-submitted (still requires manager approval) so the clerk doesn't have
to separately open "New Share Closure Request".

Also fixes an unrelated build break introduced by a merged commit: a
missing `suppressMonthlyAnnualLink` property declaration, and two files
(branch-scope.service.ts, gl-reports-data.ts) that existed on `demo` but
were never brought into `dev` alongside the new TDS report components
that depend on them.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 11:43:56 +05:30
co-authored by Claude Sonnet 5
parent ddb215decf
commit 7f836f6f71
20 changed files with 2074 additions and 8 deletions
@@ -124,6 +124,13 @@
</mat-card-header>
<mat-card-content class="content">
@if (sharesAccountData.status?.value === 'Active' && (sharesAccountData.summary?.totalApprovedShares ?? 0) === 0) {
<div class="closure-eligible-banner">
<fa-icon icon="info-circle"></fa-icon>
<span>All shares have been withdrawn from this account — it is now eligible for closure.</span>
<a class="closure-eligible-banner__link" [routerLink]="['/clerk/share-closure-request']"> Request Closure </a>
</div>
}
<nav mat-tab-nav-bar class="navigation-tabs" [tabPanel]="tabPanel">
<a
mat-tab-link
@@ -14,3 +14,33 @@
min-width: 60%;
font-weight: 400;
}
.closure-eligible-banner {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 16px;
margin: 0 0 12px;
background: #eaf2ff;
border: 1px solid rgb(52 87 213 / 25%);
border-left: 3px solid #3457d5;
border-radius: 8px;
font-size: 13px;
color: #1b3a8a;
fa-icon {
color: #3457d5;
}
&__link {
margin-left: auto;
font-weight: 700;
color: #3457d5;
text-decoration: none;
white-space: nowrap;
&:hover {
text-decoration: underline;
}
}
}
@@ -100,11 +100,11 @@ export class SharesButtonsConfiguration {
{
name: 'Share Certificate',
taskPermissionName: 'READ_SHAREACCOUNTPURCHASE'
},
{
name: 'Close',
taskPermissionName: 'CLOSE_SHAREACCOUNT'
}
// 'Close' is intentionally not offered here — closing a share account must go through
// the Clerk Dashboard maker-checker flow (Clerk Dashboard > My Share Closures), never a
// direct one-step action from this view. The native close command also force-redeems any
// remaining shares, bypassing the governed Share Withdrawal approval flow entirely.
];
break;
case 'Submitted and pending approval':