feat: collateral module
This commit is contained in:
@@ -7,6 +7,7 @@ import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { ClientsService } from '../clients.service';
|
||||
import { ProductsService } from 'app/products/products.service';
|
||||
|
||||
/**
|
||||
* Client Actions data resolver.
|
||||
@@ -16,8 +17,10 @@ export class ClientActionsResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {ClientsService} clientsService Clients service.
|
||||
* @param {ProductsService} productsService Products Service
|
||||
*/
|
||||
constructor(private clientsService: ClientsService) { }
|
||||
constructor(private clientsService: ClientsService,
|
||||
private productsService: ProductsService) { }
|
||||
|
||||
/**
|
||||
* Returns the clients actions data.
|
||||
@@ -42,6 +45,8 @@ export class ClientActionsResolver implements Resolve<Object> {
|
||||
return this.clientsService.getOffices();
|
||||
case 'Add Charge':
|
||||
return this.clientsService.getClientChargeTemplate(clientId);
|
||||
case 'Create Collateral':
|
||||
return this.productsService.getCollaterals();
|
||||
case 'Client Screen Reports':
|
||||
return this.clientsService.getClientReportTemplates();
|
||||
case 'Assign Staff':
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { ClientsService } from '../clients.service';
|
||||
|
||||
/**
|
||||
* Client Charges data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class ClientCollateralResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {ClientsService} clientsService Clients service.
|
||||
*/
|
||||
constructor(private clientsService: ClientsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Client Collateral data.
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const clientId = route.parent.paramMap.get('clientId');
|
||||
return this.clientsService.getCollateralTemplate(clientId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user