var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var Bizgaze; (function (Bizgaze) { let Apps; (function (Apps) { let Transact; (function (Transact) { let Managers; (function (Managers) { class OfferManager extends Unibase.Platform.Core.BaseManager { generatewallet(OfferId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/generateofferwallet/id/' + OfferId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } generatetabretantionfortabscheme(OfferId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/GenerateTabSchemeAsync/id/' + OfferId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshtabschemecontacts(OfferId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshtabschemecontacts/offerid/' + OfferId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } edittabschemecontact(OfferId, ContactId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/edittabschemecontact/offerid/' + OfferId + '/contactid/' + ContactId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } updatetabschemecontact(array) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/savetabschemecontact/List'; return yield this.dataHelper().postAsync(url, array).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getplanitems(PlanId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getallplanitems/planid/' + PlanId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getoffer(offerid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getoffers/offerid/' + offerid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getplanincentives(PlanId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getallplanincentives/planid/' + PlanId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getplan(PlanId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getplan/planid/' + PlanId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getofferplans(OfferId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getplans/offerid/' + OfferId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getCustomerPlanData(OrganizationId, SalesPersonId, LobId, OwnerId, Showplanewise, IsJson, OfferId, GroupName) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getcustomerplandata/organizationid/' + OrganizationId + '/salespersonid/' + SalesPersonId + '/lobid/' + LobId + '/ownerid/' + OwnerId + '/showplanewise/' + Showplanewise + '/isjson/' + IsJson + '/offerid/' + OfferId + '/groupname/' + GroupName; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getRelatedOffersByItem(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getrelatedoffersbyitem'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { return JSON.parse(response.result); }); }); } changeOfferPlanStatus(planid, StatusId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/changeofferplanstatus/planid/' + planid + '/statusid/' + StatusId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getoffers(itemid, contactid, quantity, invoiceapplytype, rowtotal, ApplyDate) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getplanvolumebyquantity/itemid/' + itemid + '/contactid/' + contactid + '/quantity/' + quantity + '/applytype/' + invoiceapplytype + '/rowtotal/' + rowtotal + '/applydate/' + ApplyDate; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null) response.result = JSON.parse(response.result); return response; }); }); } refreshofferproviders() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshofferproviders/np'; return yield this.dataHelper().postAsync(url, "{}").then(function (response) { return response.message; }); }); } getwalletamount(contactid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/wallets/getwalletamount/contactid/' + contactid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getPlanitems(Planid, pageIndex, term) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getplanitemsByplanid/planid/' + Planid + '/page/' + pageIndex + '/rows/8/term/' + term; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } ChangeOfferStatus(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/changeofferstatus'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } excludeoffercontacts(offercontactid, StatusId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/excludeoffercontacts/offercontactid/' + offercontactid + '/statusid/' + StatusId; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshalloffercontacts(offerid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshalloffercontacts/offerid/' + offerid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshrtscontacts() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshrtsoffercontacts/np'; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } gettabsachemedata(planid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/gettabschemedata/planid/' + planid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getdmsvolume(contactid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getdmsvolume/contactid/' + contactid; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getdiscounts(postdata) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/getdiscounts/List'; return yield this.dataHelper().postAsync(url, postdata).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshcontacts(offerid, offername) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshalltenantcontacts/offerid/' + offerid + '/offername/' + offername; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshallwallets(offerid, offername) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshallwallets/offerid/' + offerid + '/offername/' + offername; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } refreshallofferswallets() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/refreshallofferswallets/np'; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } changeplanstatus(array) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/updateofferplanstatus/List'; return yield this.dataHelper().postAsync(url, array).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } updateplanstatus(planid) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/offers/updateplanstatus/planid/' + planid; return yield this.dataHelper().postAsync(url, null).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new OfferManager(); return this._instance; } } Managers.OfferManager = OfferManager; })(Managers = Transact.Managers || (Transact.Managers = {})); })(Transact = Apps.Transact || (Apps.Transact = {})); })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {})); })(Bizgaze || (Bizgaze = {}));