Skip to content
Merged
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
62 changes: 62 additions & 0 deletions src/app/customApis.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,65 @@ export class OrganizationService {
});
}
}

/**
* 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<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 });
}

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 });
}

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 });
}

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 });
}

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 });
}

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 });
}

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 });
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

/** Custom Services */
import { HomeService } from '../../home.service';
import { HomeService } from 'app/customApis.service';

/** Charting Imports */
import Chart from 'chart.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';

/** Custom Services */
import { HomeService } from '../../home.service';
import { HomeService } from 'app/customApis.service';

/** Charting Imports */
import Chart from 'chart.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { forkJoin, merge } from 'rxjs';
import { skip } from 'rxjs/operators';

/** Custom Services */
import { HomeService } from '../../home.service';
import { HomeService } from 'app/customApis.service';

/** Charting Imports */
import { Dates } from 'app/core/utils/dates';
Expand Down
91 changes: 0 additions & 91 deletions src/app/home/home.service.ts

This file was deleted.