Skip to content

Commit

Permalink
FINERACT-1981: Introduce Interest should not be calculated on past du…
Browse files Browse the repository at this point in the history
…e principal amount on API
  • Loading branch information
janez89 committed Nov 27, 2024
1 parent c2d72c9 commit 3be8f4c
Show file tree
Hide file tree
Showing 18 changed files with 45 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ActivatedRoute } from '@angular/router';
templateUrl: './loan-term-variations-tab.component.html',
styleUrls: ['./loan-term-variations-tab.component.scss']
})
export class LoanTermVariationsTabComponent implements OnInit {
export class LoanTermVariationsTabComponent {

/** Loan Details Data */
loanTermVariationsData: any[] = [];
Expand All @@ -21,8 +21,4 @@ export class LoanTermVariationsTabComponent implements OnInit {
});
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
}

ngOnInit(): void {
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -542,15 +542,19 @@ <h3 class="mat-h3" fxFlexFill>{{ 'labels.heading.Interest Recalculation' | trans
<div fxFlexFill *ngIf="loanProduct.interestRecalculationData.recalculationRestFrequencyType.id !== 1"
fxLayout="row wrap" fxLayout.lt-md="column">
<span fxFlex="47%">{{ 'labels.inputs.Frequency Interval for recalculation' | translate}}:</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.recalculationRestFrequencyInterval }}</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.recalculationRestFrequencyInterval }}</span>
<div fxFlexFill *ngIf="loanProduct.recalculationRestFrequencyDate">
<span fxFlex="47%">{{ 'labels.inputs.Rest Frequency Date' | translate}}:</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.recalculationRestFrequencyDate }}</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.recalculationRestFrequencyDate }}</span>
</div>
</div>
<div fxFlexFill>
<span fxFlex="47%">{{ 'labels.inputs.Is Arrears recognization based on original schedule' | translate}}:</span>
<span fxFlex="53%">{{ loanProduct.isArrearsBasedOnOriginalSchedule | yesNo }}</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.isArrearsBasedOnOriginalSchedule | yesNo }}</span>
</div>
<div fxFlexFill *ngIf="loanProduct.loanScheduleType.code === 'PROGRESSIVE'">
<span fxFlex="47%">{{ 'labels.inputs.Do not calculate interest on past due principal balances' | translate}}:</span>
<span fxFlex="53%">{{ loanProduct.interestRecalculationData.disallowInterestCalculationOnPastDue | yesNo }}</span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
allowCompoundingOnEod: this.loanProduct.allowCompoundingOnEod,
isArrearsBasedOnOriginalSchedule: this.loanProduct.isArrearsBasedOnOriginalSchedule,
isCompoundingToBePostedAsTransaction: this.loanProduct.isCompoundingToBePostedAsTransaction,
recalculationRestFrequencyInterval: this.loanProduct.recalculationRestFrequencyInterval
recalculationRestFrequencyInterval: this.loanProduct.recalculationRestFrequencyInterval,
disallowInterestCalculationOnPastDue: this.loanProduct.disallowInterestCalculationOnPastDue,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,10 @@ <h3 fxFlex="96%" class="mat-h3">{{'labels.heading.Interest Recalculation' | tran
{{'labels.inputs.Is Arrears recognization based on original schedule' | translate}}?
</mat-checkbox>

<mat-checkbox *ngIf="loanProductSettingsForm.value.loanScheduleType === 'PROGRESSIVE'" fxFlex="98%" labelPosition="before" formControlName="disallowInterestCalculationOnPastDue" class="margin-v">
{{'labels.inputs.Do not calculate interest on past due principal balances' | translate}}
</mat-checkbox>

</div>

<mat-divider fxFlex="98%"></mat-divider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.loanProductSettingsForm.removeControl('recalculationRestFrequencyType');
this.loanProductSettingsForm.removeControl('isArrearsBasedOnOriginalSchedule');
}
this.enableFieldsWhenScheduleTypeIsProgressiveAndInterestRateRecalculationEnabled();
});

this.loanProductSettingsForm.get('holdGuaranteeFunds').valueChanges
Expand Down Expand Up @@ -491,9 +492,25 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.setRescheduleStrategies();
}
this.processingStrategyService.initialize(this.isAdvancedTransactionProcessingStrategy);
this.enableFieldsWhenScheduleTypeIsProgressiveAndInterestRateRecalculationEnabled();
});
}

private enableFieldsWhenScheduleTypeIsProgressiveAndInterestRateRecalculationEnabled() {
const isProgressiveLoan = this.loanProductSettingsForm.get('loanScheduleType').value === LoanProducts.LOAN_SCHEDULE_TYPE_PROGRESSIVE;
const isInterestRecalculationEnabled = this.loanProductSettingsForm.get('isInterestRecalculationEnabled').value == true;
const shouldControlExists = isProgressiveLoan && isInterestRecalculationEnabled;
const isControlExists = this.loanProductSettingsForm.contains('disallowInterestCalculationOnPastDue');

if (shouldControlExists && !isControlExists) {
this.loanProductSettingsForm.addControl('disallowInterestCalculationOnPastDue', new UntypedFormControl(''));
this.loanProductSettingsForm.patchValue({'disallowInterestCalculationOnPastDue': this.loanProductsTemplate.interestRecalculationData?.disallowInterestCalculationOnPastDue ?? false});
} else if (isControlExists && !shouldControlExists) {
this.loanProductSettingsForm.patchValue({'disallowInterestCalculationOnPastDue': undefined });
this.loanProductSettingsForm.removeControl('disallowInterestCalculationOnPastDue');
}
}

