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.
mohemmionic5/Mohem/src/app/vacation-rule/service/vacation-rule-service.servi...

57 lines
3.0 KiB
TypeScript

import { notificationTypeRequest } from './../model/notification.Request';
import { Response } from 'src/app/hmg-common/services/models/response';
import { VacationRuleRequest } from './../model/VacationRuleRequest';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { VacationTypeRequest } from '../model/VacationTypeRequest';
import { LoginRequest } from 'src/app/hmg-common/services/authentication/models/login.request';
@Injectable({
providedIn: 'root'
})
export class VacationRuleServiceService {
/* Vacation Rule Methods */
public static getVacationRule = 'Services/ERP.svc/REST/GET_VACATION_RULES';
public static changePassword = 'Services/ERP.svc/REST/ChangePassword_FromActiveSession';
public static userChecking = 'Services/ERP.svc/REST/Get_BasicUserInformation';
public static getVacationType = 'Services/ERP.svc/REST/GET_VR_ITEM_TYPES';
public static getNotificationType = 'Services/ERP.svc/REST/GET_ITEM_TYPE_NOTIFICATIONS';
public static createVacationRule = 'Services/ERP.svc/REST/CREATE_VACATION_RULE';
public static deleteVacationRule = 'Services/ERP.svc/REST/DELETE_VACATION_RULE';
public static updateVacationRule = 'Services/ERP.svc/REST/UPDATE_VACATION_RULE';
public static respondAttributes = 'Services/ERP.svc/REST/GET_RESPOND_ATTRIBUTES';
public static notificationReassign = 'Services/ERP.svc/REST/GET_NOTIFICATION_REASSIGN_MODE';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
public getVacationRule(vacationRuleRequest: VacationRuleRequest, onError: any, errorLabel: string): Observable<Response> {
const request = vacationRuleRequest;
console.log(request);
this.authService.authenticateRequest(request);
return this.con.post(VacationRuleServiceService.getVacationRule, request, onError, errorLabel);
}
public getVacationType(vacationTypeRequest: VacationTypeRequest, onError: any, errorLabel: string): Observable<any> {
const request = vacationTypeRequest;
this.authService.authenticateRequest(request);
return this.con.post(VacationRuleServiceService.getVacationType, request, onError, errorLabel);
}
public getNotificationType(notificationTypeRequest: notificationTypeRequest, onError: any, errorLabel: string): Observable<any> {
const request = notificationTypeRequest;
this.authService.authenticateRequest(request);
return this.con.post(VacationRuleServiceService.getNotificationType, request, onError, errorLabel);
}
public notificationReassign(notificationRequest: LoginRequest, onError: any, errorLabel: string): Observable<any> {
const request = notificationRequest;
this.authService.authenticateRequest(request);
return this.con.post(VacationRuleServiceService.notificationReassign, request, onError, errorLabel);
}
}