You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
100 lines
4.5 KiB
TypeScript
100 lines
4.5 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
|
|
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
|
|
import { Observable } from 'rxjs';
|
|
import { Request } from 'src/app/hmg-common/services/models/request';
|
|
import { OrganizationSalariesResponse } from './organization-salaries.response';
|
|
import { OpenMissingSwipesResponse } from './open-missing-swipes.response';
|
|
import { PerformanceAppraisalResponse } from './performance-appraisal.response';
|
|
import {AttendanceTrackingResponse} from './attendance-tracking.response'
|
|
|
|
import {OpenPeriodDatesResponse} from '../../services/dashbored/models/openPeriodDatesResponse'
|
|
import {GetSubordinatesLeavesRequest} from './models/GetSubordinatesLeavesRequest';
|
|
import {GetSubordinatesLeavesResponse} from './models/GetSubordinatesLeavesResponse';
|
|
import {GetSubordinatesAttdStatusRequest} from './models/GetSubordinatesAttdStatusRequest';
|
|
import {GetSubordinatesAttdStatusResponse} from './models/GetSubordinatesAttdStatusResponse';
|
|
import {GetOpenNotificationsResponse} from './models/GetOpenNotificationsResponse'
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class DashboredService {
|
|
public static organizationSalariesUrl = 'Services/ERP.svc/REST/GET_ORGANIZATIONS_SALARIES';
|
|
public static openMissingSwipesUrl = 'Services/ERP.svc/REST/GET_OPEN_MISSING_SWIPES';
|
|
public static performanceappraisalUrl = 'Services/ERP.svc/REST/GET_Performance_Appraisal';
|
|
public static attendancetrackingUrl = 'Services/ERP.svc/REST/GET_Attendance_Tracking';
|
|
|
|
public static getOpenPeriodDates = 'Services/ERP.svc/REST/GET_OPEN_PERIOD_DATES';
|
|
public static getOpenNotifications = 'Services/ERP.svc/REST/GET_OPEN_NOTIFICATIONS';
|
|
public static getSubordinatesLeaves = 'Services/ERP.svc/REST/GET_SUBORDINATES_LEAVES';
|
|
public static getSubordinatesAttStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
|
|
|
|
constructor(
|
|
public con: ConnectorService,
|
|
public authService: AuthenticationService,
|
|
) { }
|
|
|
|
public getOrganizationSalaries(onError ?: any ,oerrorLable ?: any): Observable<OrganizationSalariesResponse>{
|
|
const request = new Request();
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(
|
|
DashboredService.organizationSalariesUrl,
|
|
request,
|
|
onError,
|
|
oerrorLable
|
|
);}
|
|
|
|
public getOpenMissingSwipes(onError ?: any, oerrorLable ?: any): Observable<OpenMissingSwipesResponse> {
|
|
const request = new Request();
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(
|
|
DashboredService.openMissingSwipesUrl,
|
|
request,
|
|
onError,
|
|
oerrorLable
|
|
);
|
|
}
|
|
|
|
|
|
public getPerformanceAppraisal(onError ?: any ,oerrorLable ?: any): Observable<PerformanceAppraisalResponse>{
|
|
const request = new Request();
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(
|
|
DashboredService.performanceappraisalUrl,
|
|
request,
|
|
onError,
|
|
oerrorLable
|
|
);
|
|
}
|
|
public getAttendanceTracking(selectedEmployee: any, onError ?: any , oerrorLable ?: any): Observable<AttendanceTrackingResponse>{
|
|
const request = selectedEmployee;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(
|
|
DashboredService.attendancetrackingUrl,
|
|
request,
|
|
onError,
|
|
oerrorLable
|
|
);
|
|
}
|
|
public getOpenPeriodDates( onError?: any, errorLabel?: string): Observable<OpenPeriodDatesResponse> {
|
|
const request = new Request();
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(DashboredService.getOpenPeriodDates, request, onError, errorLabel);
|
|
}
|
|
public getOpenNotifications( onError?: any, errorLabel?: string): Observable<GetOpenNotificationsResponse> {
|
|
const request = new Request();
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(DashboredService.getOpenNotifications, request, onError, errorLabel);
|
|
}
|
|
public getSubordinatesLeaves( req: GetSubordinatesLeavesRequest,onError?: any, errorLabel?: string): Observable<GetSubordinatesLeavesResponse> {
|
|
this.authService.authenticateRequest(req);
|
|
return this.con.post(DashboredService.getSubordinatesLeaves, req, onError, errorLabel);
|
|
}
|
|
public getSubordinatesAttStatus( req: GetSubordinatesAttdStatusRequest, onError?: any, errorLabel?: string): Observable<GetSubordinatesAttdStatusResponse> {
|
|
this.authService.authenticateRequest(req);
|
|
return this.con.post(DashboredService.getSubordinatesAttStatus, req, onError, errorLabel);
|
|
}
|
|
|
|
|
|
}
|