Skip to content

Commit e1dc122

Browse files
WEB-657: Working Capital product with default accounting rule
1 parent 8ecadcc commit e1dc122

5 files changed

Lines changed: 8 additions & 44 deletions

File tree

src/app/products/loan-products/create-loan-product/create-loan-product.component.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ export class CreateLoanProductComponent extends LoanProductBaseComponent impleme
376376
submitWCProduct(): void {
377377
const loanProduct = this.loanProducts.buildPayload(this.loanProduct, this.itemsByDefault);
378378

379+
loanProduct['accountingRule'] = 'NONE';
380+
379381
this.productsService
380382
.createLoanProduct(this.loanProductService.loanProductPath, loanProduct)
381383
.subscribe((response: any) => {

src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,10 @@ export class EditLoanProductComponent extends LoanProductBaseComponent implement
415415
delete loanProduct['useDueForRepaymentsConfigurations'];
416416
}
417417

418+
if (this.loanProductService.isWorkingCapital) {
419+
loanProduct['accountingRule'] = 'NONE';
420+
}
421+
418422
this.productsService
419423
.updateLoanProduct(this.loanProductService.loanProductPath, this.loanProductAndTemplate.id, loanProduct)
420424
.subscribe((response: any) => {

src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
</button>
9494
}
9595
</mat-form-field>
96-
<mat-divider class="flex-98"></mat-divider>
9796
} @else if (loanProductService.isLoanProduct) {
9897
<mat-form-field class="flex-30">
9998
<mat-label>{{ 'labels.inputs.products.loan.Amortization' | translate }}</mat-label>

src/app/products/loan-products/loan-product-stepper/loan-product-settings-step/loan-product-settings-step.component.ts

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,8 @@ export class LoanProductSettingsStepComponent extends LoanProductBaseComponent i
188188
delinquencyStartType: this.loanProductsTemplate.delinquencyStartType
189189
? this.loanProductsTemplate.delinquencyStartType.id
190190
: null,
191-
breachId: this.loanProductsTemplate.breach?.id ?? null,
192-
enableNearBreach: this.loanProductsTemplate.enableNearBreach || false
191+
breachId: this.loanProductsTemplate.breach?.id ?? null
193192
});
194-
195-
if (this.loanProductsTemplate.enableNearBreach) {
196-
this.loanProductSettingsForm.patchValue({
197-
nearBreachEvalFrequency: this.loanProductsTemplate.nearBreachEvalFrequency || '',
198-
nearBreachEvalFrequencyType: this.loanProductsTemplate.nearBreachEvalFrequencyType?.id || '',
199-
nearBreachThreshold: this.loanProductsTemplate.nearBreachThreshold || ''
200-
});
201-
}
202193
}
203194

204195
this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(
@@ -468,8 +459,7 @@ export class LoanProductSettingsStepComponent extends LoanProductBaseComponent i
468459
]
469460
],
470461
delinquencyStartType: [''],
471-
breachId: [''],
472-
enableNearBreach: [false]
462+
breachId: ['']
473463
});
474464
}
475465
}
@@ -870,31 +860,6 @@ export class LoanProductSettingsStepComponent extends LoanProductBaseComponent i
870860
});
871861
}
872862
});
873-
874-
this.loanProductSettingsForm.get('enableNearBreach').valueChanges.subscribe((enableNearBreach: any) => {
875-
if (enableNearBreach) {
876-
this.loanProductSettingsForm.addControl(
877-
'nearBreachEvalFrequency',
878-
new UntypedFormControl('', Validators.required)
879-
);
880-
this.loanProductSettingsForm.addControl(
881-
'nearBreachEvalFrequencyType',
882-
new UntypedFormControl('', Validators.required)
883-
);
884-
this.loanProductSettingsForm.addControl(
885-
'nearBreachThreshold',
886-
new UntypedFormControl('', [
887-
Validators.required,
888-
Validators.min(0.01),
889-
Validators.max(100.0)
890-
])
891-
);
892-
} else {
893-
this.loanProductSettingsForm.removeControl('nearBreachEvalFrequency');
894-
this.loanProductSettingsForm.removeControl('nearBreachEvalFrequencyType');
895-
this.loanProductSettingsForm.removeControl('nearBreachThreshold');
896-
}
897-
});
898863
}
899864
}
900865

src/app/products/loan-products/models/loan-product.model.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ export interface LoanProduct {
186186
buydownFeeClassificationToIncomeAccountMappings?: ClassificationToIncomeAccountMapping[];
187187
capitalizedIncomeClassificationToIncomeAccountMappings?: ClassificationToIncomeAccountMapping[];
188188
writeOffReasonsToExpenseMappings?: ChargeOffReasonToExpenseAccountMapping[];
189-
190-
// Working Capital attributes
191-
enableNearBreach?: boolean;
192-
nearBreachEvalFrequency?: number;
193-
nearBreachEvalFrequencyType?: OptionData;
194-
nearBreachThreshold?: number;
195189
}
196190

197191
export interface AllowAttributeOverrides {

0 commit comments

Comments
 (0)