Skip to content

Commit ae713b6

Browse files
committed
WEB-379 replace custom api of system.service.ts
1 parent c9c276e commit ae713b6

File tree

95 files changed

+914
-1318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+914
-1318
lines changed

src/app/accounting/common-resolvers/external-asset-configuration.resolver.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ import { Injectable } from '@angular/core';
55
import { Observable } from 'rxjs';
66

77
/** Custom Services */
8-
import { SystemService } from 'app/system/system.service';
8+
import { GlobalConfigurationService } from '@fineract/client';
99

1010
/**
1111
* Offices data resolver.
1212
*/
1313
@Injectable()
1414
export class ExternalAssetConfigurationResolver {
1515
/**
16-
* @param {AccountingService} accountingService Accounting service.
16+
* @param {GlobalConfigurationService} globalConfigurationService Global configuration service.
1717
*/
18-
constructor(private systemService: SystemService) {}
18+
constructor(private globalConfigurationService: GlobalConfigurationService) {}
1919

2020
/**
2121
* Returns the offices data.
2222
* @returns {Observable<any>}
2323
*/
2424
resolve(): Observable<any> {
25-
return this.systemService.getConfigurationByName(SystemService.CONFIG_ASSET_EXTERNALIZATION);
25+
return this.globalConfigurationService.retrieveOneByName({ name: 'CONFIG_ASSET_EXTERNALIZATION' });
2626
}
2727
}

