rd account save api update

This commit is contained in:
Nitesh Yadav
2026-04-30 16:20:35 +05:30
parent 22c9375a55
commit 58cef1c20b
8 changed files with 384 additions and 43 deletions
@@ -145,22 +145,41 @@ export class CreateRecurringDepositsAccountComponent {
const locale = this.settingsService.language.code;
const dateFormat = this.settingsService.dateFormat;
const monthDayFormat = 'dd MMMM';
const recurringDepositAccount = {
...this.recurringDepositAccount,
...this.recurringDepositsAccountCurrencyStep.currencyStepData,
const details = this.recurringDepositAccount;
const currencyStep = this.recurringDepositsAccountCurrencyStep;
const recurringDepositAccount: any = {
...details,
clientId: this.recurringDepositsAccountTemplate.clientId,
charges: [],
isCalendarInherited: false,
submittedOnDate: this.dateUtils.formatDate(this.recurringDepositAccount.submittedOnDate, dateFormat),
expectedFirstDepositOnDate: this.dateUtils.formatDate(
this.recurringDepositAccount.expectedFirstDepositOnDate,
dateFormat
),
mandatoryRecommendedDepositAmount: 0,
recurringFrequency: 1,
recurringFrequencyType: 2,
submittedOnDate: this.dateUtils.formatDate(details.submittedOnDate, dateFormat),
expectedFirstDepositOnDate: this.dateUtils.formatDate(details.expectedFirstDepositOnDate, dateFormat),
dateFormat,
monthDayFormat,
locale
locale,
// Currency step overrides
balanceSwapOption: currencyStep?.balanceSwapOption ?? details.balanceSwapOption ?? false,
msme: currencyStep?.msme ?? details.msme ?? false,
autoDebitFacility: currencyStep?.autoDebitFacility ?? details.autoDebitFacility ?? false
};
// Tenure from interest rate chart step (depositPeriod in days)
const tenureDays = this.rdTenureDays;
if (tenureDays && tenureDays > 0) {
recurringDepositAccount.depositPeriod = tenureDays;
recurringDepositAccount.depositPeriodFrequencyId = 0; // 0 = Days
}
// Nominee from currency step
if (currencyStep?.nomineeData) {
recurringDepositAccount.nominee = currencyStep.nomineeData;
}
this.recurringDepositsService.createRecurringDepositAccount(recurringDepositAccount).subscribe((response: any) => {
this.router.navigate(
[
@@ -494,6 +494,13 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
get recurringDepositAccountDetails() {
const value = this.recurringDepositAccountDetailsForm.value;
if (this.selectedAccountType) {
value.accountType = this.selectedAccountType;
}
if (this.selectedCustomerSegment) {
value.customerSegment = this.selectedCustomerSegment;
}
if (this.selectedAccountStatus) {
value.accountStatus = this.selectedAccountStatus;
}
@@ -503,8 +510,8 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
value.jointHolders = [
{
clientId: this.primaryClientId,
clientName: this.primaryClientName,
clientCif: this.primaryClientCif,
displayName: this.primaryClientName,
cifNumber: this.primaryClientCif,
sharePercentage: this.primaryHolderShare,
isMandatory: true,
isPrimary: true,
@@ -513,8 +520,8 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
},
...this.jointHolders.map((h) => ({
clientId: h.clientId,
clientName: h.clientName,
clientCif: h.clientCif,
displayName: h.clientName,
cifNumber: h.clientCif,
sharePercentage: h.sharePercentage,
isMandatory: h.isMandatory,
isPrimary: false,
@@ -535,9 +542,9 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
if (this.selectedAccountStatus === 'MINOR') {
value.guardianClientId = this.guardianClientId;
value.guardianName = this.guardianName;
value.guardianCif = this.guardianCif;
value.guardianCifNumber = this.guardianCif;
value.guardianRelationship = this.guardianRelationship;
value.minorDob = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'yyyy-MM-dd') : null;
value.minorDateOfBirth = this.minorDob ? this.dateUtils.formatDate(this.minorDob, 'yyyy-MM-dd') : null;
}
if (this.selectedLinkedAccount) {
@@ -43,6 +43,237 @@
</div>
</div>
<!-- ══ 1b. Status of Account ════════════════════════════════════ -->
@if (recurringDepositAccountData?.accountStatus) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-id-card preview-section__icon"></i>
<span class="preview-section__title">Status of Account</span>
<span class="preview-section__badge">RBI Guidelines</span>
</div>
<div class="preview-body">
<!-- Status Tile -->
<div class="preview-soa-status-row">
<span class="preview-soa-tile">
@switch (recurringDepositAccountData.accountStatus) {
@case ('INDIVIDUAL_MALE') {
<i class="fas fa-male"></i> Individual (Male)
}
@case ('INDIVIDUAL_FEMALE') {
<i class="fas fa-female"></i> Individual (Female)
}
@case ('SINGLE') {
<i class="fas fa-user-circle"></i> Single Account
}
@case ('JOINT') {
<i class="fas fa-users"></i> Joint Account
}
@case ('MINOR') {
<i class="fas fa-child"></i> Minor Account
}
@case ('SENIOR_CITIZEN') {
<i class="fas fa-user-clock"></i> Senior Citizen
}
@default {
{{ recurringDepositAccountData.accountStatus }}
}
}
</span>
</div>
<!-- JOINT: Mode of Operation + Holders Table -->
@if (recurringDepositAccountData.accountStatus === 'JOINT') {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Mode of Operation</span>
<span class="preview-value">
@switch (recurringDepositAccountData.modeOfOperation) {
@case ('EITHER_OR_SURVIVOR') {
Either or Survivor
}
@case ('FORMER_OR_SURVIVOR') {
Former or Survivor
}
@case ('JOINTLY') {
Jointly
}
@case ('ANYONE_OR_SURVIVOR') {
Anyone or Survivor
}
@default {
{{ recurringDepositAccountData.modeOfOperation || '—' }}
}
}
</span>
</div>
</div>
@if (recurringDepositAccountData.jointHolders?.length) {
<div class="preview-soa-table-wrap">
<table class="preview-soa-tbl">
<thead>
<tr>
<th class="preview-soa-th">Sr.</th>
<th class="preview-soa-th">Holder Name</th>
<th class="preview-soa-th">CIF No.</th>
<th class="preview-soa-th">Ownership %</th>
<th class="preview-soa-th">Signing</th>
<th class="preview-soa-th">Role</th>
</tr>
</thead>
<tbody>
@for (holder of recurringDepositAccountData.jointHolders; track holder.clientId; let i = $index) {
<tr [class.preview-soa-tr--primary]="holder.isPrimary">
<td class="preview-soa-td">{{ i + 1 }}</td>
<td class="preview-soa-td">
{{ holder.displayName || holder.clientName || '—' }}
@if (holder.isPrimary) {
<span class="preview-soa-primary-tag">Primary</span>
}
</td>
<td class="preview-soa-td preview-mono">{{ holder.cifNumber || holder.clientCif || '—' }}</td>
<td class="preview-soa-td">{{ holder.sharePercentage ?? '—' }}%</td>
<td class="preview-soa-td">{{ holder.isMandatory ? 'Mandatory' : 'Optional' }}</td>
<td class="preview-soa-td">{{ holder.isPrimary ? 'Primary Account Holder' : 'Co-Holder' }}</td>
</tr>
}
</tbody>
</table>
</div>
}
}
<!-- INDIVIDUAL_MALE: Special Category -->
@if (
recurringDepositAccountData.accountStatus === 'INDIVIDUAL_MALE' && recurringDepositAccountData.specialCategory
) {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Special Category</span>
<span class="preview-value">
@switch (recurringDepositAccountData.specialCategory) {
@case ('DEFENCE') {
Defence Personnel
}
@case ('EX_SERVICEMAN') {
Ex-Serviceman
}
@case ('GOVT_EMPLOYEE') {
Government Employee
}
@case ('PHYSICALLY_CHALLENGED') {
Physically Challenged
}
@case ('NRI') {
NRI (Non-Resident Indian)
}
@case ('NONE') {
None / General
}
@default {
{{ recurringDepositAccountData.specialCategory }}
}
}
</span>
</div>
</div>
}
<!-- INDIVIDUAL_FEMALE: Weaker Section -->
@if (
recurringDepositAccountData.accountStatus === 'INDIVIDUAL_FEMALE' && recurringDepositAccountData.weakerSection
) {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
<div class="preview-field">
<span class="preview-label">Weaker Section</span>
<span class="preview-value">
@switch (recurringDepositAccountData.weakerSection) {
@case ('BPL') {
BPL (Below Poverty Line)
}
@case ('SC_ST') {
SC / ST Category
}
@case ('MINORITY') {
Minority Community
}
@case ('SHG') {
Self Help Group Member
}
@case ('PMJDY') {
PMJDY Beneficiary
}
@case ('NONE') {
None / General
}
@default {
{{ recurringDepositAccountData.weakerSection }}
}
}
</span>
</div>
</div>
}
<!-- MINOR: Guardian Details -->
@if (recurringDepositAccountData.accountStatus === 'MINOR') {
<div class="preview-grid preview-grid--three" style="margin-top: 12px">
@if (recurringDepositAccountData.guardianName) {
<div class="preview-field">
<span class="preview-label">Guardian Name</span>
<span class="preview-value">{{ recurringDepositAccountData.guardianName }}</span>
</div>
}
@if (recurringDepositAccountData.guardianCifNumber) {
<div class="preview-field">
<span class="preview-label">Guardian CIF</span>
<span class="preview-value preview-mono">{{ recurringDepositAccountData.guardianCifNumber }}</span>
</div>
}
@if (recurringDepositAccountData.guardianRelationship) {
<div class="preview-field">
<span class="preview-label">Relationship</span>
<span class="preview-value">{{ recurringDepositAccountData.guardianRelationship }}</span>
</div>
}
@if (recurringDepositAccountData.minorDateOfBirth) {
<div class="preview-field">
<span class="preview-label">Minor DOB</span>
<span class="preview-value">{{ recurringDepositAccountData.minorDateOfBirth }}</span>
</div>
}
</div>
}
</div>
</div>
}
<!-- ══ 1c. Linked Account ════════════════════════════════════════ -->
@if (recurringDepositAccountData?.linkedAccountId) {
<div class="preview-section">
<div class="preview-section__header">
<i class="fas fa-link preview-section__icon"></i>
<span class="preview-section__title">Linked Deposit Account</span>
<span class="preview-section__badge">{{ recurringDepositAccountData.linkedAccountType }}</span>
</div>
<div class="preview-body">
<div class="preview-grid preview-grid--three">
<div class="preview-field">
<span class="preview-label">Account No</span>
<span class="preview-value preview-mono">{{ recurringDepositAccountData.linkedAccountNo }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Account Type</span>
<span class="preview-value">{{ recurringDepositAccountData.linkedAccountType }}</span>
</div>
<div class="preview-field">
<span class="preview-label">Account ID</span>
<span class="preview-value preview-mono">{{ recurringDepositAccountData.linkedAccountId }}</span>
</div>
</div>
</div>
</div>
}
<!-- ══ 2. Product Classification ════════════════════════════════ -->
@if (
recurringDepositsAccountProductTemplate?.accountType ||
@@ -16,18 +16,18 @@
// ── Section card ─────────────────────────────────────────────────────────────
.preview-section {
border: 1px solid #e0e0e0;
border-radius: 8px;
border: 1px solid #e2e8f0;
border-radius: 10px;
overflow: hidden;
background: #fff;
box-shadow: 0 1px 3px rgb(0 0 0 / 6%);
box-shadow: 0 1px 4px rgb(0 0 0 / 5%);
&__header {
display: flex;
align-items: center;
gap: 8px;
background: #f5f5f5;
border-bottom: 1px solid #e0e0e0;
background: #f8fafc;
border-bottom: 1px solid #e2e8f0;
padding: 0.6rem 1rem;
}
@@ -40,11 +40,11 @@
&__title {
flex: 1;
font-size: 0.95rem;
font-weight: 600;
color: #333;
font-size: 0.82rem;
font-weight: 700;
color: #1e293b;
text-transform: uppercase;
letter-spacing: 0.04em;
letter-spacing: 0.06em;
}
&__badge {
@@ -93,7 +93,7 @@
// ── Grid ─────────────────────────────────────────────────────────────────────
.preview-grid {
display: grid;
gap: 0.75rem 1.5rem;
gap: 0.85rem 1.5rem;
&--three {
grid-template-columns: repeat(3, 1fr);
@@ -116,33 +116,38 @@
}
.preview-label {
font-size: 0.72rem;
color: #888;
font-weight: 500;
font-size: 0.68rem;
color: #94a3b8;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.04em;
letter-spacing: 0.05em;
}
.preview-value {
font-size: 0.92rem;
color: #222;
font-size: 0.9rem;
color: #1e293b;
font-weight: 500;
}
// ── Yes/No badge ─────────────────────────────────────────────────────────────
.preview-badge {
display: inline-block;
padding: 0.1rem 0.55rem;
padding: 0.15rem 0.6rem;
border-radius: 12px;
font-size: 0.78rem;
font-size: 0.75rem;
font-weight: 600;
background: #ffebee;
color: #c62828;
background: #fef2f2;
color: #dc2626;
width: fit-content;
&--yes {
background: #e8f5e9;
color: #2e7d32;
background: #f0fdf4;
color: #15803d;
}
&--warn {
background: #fef3c7;
color: #92400e;
}
}
@@ -339,6 +344,81 @@
}
}
// ── Status of Account (SOA) ───────────────────────────────────────────────────
.preview-soa-status-row {
display: flex;
align-items: center;
gap: 10px;
}
.preview-soa-tile {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 8px 20px;
border-radius: 999px;
font-size: 14px;
font-weight: 700;
background: #eff6ff;
color: #1d4ed8;
border: 2px solid #bfdbfe;
i {
font-size: 16px;
}
}
.preview-soa-table-wrap {
margin-top: 14px;
overflow-x: auto;
border-radius: 8px;
border: 1px solid #e2e8f0;
}
.preview-soa-tbl {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.preview-soa-th {
background: #f8fafc;
padding: 8px 12px;
text-align: left;
font-weight: 600;
color: #475569;
border-bottom: 1px solid #e2e8f0;
white-space: nowrap;
}
.preview-soa-td {
padding: 10px 12px;
border-bottom: 1px solid #f1f5f9;
color: #0f172a;
vertical-align: middle;
}
.preview-soa-tr--primary {
background: #f0f9ff;
.preview-soa-td {
font-weight: 600;
}
}
.preview-soa-primary-tag {
display: inline-block;
margin-left: 6px;
padding: 1px 8px;
border-radius: 999px;
font-size: 10px;
font-weight: 700;
background: #dbeafe;
color: #1d4ed8;
border: 1px solid #bfdbfe;
vertical-align: middle;
}
// ── Product feature flag rows (same style as details step) ────────────────────
.preview-feature-list {
margin-top: 1rem;
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

+2 -2
View File
@@ -9,8 +9,8 @@
/* tslint:disable */
export default {
'mifos_x': {
'version': '260429',
'hash': '0d3d8379'
'version': '260430',
'hash': '2d4fb423'
},
'allow_switching_backend_instance': true
};
+4 -2
View File
@@ -31,7 +31,8 @@
mifosx-loans-view,
mifosx-shares-account-view,
mifosx-recurring-deposits-account-view,
mifosx-savings-account-view {
mifosx-savings-account-view,
mifosx-current-account-account-view {
.account-card {
margin: 0 auto;
max-width: 90rem;
@@ -98,7 +99,8 @@
}
.content {
.savings-account-tables {
.savings-account-tables,
.current-account-tables {
padding: 1%;
margin: 1%;
+4 -2
View File
@@ -69,7 +69,8 @@
mifosx-loans-view,
mifosx-shares-account-view,
mifosx-recurring-deposits-account-view,
mifosx-savings-account-view {
mifosx-savings-account-view,
mifosx-current-account-account-view {
.account-card {
margin: 0 auto;
max-width: 90rem;
@@ -137,7 +138,8 @@
}
.content {
.savings-account-tables {
.savings-account-tables,
.current-account-tables {
padding: 1%;
margin: 1%;