Skip to content

Commit 97302a7

Browse files
authored
Merge pull request #2830 from gkbishnoi07/WEB-272-replace-custom-api-of-home-service-ts
WEB-272 replace custom api of home.service.ts
2 parents c9c276e + c96b3e1 commit 97302a7

File tree

5 files changed

+65
-94
lines changed

5 files changed

+65
-94
lines changed

src/app/customApis.service.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,3 +231,65 @@ export class OrganizationService {
231231
});
232232
}
233233
}
234+
235+
/**
236+
* Home Service
237+
*/
238+
@Injectable({
239+
providedIn: 'root'
240+
})
241+
export class HomeService {
242+
/**
243+
* @param {HttpClient} http Http Client to send requests.
244+
*/
245+
constructor(private http: HttpClient) {}
246+
247+
/**
248+
* @param {number} officeId Office Id.
249+
* @returns {Observable<any>}
250+
*/
251+
getCollectedAmount(officeId: number): Observable<any> {
252+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
253+
return this.http.get('/runreports/Demand Vs Collection', { params: httpParams });
254+
}
255+
256+
getDisbursedAmount(officeId: number): Observable<any> {
257+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
258+
return this.http.get('/runreports/Disbursal Vs Awaitingdisbursal', { params: httpParams });
259+
}
260+
261+
/**
262+
* @param {number} officeId Office Id.
263+
* @returns {Observable<any>}
264+
*/
265+
266+
getClientTrendsByDay(officeId: number): Observable<any> {
267+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
268+
return this.http.get('/runreports/ClientTrendsByDay', { params: httpParams });
269+
}
270+
271+
getLoanTrendsByDay(officeId: number): Observable<any> {
272+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
273+
return this.http.get('/runreports/LoanTrendsByDay', { params: httpParams });
274+
}
275+
276+
getClientTrendsByWeek(officeId: number): Observable<any> {
277+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
278+
return this.http.get('/runreports/ClientTrendsByWeek', { params: httpParams });
279+
}
280+
281+
getClientTrendsByMonth(officeId: number): Observable<any> {
282+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
283+
return this.http.get('/runreports/ClientTrendsByMonth', { params: httpParams });
284+
}
285+
286+
getLoanTrendsByWeek(officeId: number): Observable<any> {
287+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
288+
return this.http.get('/runreports/LoanTrendsByWeek', { params: httpParams });
289+
}
290+
291+
getLoanTrendsByMonth(officeId: number): Observable<any> {
292+
const httpParams = new HttpParams().set('R_officeId', officeId.toString()).set('genericResultSet', 'false');
293+
return this.http.get('/runreports/LoanTrendsByMonth', { params: httpParams });
294+
}
295+
}

src/app/home/dashboard/amount-collected-pie/amount-collected-pie.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
44
import { ActivatedRoute } from '@angular/router';
55

66
/** Custom Services */
7-
import { HomeService } from '../../home.service';
7+
import { HomeService } from 'app/customApis.service';
88

99
/** Charting Imports */
1010
import Chart from 'chart.js';

src/app/home/dashboard/amount-disbursed-pie/amount-disbursed-pie.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
44
import { ActivatedRoute } from '@angular/router';
55

66
/** Custom Services */
7-
import { HomeService } from '../../home.service';
7+
import { HomeService } from 'app/customApis.service';
88

99
/** Charting Imports */
1010
import Chart from 'chart.js';

src/app/home/dashboard/client-trends-bar/client-trends-bar.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { forkJoin, merge } from 'rxjs';
88
import { skip } from 'rxjs/operators';
99

1010
/** Custom Services */
11-
import { HomeService } from '../../home.service';
11+
import { HomeService } from 'app/customApis.service';
1212

1313
/** Charting Imports */
1414
import { Dates } from 'app/core/utils/dates';

src/app/home/home.service.ts

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)