import { Injectable } from '@angular/core';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { AuthenticationService } from "src/app/hmg-common/services/authentication/authentication.service";
import { CommonService } from 'src/app/hmg-common/services/common/common.service';
@Injectable({
    providedIn: 'root'
})
export class OfferDiscountService {

    public static offersDiscountData = 'Services/COCWS.svc/REST/GetOfferDiscountsConfigData';
    public static getSuborinateStatus = 'Services/ERP.svc/REST/GET_SUBORDINATES_ATTD_STATUS';
    public static selected_offers = 'selected-offers';
    public static related_offers = 'related-offers';
    constructor(
        public con: ConnectorService,
        private authService: AuthenticationService,
        public cs: CommonService
    ) {
        this.cs.sharedService.getSharedData(OfferDiscountService.selected_offers, false);
    }

    getOffers(offer_request, onError, errorLabel) {
        var request = this.authService.getAuthenticatedRequest();
        request['EmployeeNumber'] = request.UserName;

        return this.con.postNoLoad(OfferDiscountService.offersDiscountData, request, onError, errorLabel);

    }

}