src/app/customApis.service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,12 @@ export class OrganizationService {
231231
});
232232
}
233233
}
234+
@Injectable({
235+
providedIn: 'root'
236+
})
237+
export class SystemService {
238+
constructor(private http: HttpClient) {}
239+
getExternalEventConfiguration(): Observable<any> {
240+
return this.http.get('/externalevents/configuration');
241+
}
242+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { Injectable } from '@angular/core';
22
import { ActivatedRouteSnapshot } from '@angular/router';
3-
import { SystemService } from 'app/system/system.service';
3+
import { GlobalConfigurationService } from '@fineract/client';
44
import { Observable } from 'rxjs';
55

66
@Injectable({
77
providedIn: 'root'
88
})
99
export class LoanArrearDelinquencyResolver {
1010
/**
11-
* @param {SystemService} systemService System service.
11+
* @param {GlobalConfigurationService} globalConfigurationService Global configuration service.
1212
*/
13-
constructor(private systemService: SystemService) {}
13+
constructor(private globalConfigurationService: GlobalConfigurationService) {}
1414

1515
/**
1616
* Returns the loan-arrears-delinquency-display-data configuration data.
1717
* @returns {Observable<any>}
1818
*/
1919
resolve(route: ActivatedRouteSnapshot): Observable<any> {
20-
return this.systemService.getConfigurationByName('loan-arrears-delinquency-display-data');
20+
return this.globalConfigurationService.retrieveOneByName({ name: 'loan-arrears-delinquency-display-data' });
2121
}
2222
}

src/app/loans/loans-view/charges-tab/charges-tab.component.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
3232
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
3333
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
3434
import { Dates } from 'app/core/utils/dates';
35-
import { SystemService } from 'app/system/system.service';
35+
import { GlobalConfigurationService } from '@fineract/client';
3636
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
3737
import { TranslateService } from '@ngx-translate/core';
3838
import { NgIf, CurrencyPipe } from '@angular/common';
@@ -98,6 +98,7 @@ export class ChargesTabComponent implements OnInit {
9898
* Retrieves the loans data from `resolve`.
9999
* @param {ActivatedRoute} route Activated Route.
100100
* @param {SettingsService} settingsService Settings Service
101+
* @param {GlobalConfigurationService} globalConfigurationService Global Configuration Service
101102
*/
102103
constructor(
103104
private loanChargesService: LoanChargesService,
@@ -107,17 +108,19 @@ export class ChargesTabComponent implements OnInit {
107108
private translateService: TranslateService,
108109
public dialog: MatDialog,
109110
private settingsService: SettingsService,
110-
private systemService: SystemService
111+
private globalConfigurationService: GlobalConfigurationService
111112
) {
112113
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
113114
this.loanDetails = data.loanDetailsData;
114115
});
115116
}
116117

117118
ngOnInit() {
118-
this.systemService.getConfigurationByName('charge-accrual-date').subscribe((config: GlobalConfiguration) => {
119-
this.useDueDate = config.stringValue === 'due-date';
120-
});
119+
this.globalConfigurationService
120+
.retrieveOneByName({ name: 'charge-accrual-date' })
121+
.subscribe((config: GlobalConfiguration) => {
122+
this.useDueDate = config.stringValue === 'due-date';
123+
});
121124
this.chargesData = this.loanDetails.charges;
122125
this.status = this.loanDetails.status.value;
123126
let actionFlag;
Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** Angular Imports */
22
import { Injectable } from '@angular/core';
33
import { ActivatedRouteSnapshot } from '@angular/router';
4-
import { SystemService } from 'app/system/system.service';
4+
import { DataTablesService } from '@fineract/client';
55

66
/** rxjs Imports */
77
import { Observable } from 'rxjs';
@@ -12,9 +12,9 @@ import { Observable } from 'rxjs';
1212
@Injectable()
1313
export class OfficeDatatableResolver {
1414
/**
15-
* @param {SystemService} systemService Products service.
15+
* @param {DataTablesService} dataTablesService Data Tables service.
1616
*/
17-
constructor(private systemService: SystemService) {}
17+
constructor(private dataTablesService: DataTablesService) {}
1818

1919
/**
2020
* Returns the Office's Datatable data.
@@ -23,6 +23,12 @@ export class OfficeDatatableResolver {
2323
resolve(route: ActivatedRouteSnapshot): Observable<any> {
2424
const officeId = route.parent.parent.paramMap.get('officeId');
2525
const datatableName = route.paramMap.get('datatableName');
26-
return this.systemService.getEntityDatatable(officeId, datatableName);
26+
const requestParams = {
27+
datatableName: datatableName,
28+
entityId: officeId
29+
};
30+
return this.dataTablesService.getDatatables({
31+
apptable: datatableName
32+
});
2733
}
2834
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/** Angular Imports */
22
import { Injectable } from '@angular/core';
33
import { ActivatedRouteSnapshot } from '@angular/router';
4-
import { SystemService } from 'app/system/system.service';
4+
import { DataTablesService } from '@fineract/client';
55

66
/** rxjs Imports */
77
import { Observable } from 'rxjs';
@@ -12,15 +12,15 @@ import { Observable } from 'rxjs';
1212
@Injectable()
1313
export class OfficeDatatablesResolver {
1414
/**
15-
* @param {SystemService} systemService Products service.
15+
* @param {DataTablesService} dataTablesService Data Tables service.
1616
*/
17-
constructor(private systemService: SystemService) {}
17+
constructor(private dataTablesService: DataTablesService) {}
1818

1919
/**
2020
* Returns the loan product data.
2121
* @returns {Observable<any>}
2222
*/
2323
resolve(route: ActivatedRouteSnapshot): Observable<any> {
24-
return this.systemService.getEntityDatatables('m_office');
24+
return this.dataTablesService.getDatatables({ apptable: 'm_office' });
2525
}
2626
}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Injectable } from '@angular/core';
22
import { ActivatedRouteSnapshot } from '@angular/router';
3-
import { SystemService } from 'app/system/system.service';
3+
import { DataTablesService } from '@fineract/client';
44
import { Observable } from 'rxjs';
55

66
@Injectable({
77
providedIn: 'root'
88
})
99
export class LoanProductDatatableResolver {
1010
/**
11-
* @param {SystemService} systemService Products service.
11+
* @param {DataTablesService} dataTablesService Data Tables service.
1212
*/
13-
constructor(private systemService: SystemService) {}
13+
constructor(private dataTablesService: DataTablesService) {}
1414

1515
/**
1616
* Returns the loan product data.
@@ -19,6 +19,8 @@ export class LoanProductDatatableResolver {
1919
resolve(route: ActivatedRouteSnapshot): Observable<any> {
2020
const productId = route.parent.parent.paramMap.get('productId');
2121
const datatableName = route.paramMap.get('datatableName');
22-
return this.systemService.getEntityDatatable(productId, datatableName);
22+
return this.dataTablesService.getDatatables({
23+
apptable: datatableName ?? undefined
24+
});
2325
}
2426
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { Injectable } from '@angular/core';
22
import { ActivatedRouteSnapshot } from '@angular/router';
3-
import { SystemService } from 'app/system/system.service';
3+
import { DataTablesService } from '@fineract/client';
44
import { Observable } from 'rxjs';
55

66
@Injectable({
77
providedIn: 'root'
88
})
99
export class LoanProductDatatablesResolver {
1010
/**
11-
* @param {SystemService} systemService Products service.
11+
* @param {DataTablesService} dataTablesService Data Tables service.
1212
*/
13-
constructor(private systemService: SystemService) {}
13+
constructor(private dataTablesService: DataTablesService) {}
1414

1515
/**
1616
* Returns the loan product data.
1717
* @returns {Observable<any>}
1818
*/
1919
resolve(route: ActivatedRouteSnapshot): Observable<any> {
20-
return this.systemService.getEntityDatatables('m_product_loan');
20+
return this.dataTablesService.getDatatables({ apptable: 'm_product_loan' });
2121
}
2222
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import { Injectable } from '@angular/core';
22
import { ActivatedRouteSnapshot } from '@angular/router';
3-
import { SystemService } from 'app/system/system.service';
3+
import { DataTablesService } from '@fineract/client';
44
import { Observable } from 'rxjs';
55

66
@Injectable({
77
providedIn: 'root'
88
})
99
export class SavingProductDatatableResolver {
1010
/**
11-
* @param {SystemService} systemService Products service.
11+
* @param {DataTablesService} dataTablesService Data Tables service.
1212
*/
13-
constructor(private systemService: SystemService) {}
13+
constructor(private dataTablesService: DataTablesService) {}
1414

1515
/**
1616
* Returns the loan product data.
@@ -19,6 +19,6 @@ export class SavingProductDatatableResolver {
1919
resolve(route: ActivatedRouteSnapshot): Observable<any> {
2020
const productId = route.parent.parent.paramMap.get('productId');
2121
const datatableName = route.paramMap.get('datatableName');
22-
return this.systemService.getEntityDatatable(productId, datatableName);
22+
return this.dataTablesService.getDatatables({ apptable: datatableName ?? undefined });
2323
}
2424
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
import { Injectable } from '@angular/core';
22
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
3-
import { SystemService } from 'app/system/system.service';
3+
import { DataTablesService } from '@fineract/client';
44
import { Observable, of } from 'rxjs';
55

66
@Injectable({
77
providedIn: 'root'
88
})
99
export class SavingProductDatatablesResolver {
1010
/**
11-
* @param {SystemService} systemService Products service.
11+
* @param {DataTablesService} dataTablesService Data Tables service.
1212
*/
13-
constructor(private systemService: SystemService) {}
13+
constructor(private dataTablesService: DataTablesService) {}
1414

1515
/**
1616
* Returns the loan product data.
1717
* @returns {Observable<any>}
1818
*/
1919
resolve(route: ActivatedRouteSnapshot): Observable<any> {
20-
return this.systemService.getEntityDatatables('m_savings_product');
20+
return this.dataTablesService.getDatatables({ apptable: 'm_savings_product' });
2121
}
2222
}

0 commit comments

Comments
 (0)