feat: standing instructions history (#1177)

Fixes: #1176
This commit is contained in:
Karan Takalkar
2020-08-05 17:04:59 +05:30
committed by GitHub
parent eefb325bdd
commit 8a783a3394
10 changed files with 362 additions and 6 deletions
@@ -0,0 +1,32 @@
/** 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);
}
}