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:
@@ -361,11 +361,14 @@ export class ShareWithdrawalRequestComponent implements OnInit {
|
||||
if (!this.reviewRequest) return;
|
||||
this.wdService.approve(this.reviewRequest.id).subscribe({
|
||||
next: (res: any) => {
|
||||
const message =
|
||||
let message =
|
||||
res?.settlementAmount != null
|
||||
? `Share withdrawal approved. ₹${Number(res.settlementAmount).toLocaleString('en-IN', { minimumFractionDigits: 2 })} credited to the linked savings account.`
|
||||
: (res?.settlementWarning ?? 'Share withdrawal approved and processed.');
|
||||
this.snackBar.open(message, 'Close', { duration: 6000 });
|
||||
if (res?.autoClosureRequestId) {
|
||||
message += ' All shares now withdrawn — a Share Closure Request was auto-submitted for manager review.';
|
||||
}
|
||||
this.snackBar.open(message, 'Close', { duration: 8000 });
|
||||
if (this.embedded) {
|
||||
this.actionCompleted.emit();
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user