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/eit/services/eit.service.ts

73 lines
3.5 KiB
TypeScript

import { EITTransactionsRequest } from './../models/EITTransactionsReq';
import { Observable } from 'rxjs';
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 { AddEitResponse } from '../models/add.eit.response';
@Injectable({
providedIn: 'root'
})
export class EitService {
/* 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 getEITDFFStrutre = 'Services/ERP.svc/REST/GET_EIT_DFF_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_EIT_APPROVAL_PROCESS';
public static updateAttach = 'Services/ERP.svc/REST/UPDATE_ATTACHMENT';
public static delteAttach = 'Services/ERP.svc/REST/DELETE_ATTACHMENT';
constructor(public authService: AuthenticationService, public con: ConnectorService) { }
public getMenuEntries(menuEntries: any, onError?: any, errorLabel?: string): Observable<any> {
const request = menuEntries;
this.authService.authenticateRequest(request);
console.log(request);
return this.con.post(EitService.getMenuEntries, request, onError, errorLabel);
}
public getEITTransactionsList(EITTransactionsRequest: EITTransactionsRequest, onError?: any, errorLabel?: string): Observable<any> {
const request = EITTransactionsRequest;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getEITTransctions, request, onError, errorLabel);
}
public submitEit(eit: any, onError?: any, errorLabel?: string): Observable<AddEitResponse> {
const request = eit;
request.EITTransactionTBLModel = eit.EITTransactionTBL;
this.authService.authenticateRequest(request);
return this.con.post(EitService.submitEit, request, onError, errorLabel);
}
public validateEITTransaction(validateEITTransactionReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = validateEITTransactionReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.validateEITTransctions, request, onError, errorLabel);
}
public getEITDFFStrutre(EITDFFStrutreReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = EITDFFStrutreReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getEITDFFStrutre, request, onError, errorLabel);
}
public getSetValue(SetValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = SetValueReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getSetValue, request, onError, errorLabel);
}
public getDefaultValue(DefaultValueReq: any, onError?: any, errorLabel?: string): Observable<any> {
const request = DefaultValueReq;
this.authService.authenticateRequest(request);
return this.con.post(EitService.getDefaultValue, request, onError, errorLabel);
}
}