33 lines
944 B
TypeScript
33 lines
944 B
TypeScript
/** Angular Imports */
|
|
import { Injectable } from '@angular/core';
|
|
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
|
|
|
/** rxjs Imports */
|
|
import { Observable } from 'rxjs';
|
|
|
|
/** Custom Services */
|
|
import { OrganizationService } from 'app/organization/organization.service';
|
|
|
|
/**
|
|
* Cashier transaction data resolver.
|
|
*/
|
|
@Injectable()
|
|
export class CashierTransactionTemplateResolver implements Resolve<Object> {
|
|
|
|
/**
|
|
* @param {OrganizationService} organizationService Organization service.
|
|
*/
|
|
constructor(private organizationService: OrganizationService) {}
|
|
|
|
/**
|
|
* Returns the cashier transaction data.
|
|
* @returns {Observable<any>}
|
|
*/
|
|
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
|
const cashierId = route.parent.paramMap.get('id');
|
|
const tellerId = route.parent.parent.paramMap.get('id');
|
|
return this.organizationService.getCashierTransactionTemplate(tellerId, cashierId);
|
|
}
|
|
|
|
}
|