-
Notifications
You must be signed in to change notification settings - Fork 925
Expand file tree
/
Copy pathloan-amortization-schedule.resolver.ts
More file actions
39 lines (35 loc) · 1.14 KB
/
loan-amortization-schedule.resolver.ts
File metadata and controls
39 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
import { Injectable, inject } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { Observable } from 'rxjs';
import { LoanBaseResolver } from '../loan-base.resolver';
import { LoansService } from 'app/loans/loans.service';
@Injectable({
providedIn: 'root'
})
export class LoanAmortizationScheduleResolver extends LoanBaseResolver {
private loansService = inject(LoansService);
constructor() {
super();
}
/**
* Returns the Loans with Association data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> | null {
this.initialize(route);
const loanId = route.paramMap.get('loanId') || route.parent?.paramMap.get('loanId');
if (!isNaN(+loanId)) {
if (this.isWorkingCapital) {
return this.loansService.getWorkingCapitalLoanAmortizationSchedule(loanId);
}
}
return null;
}
}