Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

/** Custom Services */
import { SystemService } from 'app/system/system.service';
import { GlobalConfigurationService } from '@fineract/client';

/**
* Offices data resolver.
*/
@Injectable()
export class ExternalAssetConfigurationResolver {
/**
* @param {AccountingService} accountingService Accounting service.
* @param {GlobalConfigurationService} globalConfigurationService Global configuration service.
*/
constructor(private systemService: SystemService) {}
constructor(private globalConfigurationService: GlobalConfigurationService) {}

/**
* Returns the offices data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.systemService.getConfigurationByName(SystemService.CONFIG_ASSET_EXTERNALIZATION);
return this.globalConfigurationService.retrieveOneByName({ name: 'CONFIG_ASSET_EXTERNALIZATION' });
}
}
9 changes: 9 additions & 0 deletions src/app/customApis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,12 @@ export class OrganizationService {
});
}
}
@Injectable({
providedIn: 'root'
})
export class SystemService {
constructor(private http: HttpClient) {}
getExternalEventConfiguration(): Observable<any> {
return this.http.get('/externalevents/configuration');
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { GlobalConfigurationService } from '@fineract/client';
import { Observable } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class LoanArrearDelinquencyResolver {
/**
* @param {SystemService} systemService System service.
* @param {GlobalConfigurationService} globalConfigurationService Global configuration service.
*/
constructor(private systemService: SystemService) {}
constructor(private globalConfigurationService: GlobalConfigurationService) {}

/**
* Returns the loan-arrears-delinquency-display-data configuration data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
return this.systemService.getConfigurationByName('loan-arrears-delinquency-display-data');
return this.globalConfigurationService.retrieveOneByName({ name: 'loan-arrears-delinquency-display-data' });
}
}
13 changes: 8 additions & 5 deletions src/app/loans/loans-view/charges-tab/charges-tab.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
import { Dates } from 'app/core/utils/dates';
import { SystemService } from 'app/system/system.service';
import { GlobalConfigurationService } from '@fineract/client';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
import { TranslateService } from '@ngx-translate/core';
import { NgIf, CurrencyPipe } from '@angular/common';
Expand Down Expand Up @@ -98,6 +98,7 @@ export class ChargesTabComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Settings Service
* @param {GlobalConfigurationService} globalConfigurationService Global Configuration Service
*/
constructor(
private loanChargesService: LoanChargesService,
Expand All @@ -107,17 +108,19 @@ export class ChargesTabComponent implements OnInit {
private translateService: TranslateService,
public dialog: MatDialog,
private settingsService: SettingsService,
private systemService: SystemService
private globalConfigurationService: GlobalConfigurationService
) {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
}

ngOnInit() {
this.systemService.getConfigurationByName('charge-accrual-date').subscribe((config: GlobalConfiguration) => {
this.useDueDate = config.stringValue === 'due-date';
});
this.globalConfigurationService
.retrieveOneByName({ name: 'charge-accrual-date' })
.subscribe((config: GlobalConfiguration) => {
this.useDueDate = config.stringValue === 'due-date';
});
this.chargesData = this.loanDetails.charges;
this.status = this.loanDetails.status.value;
let actionFlag;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';

/** rxjs Imports */
import { Observable } from 'rxjs';
Expand All @@ -12,9 +12,9 @@ import { Observable } from 'rxjs';
@Injectable()
export class OfficeDatatableResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the Office's Datatable data.
Expand All @@ -23,6 +23,12 @@ export class OfficeDatatableResolver {
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const officeId = route.parent.parent.paramMap.get('officeId');
const datatableName = route.paramMap.get('datatableName');
return this.systemService.getEntityDatatable(officeId, datatableName);
const requestParams = {
datatableName: datatableName,
entityId: officeId
};
return this.dataTablesService.getDatatables({
apptable: datatableName
});
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';

/** rxjs Imports */
import { Observable } from 'rxjs';
Expand All @@ -12,15 +12,15 @@ import { Observable } from 'rxjs';
@Injectable()
export class OfficeDatatablesResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
return this.systemService.getEntityDatatables('m_office');
return this.dataTablesService.getDatatables({ apptable: 'm_office' });
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class LoanProductDatatableResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
Expand All @@ -19,6 +19,8 @@ export class LoanProductDatatableResolver {
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const productId = route.parent.parent.paramMap.get('productId');
const datatableName = route.paramMap.get('datatableName');
return this.systemService.getEntityDatatable(productId, datatableName);
return this.dataTablesService.getDatatables({
apptable: datatableName ?? undefined
});
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class LoanProductDatatablesResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
return this.systemService.getEntityDatatables('m_product_loan');
return this.dataTablesService.getDatatables({ apptable: 'm_product_loan' });
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Injectable } from '@angular/core';
import { ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class SavingProductDatatableResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
Expand All @@ -19,6 +19,6 @@ export class SavingProductDatatableResolver {
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const productId = route.parent.parent.paramMap.get('productId');
const datatableName = route.paramMap.get('datatableName');
return this.systemService.getEntityDatatable(productId, datatableName);
return this.dataTablesService.getDatatables({ apptable: datatableName ?? undefined });
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Injectable } from '@angular/core';
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable, of } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class SavingProductDatatablesResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
return this.systemService.getEntityDatatables('m_savings_product');
return this.dataTablesService.getDatatables({ apptable: 'm_savings_product' });
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Injectable } from '@angular/core';
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable, of } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class ShareProductDatatableResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
Expand All @@ -19,6 +19,6 @@ export class ShareProductDatatableResolver {
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const productId = route.parent.parent.paramMap.get('productId');
const datatableName = route.paramMap.get('datatableName');
return this.systemService.getEntityDatatable(productId, datatableName);
return this.dataTablesService.getDatatables({ apptable: datatableName ?? undefined });
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import { Injectable } from '@angular/core';
import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/router';
import { SystemService } from 'app/system/system.service';
import { DataTablesService } from '@fineract/client';
import { Observable, of } from 'rxjs';

@Injectable({
providedIn: 'root'
})
export class ShareProductDatatablesResolver {
/**
* @param {SystemService} systemService Products service.
* @param {DataTablesService} dataTablesService Data Tables service.
*/
constructor(private systemService: SystemService) {}
constructor(private dataTablesService: DataTablesService) {}

/**
* Returns the loan product data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
return this.systemService.getEntityDatatables('m_share_product');
return this.dataTablesService.getDatatables({ apptable: 'm_share_product' });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Dates } from 'app/core/utils/dates';
import { SavingsService } from 'app/savings/savings.service';
import { SettingsService } from 'app/settings/settings.service';
import { Currency } from 'app/shared/models/general.model';
import { SystemService } from 'app/system/system.service';
import { CodesService, CodeValuesService } from '@fineract/client';
import { MatCard, MatCardTitle, MatCardContent, MatCardActions } from '@angular/material/card';
import { InputAmountComponent } from '../../../shared/input-amount/input-amount.component';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
Expand Down Expand Up @@ -57,15 +57,18 @@ export class ManageSavingsAccountComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route
* @param {Router} router Router
* @param {SettingsService} settingsService Setting service
* @param {CodeValuesService} codeValuesService Code Values Service
* @param {CodesService} codesService Codes Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private savingsService: SavingsService,
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
private systemService: SystemService,
private settingsService: SettingsService
private settingsService: SettingsService,
private codeValuesService: CodeValuesService,
private codesService: CodesService
) {
this.transactionCommand = this.route.snapshot.params['name'].toLowerCase().replaceAll(' ', '');
this.transactionType[this.transactionCommand] = true;
Expand Down Expand Up @@ -98,10 +101,10 @@ export class ManageSavingsAccountComponent implements OnInit {
codeName = 'DebitTransactionFreezeReasons';
}

this.systemService.getCodes().subscribe((codes: any) => {
this.codesService.retrieveCodes().subscribe((codes: any) => {
codes.some((code: any) => {
if (code.name === codeName) {
this.systemService.getCodeValues(code.id).subscribe((codeValues: any) => {
this.codeValuesService.retrieveAllCodeValues(code.id).subscribe((codeValues: any) => {
this.reasonOptions = codeValues;
return true;
});
Expand Down
Loading