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.
213 lines
11 KiB
TypeScript
213 lines
11 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from "rxjs";
|
|
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
|
|
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class ProfileService {
|
|
public static updateEmpImage = "Services/ERP.svc/REST/UPDATE_EMPLOYEE_IMAGE";
|
|
public static getEmployeeBasicDetails = "Services/ERP.svc/REST/GET_EMPLOYEE_BASIC_DETAILS";
|
|
/* EIT Services URLs */
|
|
public static getMenuEntries = 'Services/ERP.svc/REST/GET_MENU_ENTRIES';
|
|
public static getEITTransctions = 'Services/ERP.svc/REST/GET_EIT_TRANSACTIONS';
|
|
public static getBASICDFFStrutre = 'Services/ERP.svc/REST/GET_BASIC_DET_DFF_STRUCTURE';
|
|
public static getBASICCOLStructure = 'Services/ERP.svc/REST/GET_BASIC_DET_COLS_STRUCTURE';
|
|
public static getSetValue = 'Services/ERP.svc/REST/GET_VALUE_SET_VALUES';
|
|
public static getDefaultValue = 'Services/ERP.svc/REST/GET_DEFAULT_VALUE';
|
|
public static validateEITTransctions = 'Services/ERP.svc/REST/VALIDATE_EIT_TRANSACTION';
|
|
public static submitEit = 'Services/ERP.svc/REST/SUBMIT_EIT_TRANSACTION';
|
|
public static resubmitEit = 'Services/ERP.svc/REST/RESUBMIT_EIT_TRANSACTION';
|
|
public static startEitProcess = 'Services/ERP.svc/REST/START_ADDRESS_APPROVAL_PROCESS';
|
|
public static startPhoneProcess = 'Services/ERP.svc/REST/START_PHONES_APPROVAL_PROCESS';
|
|
public static startBasicProcess = 'Services/ERP.svc/REST/START_BASIC_DET_APPR_PROCESS';
|
|
public static contactApprovalProcess = 'Services/ERP.svc/REST/START_CONTACT_APPROVAL_PROCESS';
|
|
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
|
|
public static deleteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
|
|
public static getApproversList = 'Services/ERP.svc/REST/GET_APPROVERS_LIST';
|
|
public static addAttachment = 'Services/ERP.svc/REST/ADD_ATTACHMENT';
|
|
public static cancelHRTransaction = 'Services/ERP.svc/REST/CANCEL_HR_TRANSACTION';
|
|
public static getAttach = 'Services/ERP.svc/REST/GET_ATTACHMENTS';
|
|
|
|
public static getEmployeeAddress = "Services/ERP.svc/REST/GET_EMPLOYEE_ADDRESS";
|
|
public static getCountries = "Services/ERP.svc/REST/GET_COUNTRIES";
|
|
public static getDiffStructure = "Services/ERP.svc/REST/GET_ADDRESS_DFF_STRUCTURE";
|
|
public static submitAddressTransactions = "Services/ERP.svc/REST/SUBMIT_ADDRESS_TRANSACTION";
|
|
public static submitBasicDetailsTransaction = "Services/ERP.svc/REST/SUBMIT_BASIC_DET_TRANSACTION";
|
|
public static submitContactTransaction = 'Services/ERP.svc/REST/SUBMIT_CONTACT_TRANSACTION'
|
|
public static getObjectValues = "Services/ERP.svc/REST/GET_OBJECT_VALUES";
|
|
public static getPhoneNumbers = "Services/ERP.svc/REST/GET_EMPLOYEE_PHONES";
|
|
public static submitPhoneTransaction = "Services/ERP.svc/REST/SUBMIT_PHONES_TRANSACTION";
|
|
public static getContactInfo = 'Services/ERP.svc/REST/GET_EMPLOYEE_CONTACTS';
|
|
public static getContactDetails = 'Services/ERP.svc/REST/GET_CONTACT_DETAILS';
|
|
|
|
public static getContactDiffStructure = 'Services/ERP.svc/REST/GET_CONTACT_DFF_STRUCTURE';
|
|
public static getContactCOLStructure = 'Services/ERP.svc/REST/GET_CONTACT_COLS_STRUCTURE';
|
|
|
|
|
|
public static ADRESS_ENTRIES = 'address-entries';
|
|
public static EMP_ADDRESS = 'emp-address';
|
|
public static COUNTRY = 'country';
|
|
public static SELECTED_STATUS = 'selected-status';
|
|
public static EMP_PHONE = 'emp-phone';
|
|
public static EMP_CONTACT_DETAILS = 'emp-CONTACT_DETAILS';
|
|
public static EMP_CONTACT = 'emp-CONTACT';
|
|
public static SELCTED_CONTACT = 'selcted-CONTACT';
|
|
public static REMOVE_CONTACT = 'remove-CONTACT';
|
|
constructor(
|
|
public con: ConnectorService,
|
|
public authService: AuthenticationService
|
|
) { }
|
|
|
|
public updateImageProfile(updateImgRequest: any, onError?: any, errorLabel?: string
|
|
): Observable<any> {
|
|
const request = updateImgRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(
|
|
ProfileService.updateEmpImage,
|
|
request,
|
|
onError,
|
|
errorLabel
|
|
);
|
|
}
|
|
|
|
public getEmployeeAddress(basicEmployeeDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicEmployeeDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getEmployeeAddress, request, onError, errorLabel);
|
|
}
|
|
|
|
public getEmployeeBasicDetails(basicEmployeeDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicEmployeeDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getEmployeeBasicDetails, request, onError, errorLabel);
|
|
}
|
|
|
|
public getBasicDFFStrutre(BASICDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = BASICDFFStrutreReq;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getBASICDFFStrutre, request, onError, errorLabel);
|
|
}
|
|
|
|
public getColumnStructure(body: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = body;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getBASICCOLStructure, request, onError, errorLabel);
|
|
}
|
|
|
|
public getDefaultValue(DefaultValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = DefaultValueReq;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getDefaultValue, request, onError, errorLabel);
|
|
}
|
|
|
|
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = SetValueReq;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getSetValue, request, onError, errorLabel);
|
|
}
|
|
|
|
public submitEit(eit: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = eit;
|
|
request.EITTransactionTBLModel = eit.EITTransactionTBL;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.submitEit, request, onError, errorLabel);
|
|
}
|
|
|
|
public getCountries(basicEmployeeDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicEmployeeDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getCountries, request, onError, errorLabel);
|
|
}
|
|
public getAddressDiffStructure(basicEmployeeDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicEmployeeDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getDiffStructure, request, onError, errorLabel);
|
|
}
|
|
public submitAddressTransaction(validateEITTransactionReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = validateEITTransactionReq;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.submitAddressTransactions, request, onError, errorLabel);
|
|
}
|
|
public submitBasicDetailsTransaction(basicDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.submitBasicDetailsTransaction, request, onError, errorLabel);
|
|
}
|
|
public submitContactTransaction(basicDetailsRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicDetailsRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.submitContactTransaction, request, onError, errorLabel);
|
|
}
|
|
public startEitApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = eitProcess;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.startEitProcess, request, onError, errorLabel);
|
|
}
|
|
public startPhoneApprovalProcess(eitProcess: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = eitProcess;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.startPhoneProcess, request, onError, errorLabel);
|
|
}
|
|
|
|
public startBasicDetailsApprovalProcess(basicDetailsProcess: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = basicDetailsProcess;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.startBasicProcess, request, onError, errorLabel);
|
|
}
|
|
|
|
|
|
public startContactApprovalProcess(contactRequest: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = contactRequest;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.contactApprovalProcess, request, onError, errorLabel);
|
|
}
|
|
public getObjectValue(request: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
this.authService.authenticateRequest(request);
|
|
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
|
|
return this.con.post(ProfileService.getObjectValues, request, onError, errorLabel);
|
|
|
|
}
|
|
public getPhoneNumbers(request: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
this.authService.authenticateRequest(request);
|
|
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
|
|
return this.con.post(ProfileService.getPhoneNumbers, request, onError, errorLabel);
|
|
|
|
}
|
|
public submitPhoneTransaction(request: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
this.authService.authenticateRequest(request);
|
|
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
|
|
return this.con.post(ProfileService.submitPhoneTransaction, request, onError, errorLabel);
|
|
|
|
}
|
|
|
|
public getContactInfo(request: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
this.authService.authenticateRequest(request);
|
|
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
|
|
return this.con.post(ProfileService.getContactInfo, request, onError, errorLabel);
|
|
|
|
}
|
|
|
|
public getContactDetails(request: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
|
|
this.authService.authenticateRequest(request);
|
|
request.P_SELECTED_EMPLOYEE_NUMBER = request.P_USER_NAME;
|
|
return this.con.post(ProfileService.getContactDetails, request, onError, errorLabel);
|
|
|
|
}
|
|
public getContactDFFStrutre(BASICDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = BASICDFFStrutreReq;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getContactDiffStructure, request, onError, errorLabel);
|
|
}
|
|
|
|
public getContactColumnStructure(body: any, onError?: any, errorLabel?: string): Observable<any> {
|
|
const request = body;
|
|
this.authService.authenticateRequest(request);
|
|
return this.con.post(ProfileService.getContactCOLStructure, request, onError, errorLabel);
|
|
}
|
|
} |