Files
cbsnexora/src/app/home/home.service.ts
T

97 lines
3.3 KiB
TypeScript

/**
* Copyright since 2025 Mifos Initiative
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
/** Angular Imports */
import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpParams } from '@angular/common/http';
/** rxjs Imports */
import { Observable } from 'rxjs';
/**
* Home Service
*/
@Injectable({
providedIn: 'root'
})
export class HomeService {
private http = inject(HttpClient);
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getCollectedAmount(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/Demand Vs Collection', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getDisbursedAmount(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/Disbursal Vs Awaitingdisbursal', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getClientTrendsByDay(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/ClientTrendsByDay', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getClientTrendsByWeek(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/ClientTrendsByWeek', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getClientTrendsByMonth(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/ClientTrendsByMonth', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getLoanTrendsByDay(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/LoanTrendsByDay', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getLoanTrendsByWeek(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/LoanTrendsByWeek', { params: httpParams });
}
/**
* @param {number} officeId Office Id.
* @returns {Observable<any>}
*/
getLoanTrendsByMonth(officeId: number): Observable<any> {
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
return this.http.get('/runreports/LoanTrendsByMonth', { params: httpParams });
}
}