private setRescheduleStrategies() {
if (this.advancedTransactionProcessingStrategyDisabled) {
this.rescheduleStrategyTypeData = this.rescheduleStrategyTypeDataBase.filter(
Expand Down
2 changes: 2 additions & 0 deletions src/app/products/loan-products/models/loan-product.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface LoanProduct {
recalculationCompoundingFrequencyType?: number;
recalculationRestFrequencyType?: number;
allowCompoundingOnEod?: boolean;
disallowInterestCalculationOnPastDue?: boolean;
isArrearsBasedOnOriginalSchedule?: boolean;
isCompoundingToBePostedAsTransaction?: boolean;
recalculationRestFrequencyInterval?: number;
Expand Down Expand Up @@ -168,4 +169,5 @@ export interface InterestRecalculationData {
isCompoundingToBePostedAsTransaction: boolean;
preClosureInterestCalculationStrategy: OptionData;
allowCompoundingOnEod: boolean;
disallowInterestCalculationOnPastDue: boolean;
}
1 change: 1 addition & 0 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Datum ukončení dividendového období",
"Dividend Period Start Date": "Datum zahájení dividendového období",
"Dividends": "Dividendy",
"Do not calculate interest on past due principal balances": "Neúčtovat úroky z dlužných hlavních zůstatků",
"Documents": "Dokumenty",
"Document Key": "Klíč dokumentu",
"Document Type": "Typ dokumentu",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Enddatum des Dividendenzeitraums",
"Dividend Period Start Date": "Startdatum des Dividendenzeitraums",
"Dividends": "Dividenden",
"Do not calculate interest on past due principal balances": "Berechnen Sie keine Zinsen auf überfällige Hauptbeträge",
"Documents": "Unterlagen",
"Document Key": "Dokumentschlüssel",
"Document Type": "Art des Dokuments",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@
"Dividend Period End Date": "Dividend Period End Date",
"Dividend Period Start Date": "Dividend Period Start Date",
"Dividends": "Dividends",
"Do not calculate interest on past due principal balances": "Do not calculate interest on past due principal balances",
"Documents": "Documents",
"Document Key": "Document Key",
"Document Type": "Document Type",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,7 @@
"Dividend Period End Date": "Fecha de finalización del período de dividendos",
"Dividend Period Start Date": "Fecha de inicio del período de dividendos",
"Dividends": "Dividendos",
"Do not calculate interest on past due principal balances": "No calcular intereses sobre saldos principales vencidos",
"Documents": "Documentos",
"Document Key": "Clave de documento",
"Document Type": "Tipo de Documento",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Date de fin de la période de dividende",
"Dividend Period Start Date": "Date de début de la période de dividende",
"Dividends": "Dividendes",
"Do not calculate interest on past due principal balances": "Ne pas calculer d'intérêts sur les soldes principaux échus",
"Documents": "Documents",
"Document Key": "Clé du document",
"Document Type": "Type de document",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Data di fine del periodo di dividendo",
"Dividend Period Start Date": "Data di inizio del periodo di dividendo",
"Dividends": "Dividendi",
"Do not calculate interest on past due principal balances": "Non calcolare interessi sui saldi principali scaduti",
"Documents": "Documenti",
"Document Key": "Chiave del documento",
"Document Type": "tipo di documento",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/ko-KO.json
Original file line number Diff line number Diff line change
Expand Up @@ -1506,6 +1506,7 @@
"Dividend Period End Date": "배당기간 종료일",
"Dividend Period Start Date": "배당기간 개시일",
"Dividends": "배당금",
"Do not calculate interest on past due principal balances": "연체된 원금 잔액에 대한 이자를 계산하지 마십시오",
"Documents": "서류",
"Document Key": "문서 키",
"Document Type": "문서 유형",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Dividendų laikotarpio pabaigos data",
"Dividend Period Start Date": "Dividendų laikotarpio pradžios data",
"Dividends": "Dividendai",
"Do not calculate interest on past due principal balances": "Neskaičiuoti palūkanų už pradelstus pagrindinius likučius",
"Documents": "Dokumentai",
"Document Key": "Dokumento raktas",
"Document Type": "dokumento tipas",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/lv-LV.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Dividenžu perioda beigu datums",
"Dividend Period Start Date": "Dividenžu perioda sākuma datums",
"Dividends": "Dividendes",
"Do not calculate interest on past due principal balances": "Neskaitīt procentus par kavētajiem pamatkapitāla atlikumiem",
"Documents": "Dokumenti",
"Document Key": "Dokumenta atslēga",
"Document Type": "Dokumenta veids",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/ne-NE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "लाभांश अवधि समाप्ति मिति",
"Dividend Period Start Date": "लाभांश अवधि सुरु मिति",
"Dividends": "लाभांश",
"Do not calculate interest on past due principal balances": "बकाया मूल चित्तको ब्याज गणना नगर्नुहोस्।",
"Documents": "कागजातहरू",
"Document Key": "कागजात कुञ्जी",
"Document Type": "कागजात प्रकार",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Data de término do período de dividendos",
"Dividend Period Start Date": "Data de início do período de dividendos",
"Dividends": "Dividendos",
"Do not calculate interest on past due principal balances": "Não calcular juros sobre os saldos principais em atraso",
"Documents": "Documentos",
"Document Key": "Chave do documento",
"Document Type": "tipo de documento",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/sw-SW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1505,6 +1505,7 @@
"Dividend Period End Date": "Tarehe ya Mwisho ya Kipindi cha Gawio",
"Dividend Period Start Date": "Tarehe ya Kuanza kwa Kipindi cha Gawio",
"Dividends": "Gawio",
"Do not calculate interest on past due principal balances": "Usihesabu riba juu ya salio la msingi lililokawia",
"Documents": "Nyaraka",
"Document Key": "Ufunguo wa Hati",
"Document Type": "Aina ya Hati",
Expand Down

0 comments on commit 3be8f4c

Please sign in to comment.