Documents and Notes for Clients, Loans and Clients (#1632)

Co-authored-by: Jose Alberto Hernandez <alberto@MacBook-Pro.local>
This commit is contained in:
José Alberto Hernández
2023-01-05 03:19:41 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent 28d5d7595f
commit cafe8fa73d
57 changed files with 1119 additions and 468 deletions
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SavingDocumentsResolver } from './saving-documents.resolver';
describe('SavingDocumentsResolver', () => {
let resolver: SavingDocumentsResolver;
beforeEach(() => {
TestBed.configureTestingModule({});
resolver = TestBed.inject(SavingDocumentsResolver);
});
it('should be created', () => {
expect(resolver).toBeTruthy();
});
});
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import {
Resolve,
ActivatedRouteSnapshot
} from '@angular/router';
import { Observable } from 'rxjs';
import { SavingsService } from '../savings.service';
@Injectable({
providedIn: 'root'
})
export class SavingDocumentsResolver implements Resolve<boolean> {
/**
* @param {SavingsService} savingsService Savings service.
*/
constructor(private savingsService: SavingsService) { }
/**
* Returns the Savings data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const savingAccountId = route.parent.paramMap.get('savingAccountId');
return this.savingsService.getSavingsDocuments(savingAccountId);
}
}
@@ -0,0 +1,16 @@
import { TestBed } from '@angular/core/testing';
import { SavingNotesResolver } from './saving-notes.resolver';
describe('SavingNotesResolver', () => {
let resolver: SavingNotesResolver;
beforeEach(() => {
TestBed.configureTestingModule({});
resolver = TestBed.inject(SavingNotesResolver);
});
it('should be created', () => {
expect(resolver).toBeTruthy();
});
});
@@ -0,0 +1,27 @@
import { Injectable } from '@angular/core';
import {
Resolve,
ActivatedRouteSnapshot
} from '@angular/router';
import { Observable } from 'rxjs';
import { SavingsService } from '../savings.service';
@Injectable({
providedIn: 'root'
})
export class SavingNotesResolver implements Resolve<boolean> {
/**
* @param {SavingsService} savingsService Savings service.
*/
constructor(private savingsService: SavingsService) { }
/**
* Returns the Savings data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const savingAccountId = route.parent.paramMap.get('savingAccountId');
return this.savingsService.getSavingsNotes(savingAccountId);
}
}