feat: add loan transactions tab actions (#1206)
- add export transaction - add view transactions - add edit transactions - add undo transactions - add view receipt Fixes: #1205
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../loans.service';
|
||||
|
||||
/**
|
||||
* Loans Account Transaction Template data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoansAccountTransactionTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {LoansService} LoansService Loans service.
|
||||
*/
|
||||
constructor(private loansService: LoansService) { }
|
||||
|
||||
/**
|
||||
* Returns the Loans Account Transaction Template data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const loanAccountId = route.parent.parent.parent.paramMap.get('loanId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.loansService.getLoansAccountTransactionTemplate(loanAccountId, transactionId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../loans.service';
|
||||
|
||||
/**
|
||||
* Loans Account Transaction data resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoansAccountTransactionResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {LoansService} LoansService Loans service.
|
||||
*/
|
||||
constructor(private loansService: LoansService) { }
|
||||
|
||||
/**
|
||||
* Returns the Loans Account Transaction data.
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const loanAccountId = route.parent.parent.parent.paramMap.get('loanId');
|
||||
const transactionId = route.paramMap.get('id');
|
||||
return this.loansService.getLoansAccountTransaction(loanAccountId, transactionId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
|
||||
|
||||
/** rxjs Imports */
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
/** Custom Services */
|
||||
import { ReportsService } from 'app/reports/reports.service';
|
||||
|
||||
/**
|
||||
* Loans Transaction Reciept resolver.
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoansTransactionRecieptResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {ReportsService} reportsService Reports service.
|
||||
*/
|
||||
constructor(private reportsService: ReportsService) { }
|
||||
|
||||
/**
|
||||
* Returns the Loans Transaction Reciept
|
||||
* @param {ActivatedRouteSnapshot} route Route Snapshot
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||
const transactionId = route.paramMap.get('id');
|
||||
const data = {
|
||||
'output-type': 'PDF',
|
||||
R_transactionId: transactionId
|
||||
};
|
||||
return this.reportsService.getPentahoRunReportData({name: 'Loan Transaction Receipt'}, data, 'default', 'en', 'dd MMMM yyyy');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user