update rd,fd,saving and current product update validation end date and and this all account nominee facility code

This commit is contained in:
Nitesh Yadav
2026-05-15 12:53:47 +05:30
parent 8758b9222f
commit 52e216fbe5
62 changed files with 3069 additions and 886 deletions
@@ -73,7 +73,11 @@
</span>
</div>
@if (currentAccountProductTemplate?.nominationFacility) {
<mifosx-nominee-form (nomineeChange)="onNomineeChange($event)"></mifosx-nominee-form>
<mifosx-nominee-form
[primaryClientId]="primaryClientId"
[showActions]="false"
(nomineeChange)="onNomineeChange($event)"
></mifosx-nominee-form>
}
</div>
</div>
@@ -6,7 +6,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { Component, Input, OnChanges, SimpleChanges, ViewChild } from '@angular/core';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
import { NomineeFormComponent } from 'app/shared/nominee-form/nominee-form.component';
import { DormancyAlertPanelComponent } from 'app/shared/dormancy-alert-panel/dormancy-alert-panel.component';
@@ -27,6 +27,8 @@ import { FormsModule } from '@angular/forms';
})
export class CurrentAccountCurrencyStepComponent implements OnChanges {
@Input() currentAccountProductTemplate: any;
@Input() primaryClientId: number | null = null;
@ViewChild(NomineeFormComponent) nomineeFormComp: NomineeFormComponent;
nomineeData: any = null;
@@ -48,6 +50,10 @@ export class CurrentAccountCurrencyStepComponent implements OnChanges {
this.nomineeData = event;
}
get liveNomineeData(): any {
return this.nomineeFormComp?.currentNomineeData ?? this.nomineeData;
}
/** Called by parent to collect currency step values */
get currencyStepData() {
return {
@@ -53,7 +53,11 @@
@if (searchResults.length > 0) {
<div class="arc-search-results">
@for (client of searchResults; track client) {
<div class="arc-search-result-item" (click)="selectClient(client)">
<div
class="arc-search-result-item"
[class.arc-search-result-item--disabled]="isExcluded(client)"
(click)="selectClient(client)"
>
<div class="arc-result-avatar">
{{ (client.displayName || '?')[0].toUpperCase() }}
</div>
@@ -73,7 +77,11 @@
}
</span>
</div>
<mat-icon class="arc-result-arrow">chevron_right</mat-icon>
@if (isExcluded(client)) {
<span class="arc-excluded-tag">Already added</span>
} @else {
<mat-icon class="arc-result-arrow">chevron_right</mat-icon>
}
</div>
}
</div>
@@ -168,6 +168,24 @@ mifosx-add-related-client-dialog {
transform: translateX(2px);
}
}
&--disabled {
opacity: 0.45;
cursor: not-allowed;
pointer-events: none;
}
}
.arc-excluded-tag {
font-size: 10px;
font-weight: 600;
color: #dc2626;
background: #fef2f2;
border: 1px solid #fecaca;
border-radius: 4px;
padding: 1px 6px;
white-space: nowrap;
margin-left: auto;
}
.arc-result-avatar {
@@ -8,7 +8,7 @@
import { Component, inject, OnDestroy, ViewEncapsulation } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
import { MatDialogRef, MatDialogContent, MatDialogActions, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { MatProgressSpinner } from '@angular/material/progress-spinner';
import { MatIcon } from '@angular/material/icon';
import { ClientsService } from 'app/clients/clients.service';
@@ -32,6 +32,7 @@ export class AddRelatedClientDialogComponent implements OnDestroy {
private fb = inject(UntypedFormBuilder);
private clientsService = inject(ClientsService);
dialogRef = inject(MatDialogRef<AddRelatedClientDialogComponent>);
data: { excludedClientIds?: number[] } = inject(MAT_DIALOG_DATA, { optional: true }) ?? {};
form: UntypedFormGroup = this.fb.group({
searchText: [''],
@@ -73,7 +74,7 @@ export class AddRelatedClientDialogComponent implements OnDestroy {
}
this.isSearching = true;
this.searchTimer = setTimeout(() => {
this.clientsService.searchByText(value.trim(), 0, 10).subscribe({
this.clientsService.searchByText(value.trim(), 0, 10, '', '', true).subscribe({
next: (res: any) => {
this.searchResults = res?.content || [];
this.isSearching = false;
@@ -86,7 +87,13 @@ export class AddRelatedClientDialogComponent implements OnDestroy {
}, 400);
}
isExcluded(client: any): boolean {
const excluded = this.data?.excludedClientIds ?? [];
return excluded.includes(client.id);
}
selectClient(client: any): void {
if (this.isExcluded(client)) return;
this.selectedClient = client;
this.form.patchValue({ searchText: client.displayName });
this.searchResults = [];
@@ -165,7 +165,10 @@
</div>
@if (productTemplate?.introducerRequired) {
<mifosx-introducer-search (introducerChange)="onIntroducerChange($event)"></mifosx-introducer-search>
<mifosx-introducer-search
[excludedClientIds]="primaryClientId ? [primaryClientId] : []"
(introducerChange)="onIntroducerChange($event)"
></mifosx-introducer-search>
}
}
@@ -521,7 +524,10 @@
<mat-icon>manage_accounts</mat-icon>
<span>Search &amp; Link Guardian (existing client)</span>
</div>
<mifosx-introducer-search (introducerChange)="onGuardianChange($event)"></mifosx-introducer-search>
<mifosx-introducer-search
[excludedClientIds]="primaryClientId ? [primaryClientId] : []"
(introducerChange)="onGuardianChange($event)"
></mifosx-introducer-search>
@if (guardianName) {
<div class="soa-guardian-selected">
@@ -360,10 +360,15 @@ export class CurrentAccountDetailsStepComponent implements OnInit {
// ── Joint Account (Status of Account) ─────────────────────────────────
openAddJointHolderDialog(): void {
const excludedClientIds = [
...(this.primaryClientId ? [this.primaryClientId] : []),
...this.jointHolders.map((h: any) => h.clientId).filter(Boolean)
];
const ref = this.dialog.open(AddRelatedClientDialogComponent, {
width: '500px',
panelClass: 'arc-dialog-panel',
disableClose: true
disableClose: true,
data: { excludedClientIds }
});
ref.afterClosed().subscribe((result) => {
if (result) {
@@ -434,10 +439,15 @@ export class CurrentAccountDetailsStepComponent implements OnInit {
// ── Non-Individual (existing) helpers ──────────────────────────────────
openAddRelatedClientDialog(): void {
const excludedClientIds = [
...(this.primaryClientId ? [this.primaryClientId] : []),
...this.relatedClients.map((c: any) => c.clientId).filter(Boolean)
];
const ref = this.dialog.open(AddRelatedClientDialogComponent, {
width: '500px',
panelClass: 'arc-dialog-panel',
disableClose: true
disableClose: true,
data: { excludedClientIds }
});
ref.afterClosed().subscribe((result) => {
if (result) {
@@ -570,72 +570,64 @@
<div class="preview-section__header">
<i class="fas fa-user-shield preview-section__icon"></i>
<span class="preview-section__title">Nominee Details</span>
<span class="preview-section__badge">
{{ currentAccountNominee?.mode === 'linked' ? 'Linked Client' : 'Manual Entry' }}
</span>
<span class="preview-section__badge">{{ currentAccountNominee?.nominationType || 'DA1' }}</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">Name</span>
<span class="preview-value">{{
currentAccountNominee?.fullName || currentAccountNominee?.displayName || '—'
}}</span>
<span class="preview-value">{{ currentAccountNominee?.nomineeDisplayName || '—' }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Client ID</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.nomineeClientId || '—' }}</span>
</div>
@if (currentAccountNominee?.cifNumber) {
<div class="preview-field">
<span class="preview-label">CIF No</span>
<span class="preview-value preview-mono">{{ currentAccountNominee.cifNumber }}</span>
</div>
}
<div class="preview-field">
<span class="preview-label">Relationship</span>
<span class="preview-value">{{ currentAccountNominee?.relationship || '—' }}</span>
<span class="preview-value">{{ currentAccountNominee?.relationshipName || '—' }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Share %</span>
<span class="preview-value">{{ currentAccountNominee?.nomineeShare ?? '—' }}%</span>
<span class="preview-value">{{ currentAccountNominee?.percentageShare ?? '—' }}%</span>
</div>
@if (currentAccountNominee?.dateOfBirth) {
<div class="preview-field">
<span class="preview-label">Minor</span>
<span class="preview-value">{{ currentAccountNominee?.nomineeIsMinor ? 'Yes' : 'No' }}</span>
</div>
@if (currentAccountNominee?.nomineeDateOfBirth) {
<div class="preview-field">
<span class="preview-label">Date of Birth</span>
<span class="preview-value">{{ currentAccountNominee?.dateOfBirth | dateFormat }}</span>
<span class="preview-value">{{ currentAccountNominee?.nomineeDateOfBirth | dateFormat }}</span>
</div>
}
@if (currentAccountNominee?.nationality) {
<div class="preview-field">
<span class="preview-label">Nationality</span>
<span class="preview-value">{{ currentAccountNominee?.nationality }}</span>
</div>
}
@if (currentAccountNominee?.mobileNo) {
@if (currentAccountNominee?.nomineeMobileNo) {
<div class="preview-field">
<span class="preview-label">Mobile No</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.mobileNo }}</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.nomineeMobileNo }}</span>
</div>
}
@if (currentAccountNominee?.aadhaarNumber) {
@if (currentAccountNominee?.nomineeAadhaar) {
<div class="preview-field">
<span class="preview-label">Aadhaar No</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.aadhaarNumber }}</span>
<span class="preview-label">Aadhaar</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.nomineeAadhaar }}</span>
</div>
}
@if (currentAccountNominee?.panNumber) {
@if (currentAccountNominee?.nomineePan) {
<div class="preview-field">
<span class="preview-label">PAN No</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.panNumber }}</span>
<span class="preview-label">PAN</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.nomineePan }}</span>
</div>
}
@if (currentAccountNominee?.guardianName) {
@if (currentAccountNominee?.guardianDisplayName) {
<div class="preview-field">
<span class="preview-label">Guardian Name</span>
<span class="preview-value">{{ currentAccountNominee?.guardianName }}</span>
<span class="preview-label">Guardian</span>
<span class="preview-value">{{ currentAccountNominee?.guardianDisplayName }}</span>
</div>
}
@if (currentAccountNominee?.guardianRelationship) {
@if (currentAccountNominee?.guardianClientId) {
<div class="preview-field">
<span class="preview-label">Guardian Relationship</span>
<span class="preview-value">{{ currentAccountNominee?.guardianRelationship }}</span>
<span class="preview-label">Guardian Client ID</span>
<span class="preview-value preview-mono">{{ currentAccountNominee?.guardianClientId }}</span>
</div>
}
@if (currentAccountNominee?.remarks) {