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 EstimateManager extends Unibase.Platform.Core.BaseManager { getEstimateItems(EstimateId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/getestimateitembyid/estimateid/' + EstimateId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } getEstimateItem(EstimateItemId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/getestimateitem/estimateitemid/' + EstimateItemId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } managePrice(obj) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/manageprice'; return yield this.dataHelper().postAsync(url, obj).then(function (response) { return response; }); }); } getEstimate(EstimateId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/getestimate/id/' + EstimateId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != "" && response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } estimatePrint(EstimateId, TemplateId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimate/getestimatehtml/estimateid/' + EstimateId + '/templateid/' + TemplateId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null && response.result !== "") response.result = JSON.parse(response.result); return response; }); }); } getEstimatePermissions() { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/getsalesestimatepermissions'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result !== null) response.result = JSON.parse(response.result); return response; }); }); } adjustEstimateItem(EstimateItemId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/adjustestimateitem/estimateitemid/' + EstimateItemId; return yield this.dataHelper().postAsync(url, EstimateItemId).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } voidEstimate(EstimateId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/voidestimate/estimateid/' + EstimateId; return yield this.dataHelper().postAsync(url, EstimateId).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } confirmEstimate(EstimateId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/confirmestimate/estimateid/' + EstimateId; return yield this.dataHelper().postAsync(url, EstimateId).then(function (response) { if (response.result !== null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getLeadDetails(LeadId, LobId, OrderTypeId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/transact/estimates/getleaddetails/leadid/' + LeadId + '/lobid/' + LobId + '/ordertypeid/' + OrderTypeId + '/branchid/0'; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } getLeadByLeadId(LeadId) { return __awaiter(this, void 0, void 0, function* () { const url = 'apis/v4/bizgaze/crm/leads/getleadbyleadid/leadid/' + LeadId; return yield this.dataHelper().getAsync(url).then(function (response) { if (response.result != null && response.result != "") response.result = JSON.parse(response.result); return response; }); }); } static Instance() { if (this._instance === undefined) this._instance = new EstimateManager(); return this._instance; } } Managers.EstimateManager = EstimateManager; })(Managers = Transact.Managers || (Transact.Managers = {})); })(Transact = Apps.Transact || (Apps.Transact = {})); })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {})); })(Bizgaze || (Bizgaze = {}));