|
|
|
|
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 { WorkListReplacmentEmployeeRequest } from '../models/ReplacmentEmployeeReq';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
|
export class WorklistService {
|
|
|
|
|
|
|
|
|
|
public static getWorkList = 'Services/ERP.svc/REST/GET_WORKLIST';
|
|
|
|
|
public static getReplacmentEmployeeList = 'Services/ERP.svc/REST/GET_REPLACEMENT_LIST';
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public api: ConnectorService,
|
|
|
|
|
public authService: AuthenticationService,
|
|
|
|
|
|
|
|
|
|
) { }
|
|
|
|
|
|
|
|
|
|
public getWorkList(WorkListReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
|
const request = WorkListReq;
|
|
|
|
|
this.authService.authenticateRequest(request);
|
|
|
|
|
return this.api.post(WorklistService.getWorkList, request, onError, errorLabel);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public getReplacmentEmployeeList(ReplacmentEmployeeRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
|
const request = ReplacmentEmployeeRequest;
|
|
|
|
|
this.authService.authenticateRequest(request);
|
|
|
|
|
return this.api.post(WorklistService.getReplacmentEmployeeList, request, onError, errorLabel);
|
|
|
|
|
}
|
|
|
|
|
}
|