/** Angular Imports */ import { Injectable } from '@angular/core'; import { HttpClient, HttpParams } from '@angular/common/http'; /** rxjs Imports */ import { Observable } from 'rxjs'; /** * Home Service */ @Injectable({ providedIn: 'root' }) export class HomeService { /** * @param {HttpClient} http Http Client to send requests. */ constructor(private http: HttpClient) {} /** * @param {number} officeId Office Id. * @returns {Observable} */ getCollectedAmount(officeId: number): Observable { 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} */ getDisbursedAmount(officeId: number): Observable { 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} */ getClientTrendsByDay(officeId: number): Observable { 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} */ getClientTrendsByWeek(officeId: number): Observable { 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} */ getClientTrendsByMonth(officeId: number): Observable { 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} */ getLoanTrendsByDay(officeId: number): Observable { 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} */ getLoanTrendsByWeek(officeId: number): Observable { 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} */ getLoanTrendsByMonth(officeId: number): Observable { const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false'); return this.http.get('/runreports/LoanTrendsByMonth', { params: httpParams }); } }