refractor: accounting module (#300)

* Refractor components.
* Add resolvers.
* Add relative router links.
* Replace mat-icons by font-awesome icons.
* Add comments.

Fixes: #298
This commit is contained in:
Abhay Chawla
2018-08-19 22:49:48 +05:30
committed by GitHub
parent 598f239251
commit 6e552d72eb
114 changed files with 3760 additions and 1432 deletions
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Accounting rules associations data resolver.
*/
@Injectable()
export class AccountingRulesAssociationsResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the accounting rules associations data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getAccountingRules(true);
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Currencies data resolver.
*/
@Injectable()
export class CurrenciesResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the currencies data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getCurrencies();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* GL accounts data resolver.
*/
@Injectable()
export class GlAccountsResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the gl accounts data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getGlAccounts();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Loan products data resolver.
*/
@Injectable()
export class LoanProductsResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the loan products data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getLoanProducts();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Offices data resolver.
*/
@Injectable()
export class OfficesResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the offices data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getOffices();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Payment types data resolver.
*/
@Injectable()
export class PaymentTypesResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the payment types data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getPaymentTypes();
}
}
@@ -0,0 +1,30 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { AccountingService } from '../accounting.service';
/**
* Provisioning categories data resolver.
*/
@Injectable()
export class ProvisioningCategoriesResolver implements Resolve<Object> {
/**
* @param {AccountingService} accountingService Accounting service.
*/
constructor(private accountingService: AccountingService) {}
/**
* Returns the Provisioning categories data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.accountingService.getProvisioningCategories();
}
}