Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

offermanager.js 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let Transact;
  15. (function (Transact) {
  16. let Managers;
  17. (function (Managers) {
  18. class OfferManager extends Unibase.Platform.Core.BaseManager {
  19. generatewallet(OfferId) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/bizgaze/transact/offers/generateofferwallet/id/' + OfferId;
  22. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  23. if (response.result !== null)
  24. response.result = JSON.parse(response.result);
  25. return response;
  26. });
  27. });
  28. }
  29. generatetabretantionfortabscheme(OfferId) {
  30. return __awaiter(this, void 0, void 0, function* () {
  31. const url = 'apis/v4/bizgaze/transact/offers/GenerateTabSchemeAsync/id/' + OfferId;
  32. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  33. if (response.result !== null)
  34. response.result = JSON.parse(response.result);
  35. return response;
  36. });
  37. });
  38. }
  39. refreshtabschemecontacts(OfferId) {
  40. return __awaiter(this, void 0, void 0, function* () {
  41. const url = 'apis/v4/bizgaze/transact/offers/refreshtabschemecontacts/offerid/' + OfferId;
  42. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  43. if (response.result !== null)
  44. response.result = JSON.parse(response.result);
  45. return response;
  46. });
  47. });
  48. }
  49. edittabschemecontact(OfferId, ContactId) {
  50. return __awaiter(this, void 0, void 0, function* () {
  51. const url = 'apis/v4/bizgaze/transact/offers/edittabschemecontact/offerid/' + OfferId + '/contactid/' + ContactId;
  52. return yield this.dataHelper().getAsync(url).then(function (response) {
  53. if (response.result !== null)
  54. response.result = JSON.parse(response.result);
  55. return response;
  56. });
  57. });
  58. }
  59. updatetabschemecontact(array) {
  60. return __awaiter(this, void 0, void 0, function* () {
  61. const url = 'apis/v4/bizgaze/transact/offers/savetabschemecontact/List';
  62. return yield this.dataHelper().postAsync(url, array).then(function (response) {
  63. if (response.result !== null)
  64. response.result = JSON.parse(response.result);
  65. return response;
  66. });
  67. });
  68. }
  69. getplanitems(PlanId) {
  70. return __awaiter(this, void 0, void 0, function* () {
  71. const url = 'apis/v4/bizgaze/transact/offers/getallplanitems/planid/' + PlanId;
  72. return yield this.dataHelper().getAsync(url).then(function (response) {
  73. if (response.result !== null)
  74. response.result = JSON.parse(response.result);
  75. return response;
  76. });
  77. });
  78. }
  79. getoffer(offerid) {
  80. return __awaiter(this, void 0, void 0, function* () {
  81. const url = 'apis/v4/bizgaze/transact/offers/getoffers/offerid/' + offerid;
  82. return yield this.dataHelper().getAsync(url).then(function (response) {
  83. if (response.result !== null)
  84. response.result = JSON.parse(response.result);
  85. return response;
  86. });
  87. });
  88. }
  89. getplanincentives(PlanId) {
  90. return __awaiter(this, void 0, void 0, function* () {
  91. const url = 'apis/v4/bizgaze/transact/offers/getallplanincentives/planid/' + PlanId;
  92. return yield this.dataHelper().getAsync(url).then(function (response) {
  93. if (response.result !== null)
  94. response.result = JSON.parse(response.result);
  95. return response;
  96. });
  97. });
  98. }
  99. getplan(PlanId) {
  100. return __awaiter(this, void 0, void 0, function* () {
  101. const url = 'apis/v4/bizgaze/transact/offers/getplan/planid/' + PlanId;
  102. return yield this.dataHelper().getAsync(url).then(function (response) {
  103. if (response.result !== null)
  104. response.result = JSON.parse(response.result);
  105. return response;
  106. });
  107. });
  108. }
  109. getofferplans(OfferId) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const url = 'apis/v4/bizgaze/transact/offers/getplans/offerid/' + OfferId;
  112. return yield this.dataHelper().getAsync(url).then(function (response) {
  113. if (response.result !== null)
  114. response.result = JSON.parse(response.result);
  115. return response;
  116. });
  117. });
  118. }
  119. getCustomerPlanData(OrganizationId, SalesPersonId, LobId, OwnerId, Showplanewise, IsJson, OfferId, GroupName) {
  120. return __awaiter(this, void 0, void 0, function* () {
  121. const url = 'apis/v4/bizgaze/transact/offers/getcustomerplandata/organizationid/' + OrganizationId + '/salespersonid/' + SalesPersonId + '/lobid/' + LobId + '/ownerid/' + OwnerId + '/showplanewise/' + Showplanewise + '/isjson/' + IsJson + '/offerid/' + OfferId + '/groupname/' + GroupName;
  122. return yield this.dataHelper().getAsync(url).then(function (response) {
  123. if (response.result !== null && response.result != "")
  124. response.result = JSON.parse(response.result);
  125. return response;
  126. });
  127. });
  128. }
  129. getRelatedOffersByItem(postdata) {
  130. return __awaiter(this, void 0, void 0, function* () {
  131. const url = 'apis/v4/bizgaze/transact/offers/getrelatedoffersbyitem';
  132. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  133. return JSON.parse(response.result);
  134. });
  135. });
  136. }
  137. changeOfferPlanStatus(planid, StatusId) {
  138. return __awaiter(this, void 0, void 0, function* () {
  139. const url = 'apis/v4/bizgaze/transact/offers/changeofferplanstatus/planid/' + planid + '/statusid/' + StatusId;
  140. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  141. if (response.result !== null)
  142. response.result = JSON.parse(response.result);
  143. return response;
  144. });
  145. });
  146. }
  147. getoffers(itemid, contactid, quantity, invoiceapplytype, rowtotal, ApplyDate) {
  148. return __awaiter(this, void 0, void 0, function* () {
  149. const url = 'apis/v4/bizgaze/transact/offers/getplanvolumebyquantity/itemid/' + itemid + '/contactid/' + contactid + '/quantity/' + quantity + '/applytype/' + invoiceapplytype + '/rowtotal/' + rowtotal + '/applydate/' + ApplyDate;
  150. return yield this.dataHelper().getAsync(url).then(function (response) {
  151. if (response.result != null)
  152. response.result = JSON.parse(response.result);
  153. return response;
  154. });
  155. });
  156. }
  157. refreshofferproviders() {
  158. return __awaiter(this, void 0, void 0, function* () {
  159. const url = 'apis/v4/bizgaze/transact/offers/refreshofferproviders/np';
  160. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  161. return response.message;
  162. });
  163. });
  164. }
  165. getwalletamount(contactid) {
  166. return __awaiter(this, void 0, void 0, function* () {
  167. const url = 'apis/v4/bizgaze/transact/wallets/getwalletamount/contactid/' + contactid;
  168. return yield this.dataHelper().getAsync(url).then(function (response) {
  169. if (response.result !== null)
  170. response.result = JSON.parse(response.result);
  171. return response;
  172. });
  173. });
  174. }
  175. getPlanitems(Planid, pageIndex, term) {
  176. return __awaiter(this, void 0, void 0, function* () {
  177. const url = 'apis/v4/bizgaze/transact/offers/getplanitemsByplanid/planid/' + Planid + '/page/' + pageIndex + '/rows/8/term/' + term;
  178. return yield this.dataHelper().getAsync(url).then(function (response) {
  179. if (response.result !== null)
  180. response.result = JSON.parse(response.result);
  181. return response;
  182. });
  183. });
  184. }
  185. ChangeOfferStatus(postdata) {
  186. return __awaiter(this, void 0, void 0, function* () {
  187. const url = 'apis/v4/bizgaze/transact/offers/changeofferstatus';
  188. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  189. if (response.result !== null)
  190. response.result = JSON.parse(response.result);
  191. return response;
  192. });
  193. });
  194. }
  195. excludeoffercontacts(offercontactid, StatusId) {
  196. return __awaiter(this, void 0, void 0, function* () {
  197. const url = 'apis/v4/bizgaze/transact/offers/excludeoffercontacts/offercontactid/' + offercontactid + '/statusid/' + StatusId;
  198. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  199. if (response.result !== null)
  200. response.result = JSON.parse(response.result);
  201. return response;
  202. });
  203. });
  204. }
  205. refreshalloffercontacts(offerid) {
  206. return __awaiter(this, void 0, void 0, function* () {
  207. const url = 'apis/v4/bizgaze/transact/offers/refreshalloffercontacts/offerid/' + offerid;
  208. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  209. if (response.result !== null)
  210. response.result = JSON.parse(response.result);
  211. return response;
  212. });
  213. });
  214. }
  215. refreshrtscontacts() {
  216. return __awaiter(this, void 0, void 0, function* () {
  217. const url = 'apis/v4/bizgaze/transact/offers/refreshrtsoffercontacts/np';
  218. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  219. if (response.result !== null)
  220. response.result = JSON.parse(response.result);
  221. return response;
  222. });
  223. });
  224. }
  225. gettabsachemedata(planid) {
  226. return __awaiter(this, void 0, void 0, function* () {
  227. const url = 'apis/v4/bizgaze/transact/offers/gettabschemedata/planid/' + planid;
  228. return yield this.dataHelper().getAsync(url).then(function (response) {
  229. if (response.result !== null)
  230. response.result = JSON.parse(response.result);
  231. return response;
  232. });
  233. });
  234. }
  235. getdmsvolume(contactid) {
  236. return __awaiter(this, void 0, void 0, function* () {
  237. const url = 'apis/v4/bizgaze/transact/offers/getdmsvolume/contactid/' + contactid;
  238. return yield this.dataHelper().getAsync(url).then(function (response) {
  239. if (response.result !== null)
  240. response.result = JSON.parse(response.result);
  241. return response;
  242. });
  243. });
  244. }
  245. getdiscounts(postdata) {
  246. return __awaiter(this, void 0, void 0, function* () {
  247. const url = 'apis/v4/bizgaze/transact/offers/getdiscounts/List';
  248. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  249. if (response.result !== null)
  250. response.result = JSON.parse(response.result);
  251. return response;
  252. });
  253. });
  254. }
  255. refreshcontacts(offerid, offername) {
  256. return __awaiter(this, void 0, void 0, function* () {
  257. const url = 'apis/v4/bizgaze/transact/offers/refreshalltenantcontacts/offerid/' + offerid + '/offername/' + offername;
  258. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  259. if (response.result !== null)
  260. response.result = JSON.parse(response.result);
  261. return response;
  262. });
  263. });
  264. }
  265. refreshallwallets(offerid, offername) {
  266. return __awaiter(this, void 0, void 0, function* () {
  267. const url = 'apis/v4/bizgaze/transact/offers/refreshallwallets/offerid/' + offerid + '/offername/' + offername;
  268. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  269. if (response.result !== null)
  270. response.result = JSON.parse(response.result);
  271. return response;
  272. });
  273. });
  274. }
  275. refreshallofferswallets() {
  276. return __awaiter(this, void 0, void 0, function* () {
  277. const url = 'apis/v4/bizgaze/transact/offers/refreshallofferswallets/np';
  278. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  279. if (response.result !== null)
  280. response.result = JSON.parse(response.result);
  281. return response;
  282. });
  283. });
  284. }
  285. changeplanstatus(array) {
  286. return __awaiter(this, void 0, void 0, function* () {
  287. const url = 'apis/v4/bizgaze/transact/offers/updateofferplanstatus/List';
  288. return yield this.dataHelper().postAsync(url, array).then(function (response) {
  289. if (response.result !== null)
  290. response.result = JSON.parse(response.result);
  291. return response;
  292. });
  293. });
  294. }
  295. updateplanstatus(planid) {
  296. return __awaiter(this, void 0, void 0, function* () {
  297. const url = 'apis/v4/bizgaze/transact/offers/updateplanstatus/planid/' + planid;
  298. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  299. if (response.result !== null)
  300. response.result = JSON.parse(response.result);
  301. return response;
  302. });
  303. });
  304. }
  305. static Instance() {
  306. if (this._instance === undefined)
  307. this._instance = new OfferManager();
  308. return this._instance;
  309. }
  310. }
  311. Managers.OfferManager = OfferManager;
  312. })(Managers = Transact.Managers || (Transact.Managers = {}));
  313. })(Transact = Apps.Transact || (Apps.Transact = {}));
  314. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  315. })(Bizgaze || (Bizgaze = {}));