@nomalism-com/api 0.12.2 → 0.13.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/dist/index.d.ts +284 -2
  2. package/dist/index.js +342 -3
  3. package/dist/modules/document/materialEntrance.d.ts +11 -3
  4. package/dist/modules/document/materialEntrance.js +43 -33
  5. package/dist/modules/document/order.d.ts +15 -2
  6. package/dist/modules/document/order.js +90 -75
  7. package/dist/modules/document/purchase.d.ts +11 -2
  8. package/dist/modules/document/purchase.js +58 -50
  9. package/dist/modules/documentManagement/multimedia.d.ts +11 -4
  10. package/dist/modules/documentManagement/multimedia.js +32 -51
  11. package/dist/modules/integration/dynamicData.d.ts +12 -2
  12. package/dist/modules/integration/dynamicData.js +70 -60
  13. package/dist/modules/integration/emailTemplate.d.ts +12 -2
  14. package/dist/modules/integration/emailTemplate.js +69 -59
  15. package/dist/modules/integration/emailTemplateAttachment.d.ts +9 -2
  16. package/dist/modules/integration/emailTemplateAttachment.js +33 -29
  17. package/dist/modules/integration/errorHandler.d.ts +8 -2
  18. package/dist/modules/integration/errorHandler.js +21 -19
  19. package/dist/modules/integration/field.d.ts +11 -2
  20. package/dist/modules/integration/field.js +58 -49
  21. package/dist/modules/integration/fieldGroup.d.ts +13 -2
  22. package/dist/modules/integration/fieldGroup.js +85 -72
  23. package/dist/modules/integration/file.d.ts +10 -2
  24. package/dist/modules/integration/file.js +48 -42
  25. package/dist/modules/integration/googleFilePermission.d.ts +11 -2
  26. package/dist/modules/integration/googleFilePermission.js +58 -50
  27. package/dist/modules/integration/googleSheets.d.ts +11 -2
  28. package/dist/modules/integration/googleSheets.js +59 -51
  29. package/dist/modules/integration/history.d.ts +8 -2
  30. package/dist/modules/integration/history.js +23 -20
  31. package/dist/modules/integration/observation.d.ts +11 -2
  32. package/dist/modules/integration/observation.js +60 -52
  33. package/dist/modules/integration/observationType.d.ts +12 -2
  34. package/dist/modules/integration/observationType.js +72 -62
  35. package/dist/modules/integration/projectInfo.d.ts +8 -2
  36. package/dist/modules/integration/projectInfo.js +21 -19
  37. package/dist/modules/integration/settings.d.ts +12 -3
  38. package/dist/modules/integration/settings.js +72 -61
  39. package/dist/modules/integration/task.d.ts +11 -2
  40. package/dist/modules/integration/task.js +68 -60
  41. package/dist/modules/integration/taskAttachment.d.ts +9 -2
  42. package/dist/modules/integration/taskAttachment.js +36 -32
  43. package/dist/modules/integration/taskGroup.d.ts +12 -2
  44. package/dist/modules/integration/taskGroup.js +70 -60
  45. package/dist/modules/integration/taskNote.d.ts +11 -2
  46. package/dist/modules/integration/taskNote.js +58 -50
  47. package/dist/modules/print/npc.d.ts +9 -2
  48. package/dist/modules/print/npc.js +34 -30
  49. package/dist/modules/print/printer.d.ts +10 -2
  50. package/dist/modules/print/printer.js +46 -40
  51. package/dist/modules/print/schedulePrintJob.d.ts +11 -2
  52. package/dist/modules/print/schedulePrintJob.js +56 -48
  53. package/dist/modules/stock/attribute.d.ts +15 -2
  54. package/dist/modules/stock/attribute.js +111 -94
  55. package/dist/modules/stock/attributeValue.d.ts +15 -2
  56. package/dist/modules/stock/attributeValue.js +110 -94
  57. package/dist/modules/stock/color.d.ts +15 -2
  58. package/dist/modules/stock/color.js +109 -93
  59. package/dist/modules/stock/composition.d.ts +14 -2
  60. package/dist/modules/stock/composition.js +96 -82
  61. package/dist/modules/stock/compositionMaterial.d.ts +15 -2
  62. package/dist/modules/stock/compositionMaterial.js +110 -94
  63. package/dist/modules/stock/location.d.ts +15 -2
  64. package/dist/modules/stock/location.js +110 -94
  65. package/dist/modules/stock/maintenance.d.ts +15 -2
  66. package/dist/modules/stock/maintenance.js +110 -94
  67. package/dist/modules/stock/maintenanceAssoc.d.ts +14 -2
  68. package/dist/modules/stock/maintenanceAssoc.js +96 -82
  69. package/dist/modules/stock/maintenancePreset.d.ts +13 -2
  70. package/dist/modules/stock/maintenancePreset.js +82 -70
  71. package/dist/modules/stock/maintenancePresetAssoc.d.ts +11 -2
  72. package/dist/modules/stock/maintenancePresetAssoc.js +57 -49
  73. package/dist/modules/stock/maintenanceType.d.ts +15 -2
  74. package/dist/modules/stock/maintenanceType.js +110 -94
  75. package/dist/modules/stock/plot.d.ts +24 -4
  76. package/dist/modules/stock/plot.js +219 -172
  77. package/dist/modules/stock/primaryColor.d.ts +15 -2
  78. package/dist/modules/stock/primaryColor.js +110 -94
  79. package/dist/modules/stock/product.d.ts +24 -4
  80. package/dist/modules/stock/product.js +221 -190
  81. package/dist/modules/stock/productAttribute.d.ts +14 -2
  82. package/dist/modules/stock/productAttribute.js +96 -82
  83. package/dist/modules/stock/productCategory.d.ts +15 -2
  84. package/dist/modules/stock/productCategory.js +110 -94
  85. package/dist/modules/stock/productColor.d.ts +14 -2
  86. package/dist/modules/stock/productColor.js +96 -82
  87. package/dist/modules/stock/productImage.d.ts +14 -2
  88. package/dist/modules/stock/productImage.js +97 -82
  89. package/dist/modules/stock/productName.d.ts +15 -2
  90. package/dist/modules/stock/productName.js +110 -94
  91. package/dist/modules/stock/productNamePreset.d.ts +15 -2
  92. package/dist/modules/stock/productNamePreset.js +110 -94
  93. package/dist/modules/stock/productPart.d.ts +15 -2
  94. package/dist/modules/stock/productPart.js +109 -93
  95. package/dist/modules/stock/productSubCategory.d.ts +15 -2
  96. package/dist/modules/stock/productSubCategory.js +109 -93
  97. package/dist/modules/stock/productUse.d.ts +15 -2
  98. package/dist/modules/stock/productUse.js +110 -94
  99. package/dist/modules/stock/productUseAssoc.d.ts +14 -2
  100. package/dist/modules/stock/productUseAssoc.js +95 -81
  101. package/dist/modules/stock/promotion.d.ts +16 -3
  102. package/dist/modules/stock/promotion.js +130 -115
  103. package/dist/modules/stock/promotionAssoc.d.ts +14 -2
  104. package/dist/modules/stock/promotionAssoc.js +96 -82
  105. package/dist/modules/stock/queryList.d.ts +14 -3
  106. package/dist/modules/stock/queryList.js +101 -89
  107. package/dist/modules/stock/queryParameter.d.ts +13 -2
  108. package/dist/modules/stock/queryParameter.js +83 -70
  109. package/dist/modules/stock/returnReason.d.ts +11 -2
  110. package/dist/modules/stock/returnReason.js +58 -50
  111. package/dist/modules/stock/savedEmPicking.d.ts +9 -2
  112. package/dist/modules/stock/savedEmPicking.js +34 -30
  113. package/dist/modules/stock/schedule.d.ts +8 -2
  114. package/dist/modules/stock/schedule.js +23 -20
  115. package/dist/modules/stock/similarProduct.d.ts +14 -2
  116. package/dist/modules/stock/similarProduct.js +96 -82
  117. package/dist/modules/stock/stockMovement.d.ts +11 -4
  118. package/dist/modules/stock/stockMovement.js +45 -43
  119. package/dist/modules/stock/typeOfInventory.d.ts +15 -2
  120. package/dist/modules/stock/typeOfInventory.js +110 -94
  121. package/dist/modules/stock/typeOfLocation.d.ts +15 -2
  122. package/dist/modules/stock/typeOfLocation.js +110 -94
  123. package/dist/modules/stock/unitOfMeasure.d.ts +15 -2
  124. package/dist/modules/stock/unitOfMeasure.js +110 -94
  125. package/dist/modules/stock/vatTax.d.ts +15 -2
  126. package/dist/modules/stock/vatTax.js +110 -94
  127. package/dist/modules/stock/vatTaxZone.d.ts +15 -2
  128. package/dist/modules/stock/vatTaxZone.js +110 -94
  129. package/dist/modules/supply/cabide.d.ts +17 -4
  130. package/dist/modules/supply/cabide.js +128 -109
  131. package/dist/modules/supply/cabideProduct.d.ts +15 -2
  132. package/dist/modules/supply/cabideProduct.js +99 -85
  133. package/dist/modules/supply/clientCurrentAccount.d.ts +13 -2
  134. package/dist/modules/supply/clientCurrentAccount.js +88 -74
  135. package/dist/modules/supply/documentHeader.d.ts +38 -4
  136. package/dist/modules/supply/documentHeader.js +378 -316
  137. package/dist/modules/supply/documentLine.d.ts +18 -3
  138. package/dist/modules/supply/documentLine.js +136 -114
  139. package/dist/modules/supply/documentLineAssoc.d.ts +11 -2
  140. package/dist/modules/supply/documentLineAssoc.js +57 -49
  141. package/dist/modules/supply/documentLineFolder.d.ts +11 -2
  142. package/dist/modules/supply/documentLineFolder.js +58 -50
  143. package/dist/modules/supply/documentSet.d.ts +13 -2
  144. package/dist/modules/supply/documentSet.js +82 -70
  145. package/dist/modules/supply/documentType.d.ts +13 -2
  146. package/dist/modules/supply/documentType.js +83 -70
  147. package/dist/modules/supply/externalDocumentHeader.d.ts +15 -2
  148. package/dist/modules/supply/externalDocumentHeader.js +105 -89
  149. package/dist/modules/supply/externalDocumentType.d.ts +9 -2
  150. package/dist/modules/supply/externalDocumentType.js +34 -30
  151. package/dist/modules/supply/moloniRequest.d.ts +8 -2
  152. package/dist/modules/supply/moloniRequest.js +21 -20
  153. package/dist/modules/supply/orderManagement.d.ts +10 -2
  154. package/dist/modules/supply/orderManagement.js +23 -20
  155. package/dist/modules/supply/payment.d.ts +23 -4
  156. package/dist/modules/supply/payment.js +208 -180
  157. package/dist/modules/supply/preSale.d.ts +15 -2
  158. package/dist/modules/supply/preSale.js +106 -90
  159. package/dist/modules/supply/preSaleProduct.d.ts +9 -2
  160. package/dist/modules/supply/preSaleProduct.js +34 -30
  161. package/dist/modules/supply/propostaSheets.d.ts +20 -9
  162. package/dist/modules/supply/propostaSheets.js +89 -76
  163. package/dist/modules/supply/providerCurrentAccount.d.ts +8 -2
  164. package/dist/modules/supply/providerCurrentAccount.js +24 -22
  165. package/dist/modules/supply/startDocumentHeaderLastUpdate.d.ts +10 -4
  166. package/dist/modules/supply/startDocumentHeaderLastUpdate.js +22 -20
  167. package/dist/modules/supply/transformado.d.ts +8 -2
  168. package/dist/modules/supply/transformado.js +22 -20
  169. package/dist/modules/supply/upfrontReturn.d.ts +10 -4
  170. package/dist/modules/supply/upfrontReturn.js +22 -20
  171. package/dist/modules/supply/vatValidation.d.ts +8 -2
  172. package/dist/modules/supply/vatValidation.js +26 -24
  173. package/dist/modules/supply/workflow.d.ts +15 -2
  174. package/dist/modules/supply/workflow.js +70 -60
  175. package/dist/modules/tickets/channel.d.ts +13 -2
  176. package/dist/modules/tickets/channel.js +82 -70
  177. package/dist/modules/tickets/clt.d.ts +13 -2
  178. package/dist/modules/tickets/clt.js +82 -70
  179. package/dist/modules/tickets/language.d.ts +13 -2
  180. package/dist/modules/tickets/language.js +82 -70
  181. package/dist/modules/tickets/tickets.d.ts +11 -2
  182. package/dist/modules/tickets/tickets.js +58 -50
  183. package/dist/modules/user/address.d.ts +15 -2
  184. package/dist/modules/user/address.js +108 -92
  185. package/dist/modules/user/bankData.d.ts +14 -2
  186. package/dist/modules/user/bankData.js +96 -82
  187. package/dist/modules/user/clientType.d.ts +14 -2
  188. package/dist/modules/user/clientType.js +96 -82
  189. package/dist/modules/user/clients.d.ts +16 -2
  190. package/dist/modules/user/clients.js +122 -104
  191. package/dist/modules/user/commissioner.d.ts +15 -2
  192. package/dist/modules/user/commissioner.js +110 -94
  193. package/dist/modules/user/contactTypes.d.ts +14 -2
  194. package/dist/modules/user/contactTypes.js +96 -82
  195. package/dist/modules/user/contacts.d.ts +16 -2
  196. package/dist/modules/user/contacts.js +122 -102
  197. package/dist/modules/user/country.d.ts +15 -2
  198. package/dist/modules/user/country.js +110 -94
  199. package/dist/modules/user/deliveryMethods.d.ts +13 -2
  200. package/dist/modules/user/deliveryMethods.js +84 -72
  201. package/dist/modules/user/entityList.d.ts +12 -2
  202. package/dist/modules/user/entityList.js +47 -42
  203. package/dist/modules/user/favorites.d.ts +11 -2
  204. package/dist/modules/user/favorites.js +58 -50
  205. package/dist/modules/user/groupPermission.d.ts +11 -2
  206. package/dist/modules/user/groupPermission.js +60 -52
  207. package/dist/modules/user/language.d.ts +14 -2
  208. package/dist/modules/user/language.js +96 -82
  209. package/dist/modules/user/logout.d.ts +8 -2
  210. package/dist/modules/user/logout.js +21 -19
  211. package/dist/modules/user/maturityDates.d.ts +13 -2
  212. package/dist/modules/user/maturityDates.js +84 -72
  213. package/dist/modules/user/password.d.ts +9 -2
  214. package/dist/modules/user/password.js +32 -28
  215. package/dist/modules/user/paymentCondition.d.ts +14 -2
  216. package/dist/modules/user/paymentCondition.js +96 -82
  217. package/dist/modules/user/paymentMethods.d.ts +13 -2
  218. package/dist/modules/user/paymentMethods.js +84 -72
  219. package/dist/modules/user/permission.d.ts +11 -2
  220. package/dist/modules/user/permission.js +60 -52
  221. package/dist/modules/user/persona.d.ts +12 -2
  222. package/dist/modules/user/persona.js +72 -62
  223. package/dist/modules/user/provider.d.ts +17 -2
  224. package/dist/modules/user/provider.js +136 -116
  225. package/dist/modules/user/providerType.d.ts +14 -2
  226. package/dist/modules/user/providerType.js +96 -82
  227. package/dist/modules/user/purchaseCondition.d.ts +14 -2
  228. package/dist/modules/user/purchaseCondition.js +96 -82
  229. package/dist/modules/user/reasonForExemption.d.ts +14 -2
  230. package/dist/modules/user/reasonForExemption.js +96 -82
  231. package/dist/modules/user/refreshToken.d.ts +8 -2
  232. package/dist/modules/user/refreshToken.js +22 -20
  233. package/dist/modules/user/segmentsArea.d.ts +14 -2
  234. package/dist/modules/user/segmentsArea.js +96 -82
  235. package/dist/modules/user/sessions.d.ts +8 -2
  236. package/dist/modules/user/sessions.js +22 -20
  237. package/dist/modules/user/shippings.d.ts +14 -2
  238. package/dist/modules/user/shippings.js +96 -82
  239. package/dist/modules/user/socialMedia.d.ts +14 -2
  240. package/dist/modules/user/socialMedia.js +96 -82
  241. package/dist/modules/user/storeOperator.d.ts +16 -2
  242. package/dist/modules/user/storeOperator.js +122 -104
  243. package/dist/modules/user/swift.d.ts +14 -2
  244. package/dist/modules/user/swift.js +96 -82
  245. package/dist/modules/user/tenant.d.ts +11 -2
  246. package/dist/modules/user/tenant.js +58 -50
  247. package/dist/modules/user/user.d.ts +16 -2
  248. package/dist/modules/user/user.js +120 -102
  249. package/dist/modules/user/userPermission.d.ts +10 -2
  250. package/dist/modules/user/userPermission.js +48 -42
  251. package/dist/modules/user/userPositions.d.ts +14 -2
  252. package/dist/modules/user/userPositions.js +96 -82
  253. package/dist/modules/user/userToken.d.ts +13 -2
  254. package/dist/modules/user/userToken.js +84 -72
  255. package/dist/modules/user/vehicles.d.ts +11 -2
  256. package/dist/modules/user/vehicles.js +58 -50
  257. package/dist/modules/user/zipCode.d.ts +9 -2
  258. package/dist/modules/user/zipCode.js +33 -29
  259. package/dist/modules/view/eventHistory.d.ts +8 -2
  260. package/dist/modules/view/eventHistory.js +22 -20
  261. package/package.json +2 -2
  262. package/dist/modules/documentManagement/index.d.ts +0 -3
  263. package/dist/modules/documentManagement/index.js +0 -13
  264. package/dist/modules/integration/index.d.ts +0 -3
  265. package/dist/modules/integration/index.js +0 -13
  266. package/dist/modules/print/index.d.ts +0 -3
  267. package/dist/modules/print/index.js +0 -13
  268. package/dist/modules/stock/index.d.ts +0 -3
  269. package/dist/modules/stock/index.js +0 -13
  270. package/dist/modules/tickets/index.d.ts +0 -3
  271. package/dist/modules/tickets/index.js +0 -13
  272. package/dist/modules/user/index.d.ts +0 -3
  273. package/dist/modules/user/index.js +0 -13
  274. package/dist/modules/view/index.d.ts +0 -2
  275. package/dist/modules/view/index.js +0 -12
  276. package/dist/shared/client.d.ts +0 -7
  277. package/dist/shared/client.js +0 -24
@@ -35,199 +35,227 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.getExportCurrentAccountUrl = exports.exportPayments = exports.findSettledMaterialEntranceByDate = exports.exportCurrentAccount = exports.updateDownloadedBatchNumber = exports.findPaymentBatches = exports.findPaymentsNotExported = exports.createProvidersPayments = exports.findSettledMaterialEntranceProviders = exports.findSettledMaterialEntrance = exports.findCurrentAccountByOwnerId = exports.deleteBatch = exports.findById = exports.findByOwnerId = exports.findPaginated = exports.find = exports.publicRoute = exports.route = void 0;
43
- var client_1 = __importDefault(require("../../shared/client"));
44
- var stock_1 = require("../stock");
45
- exports.route = "".concat(stock_1.serviceHostname).concat(stock_1.serviceAuthPath, "payment/");
46
- exports.publicRoute = "".concat(stock_1.serviceHostname).concat(stock_1.servicePublicPath, "payment/");
47
- var repository = {
48
- find: function (params) { return __awaiter(void 0, void 0, void 0, function () {
49
- var response;
50
- return __generator(this, function (_a) {
51
- switch (_a.label) {
52
- case 0: return [4, client_1.default.get("".concat(exports.route), { params: params })];
53
- case 1:
54
- response = _a.sent();
55
- return [2, response.data];
56
- }
39
+ var Repository = (function () {
40
+ function Repository(_a) {
41
+ var api = _a.api, route = _a.route, publicRoute = _a.publicRoute;
42
+ this.api = api;
43
+ this.route = route;
44
+ this.publicRoute = publicRoute;
45
+ }
46
+ Repository.prototype.find = function (params) {
47
+ return __awaiter(this, void 0, void 0, function () {
48
+ var response;
49
+ return __generator(this, function (_a) {
50
+ switch (_a.label) {
51
+ case 0: return [4, this.api.get("".concat(this.route), { params: params })];
52
+ case 1:
53
+ response = _a.sent();
54
+ return [2, response.data];
55
+ }
56
+ });
57
57
  });
58
- }); },
59
- findPaginated: function (params) { return __awaiter(void 0, void 0, void 0, function () {
60
- var response;
61
- return __generator(this, function (_a) {
62
- switch (_a.label) {
63
- case 0: return [4, client_1.default.get("".concat(exports.route, "paginated"), { params: params })];
64
- case 1:
65
- response = _a.sent();
66
- return [2, response.data];
67
- }
58
+ };
59
+ Repository.prototype.findPaginated = function (params) {
60
+ return __awaiter(this, void 0, void 0, function () {
61
+ var response;
62
+ return __generator(this, function (_a) {
63
+ switch (_a.label) {
64
+ case 0: return [4, this.api.get("".concat(this.route, "paginated"), { params: params })];
65
+ case 1:
66
+ response = _a.sent();
67
+ return [2, response.data];
68
+ }
69
+ });
68
70
  });
69
- }); },
70
- findByOwnerId: function (params) { return __awaiter(void 0, void 0, void 0, function () {
71
- var response;
72
- return __generator(this, function (_a) {
73
- switch (_a.label) {
74
- case 0: return [4, client_1.default.get("".concat(exports.route, "by_owner"), {
75
- params: params,
76
- })];
77
- case 1:
78
- response = _a.sent();
79
- return [2, response.data];
80
- }
71
+ };
72
+ Repository.prototype.findByOwnerId = function (params) {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var response;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0: return [4, this.api.get("".concat(this.route, "by_owner"), {
78
+ params: params,
79
+ })];
80
+ case 1:
81
+ response = _a.sent();
82
+ return [2, response.data];
83
+ }
84
+ });
81
85
  });
82
- }); },
83
- findById: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
84
- var response;
85
- return __generator(this, function (_a) {
86
- switch (_a.label) {
87
- case 0: return [4, client_1.default.get("".concat(exports.route).concat(selector.id))];
88
- case 1:
89
- response = _a.sent();
90
- return [2, response.data];
91
- }
86
+ };
87
+ Repository.prototype.findById = function (selector) {
88
+ return __awaiter(this, void 0, void 0, function () {
89
+ var response;
90
+ return __generator(this, function (_a) {
91
+ switch (_a.label) {
92
+ case 0: return [4, this.api.get("".concat(this.route).concat(selector.id))];
93
+ case 1:
94
+ response = _a.sent();
95
+ return [2, response.data];
96
+ }
97
+ });
92
98
  });
93
- }); },
94
- deleteBatch: function (selector) { return __awaiter(void 0, void 0, void 0, function () {
95
- var response;
96
- return __generator(this, function (_a) {
97
- switch (_a.label) {
98
- case 0: return [4, client_1.default.delete("".concat(exports.route, "delete_batch").concat(selector.id))];
99
- case 1:
100
- response = _a.sent();
101
- return [2, response.data];
102
- }
99
+ };
100
+ Repository.prototype.deleteBatch = function (selector) {
101
+ return __awaiter(this, void 0, void 0, function () {
102
+ var response;
103
+ return __generator(this, function (_a) {
104
+ switch (_a.label) {
105
+ case 0: return [4, this.api.delete("".concat(this.route, "delete_batch").concat(selector.id))];
106
+ case 1:
107
+ response = _a.sent();
108
+ return [2, response.data];
109
+ }
110
+ });
103
111
  });
104
- }); },
105
- findCurrentAccountByOwnerId: function (params) { return __awaiter(void 0, void 0, void 0, function () {
106
- var response;
107
- return __generator(this, function (_a) {
108
- switch (_a.label) {
109
- case 0: return [4, client_1.default.get("".concat(exports.route, "current_account"), {
110
- params: params,
111
- })];
112
- case 1:
113
- response = _a.sent();
114
- return [2, response.data];
115
- }
112
+ };
113
+ Repository.prototype.findCurrentAccountByOwnerId = function (params) {
114
+ return __awaiter(this, void 0, void 0, function () {
115
+ var response;
116
+ return __generator(this, function (_a) {
117
+ switch (_a.label) {
118
+ case 0: return [4, this.api.get("".concat(this.route, "current_account"), {
119
+ params: params,
120
+ })];
121
+ case 1:
122
+ response = _a.sent();
123
+ return [2, response.data];
124
+ }
125
+ });
116
126
  });
117
- }); },
118
- findSettledMaterialEntrance: function (params) { return __awaiter(void 0, void 0, void 0, function () {
119
- var response;
120
- return __generator(this, function (_a) {
121
- switch (_a.label) {
122
- case 0: return [4, client_1.default.get("".concat(exports.route, "settled_material_entrance"), {
123
- params: params,
124
- })];
125
- case 1:
126
- response = _a.sent();
127
- return [2, response.data];
128
- }
127
+ };
128
+ Repository.prototype.findSettledMaterialEntrance = function (params) {
129
+ return __awaiter(this, void 0, void 0, function () {
130
+ var response;
131
+ return __generator(this, function (_a) {
132
+ switch (_a.label) {
133
+ case 0: return [4, this.api.get("".concat(this.route, "settled_material_entrance"), {
134
+ params: params,
135
+ })];
136
+ case 1:
137
+ response = _a.sent();
138
+ return [2, response.data];
139
+ }
140
+ });
129
141
  });
130
- }); },
131
- findSettledMaterialEntranceProviders: function () { return __awaiter(void 0, void 0, void 0, function () {
132
- var response;
133
- return __generator(this, function (_a) {
134
- switch (_a.label) {
135
- case 0: return [4, client_1.default.get("".concat(exports.route, "settled_material_entrance_providers"))];
136
- case 1:
137
- response = _a.sent();
138
- return [2, response.data];
139
- }
142
+ };
143
+ Repository.prototype.findSettledMaterialEntranceProviders = function () {
144
+ return __awaiter(this, void 0, void 0, function () {
145
+ var response;
146
+ return __generator(this, function (_a) {
147
+ switch (_a.label) {
148
+ case 0: return [4, this.api.get("".concat(this.route, "settled_material_entrance_providers"))];
149
+ case 1:
150
+ response = _a.sent();
151
+ return [2, response.data];
152
+ }
153
+ });
140
154
  });
141
- }); },
142
- createProvidersPayments: function (body) { return __awaiter(void 0, void 0, void 0, function () {
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
145
- case 0: return [4, client_1.default.post("".concat(exports.route, "provider"), body)];
146
- case 1:
147
- _a.sent();
148
- return [2];
149
- }
155
+ };
156
+ Repository.prototype.createProvidersPayments = function (body) {
157
+ return __awaiter(this, void 0, void 0, function () {
158
+ return __generator(this, function (_a) {
159
+ switch (_a.label) {
160
+ case 0: return [4, this.api.post("".concat(this.route, "provider"), body)];
161
+ case 1:
162
+ _a.sent();
163
+ return [2];
164
+ }
165
+ });
150
166
  });
151
- }); },
152
- findPaymentsNotExported: function () { return __awaiter(void 0, void 0, void 0, function () {
153
- var response;
154
- return __generator(this, function (_a) {
155
- switch (_a.label) {
156
- case 0: return [4, client_1.default.get("".concat(exports.route, "not_exported"))];
157
- case 1:
158
- response = _a.sent();
159
- return [2, response.data];
160
- }
167
+ };
168
+ Repository.prototype.findPaymentsNotExported = function () {
169
+ return __awaiter(this, void 0, void 0, function () {
170
+ var response;
171
+ return __generator(this, function (_a) {
172
+ switch (_a.label) {
173
+ case 0: return [4, this.api.get("".concat(this.route, "not_exported"))];
174
+ case 1:
175
+ response = _a.sent();
176
+ return [2, response.data];
177
+ }
178
+ });
161
179
  });
162
- }); },
163
- findPaymentBatches: function () { return __awaiter(void 0, void 0, void 0, function () {
164
- var response;
165
- return __generator(this, function (_a) {
166
- switch (_a.label) {
167
- case 0: return [4, client_1.default.get("".concat(exports.route, "batches"))];
168
- case 1:
169
- response = _a.sent();
170
- return [2, response.data];
171
- }
180
+ };
181
+ Repository.prototype.findPaymentBatches = function () {
182
+ return __awaiter(this, void 0, void 0, function () {
183
+ var response;
184
+ return __generator(this, function (_a) {
185
+ switch (_a.label) {
186
+ case 0: return [4, this.api.get("".concat(this.route, "batches"))];
187
+ case 1:
188
+ response = _a.sent();
189
+ return [2, response.data];
190
+ }
191
+ });
172
192
  });
173
- }); },
174
- updateDownloadedBatchNumber: function (params) { return __awaiter(void 0, void 0, void 0, function () {
175
- return __generator(this, function (_a) {
176
- switch (_a.label) {
177
- case 0: return [4, client_1.default.put("".concat(exports.route, "downloaded_batch_number").concat(params))];
178
- case 1:
179
- _a.sent();
180
- return [2];
181
- }
193
+ };
194
+ Repository.prototype.updateDownloadedBatchNumber = function (params) {
195
+ return __awaiter(this, void 0, void 0, function () {
196
+ return __generator(this, function (_a) {
197
+ switch (_a.label) {
198
+ case 0: return [4, this.api.put("".concat(this.route, "downloaded_batch_number").concat(params))];
199
+ case 1:
200
+ _a.sent();
201
+ return [2];
202
+ }
203
+ });
182
204
  });
183
- }); },
184
- exportCurrentAccount: function (params) { return __awaiter(void 0, void 0, void 0, function () {
185
- var response;
186
- return __generator(this, function (_a) {
187
- switch (_a.label) {
188
- case 0: return [4, client_1.default.get("".concat(exports.publicRoute, "export_current_account"), {
189
- params: params,
190
- })];
191
- case 1:
192
- response = _a.sent();
193
- return [2, response.data];
194
- }
205
+ };
206
+ Repository.prototype.exportCurrentAccount = function (params) {
207
+ return __awaiter(this, void 0, void 0, function () {
208
+ var response;
209
+ return __generator(this, function (_a) {
210
+ switch (_a.label) {
211
+ case 0: return [4, this.api.get("".concat(this.publicRoute, "export_current_account"), {
212
+ params: params,
213
+ })];
214
+ case 1:
215
+ response = _a.sent();
216
+ return [2, response.data];
217
+ }
218
+ });
195
219
  });
196
- }); },
197
- findSettledMaterialEntranceByDate: function (params) { return __awaiter(void 0, void 0, void 0, function () {
198
- var response;
199
- return __generator(this, function (_a) {
200
- switch (_a.label) {
201
- case 0: return [4, client_1.default.get("".concat(exports.route, "settled_material_entrance_by_date"), {
202
- params: params,
203
- })];
204
- case 1:
205
- response = _a.sent();
206
- return [2, response.data];
207
- }
220
+ };
221
+ Repository.prototype.findSettledMaterialEntranceByDate = function (params) {
222
+ return __awaiter(this, void 0, void 0, function () {
223
+ var response;
224
+ return __generator(this, function (_a) {
225
+ switch (_a.label) {
226
+ case 0: return [4, this.api.get("".concat(this.route, "settled_material_entrance_by_date"), {
227
+ params: params,
228
+ })];
229
+ case 1:
230
+ response = _a.sent();
231
+ return [2, response.data];
232
+ }
233
+ });
208
234
  });
209
- }); },
210
- exportPayments: function (body) { return __awaiter(void 0, void 0, void 0, function () {
211
- return __generator(this, function (_a) {
212
- switch (_a.label) {
213
- case 0: return [4, client_1.default.post("".concat(exports.route, "export_payments"), body)];
214
- case 1:
215
- _a.sent();
216
- return [2];
217
- }
235
+ };
236
+ Repository.prototype.exportPayments = function (body) {
237
+ return __awaiter(this, void 0, void 0, function () {
238
+ return __generator(this, function (_a) {
239
+ switch (_a.label) {
240
+ case 0: return [4, this.api.post("".concat(this.route, "export_payments"), body)];
241
+ case 1:
242
+ _a.sent();
243
+ return [2];
244
+ }
245
+ });
218
246
  });
219
- }); },
220
- };
221
- exports.find = repository.find, exports.findPaginated = repository.findPaginated, exports.findByOwnerId = repository.findByOwnerId, exports.findById = repository.findById, exports.deleteBatch = repository.deleteBatch, exports.findCurrentAccountByOwnerId = repository.findCurrentAccountByOwnerId, exports.findSettledMaterialEntrance = repository.findSettledMaterialEntrance, exports.findSettledMaterialEntranceProviders = repository.findSettledMaterialEntranceProviders, exports.createProvidersPayments = repository.createProvidersPayments, exports.findPaymentsNotExported = repository.findPaymentsNotExported, exports.findPaymentBatches = repository.findPaymentBatches, exports.updateDownloadedBatchNumber = repository.updateDownloadedBatchNumber, exports.exportCurrentAccount = repository.exportCurrentAccount, exports.findSettledMaterialEntranceByDate = repository.findSettledMaterialEntranceByDate, exports.exportPayments = repository.exportPayments;
222
- var getExportCurrentAccountUrl = function (_a) {
223
- var owner_id = _a.owner_id, start_date = _a.start_date, end_date = _a.end_date, token = _a.token;
224
- var qs = new URLSearchParams();
225
- qs.set('owner_id', owner_id);
226
- if (start_date)
227
- qs.set('start_date', start_date.toISOString());
228
- if (end_date)
229
- qs.set('end_date', end_date.toISOString());
230
- qs.set('token', token);
231
- return "".concat(exports.publicRoute, "export_current_account?").concat(qs.toString());
232
- };
233
- exports.getExportCurrentAccountUrl = getExportCurrentAccountUrl;
247
+ };
248
+ Repository.prototype.getExportCurrentAccountUrl = function (_a) {
249
+ var owner_id = _a.owner_id, start_date = _a.start_date, end_date = _a.end_date, token = _a.token;
250
+ var qs = new URLSearchParams();
251
+ qs.set('owner_id', owner_id);
252
+ if (start_date)
253
+ qs.set('start_date', start_date.toISOString());
254
+ if (end_date)
255
+ qs.set('end_date', end_date.toISOString());
256
+ qs.set('token', token);
257
+ return "".concat(this.publicRoute, "export_current_account?").concat(qs.toString());
258
+ };
259
+ return Repository;
260
+ }());
261
+ exports.default = Repository;
@@ -1,4 +1,5 @@
1
1
  import { shared, PreSale as Entity } from '@nomalism-com/types';
2
+ import { IModuleConstructor } from 'index';
2
3
  export import IFindResponse = Entity.IFindResponse;
3
4
  export import IFindResponseWithQuantityOfPlots = Entity.IFindResponseWithQuantityOfPlots;
4
5
  export import ICreateRequest = Entity.ICreateRequest;
@@ -10,5 +11,17 @@ export import IRemovePlotOrPreSaleProductRequest = Entity.IRemovePlotOrPreSalePr
10
11
  export import IImportToClientProposalRequest = Entity.IImportToClientProposalRequest;
11
12
  export import IPreSaleFindByUser = Entity.IPreSaleFindByUser;
12
13
  export type IPaginationResponse = shared.IPaginationResponse<Entity.IFindResponse>;
13
- export declare const route: string;
14
- export declare const find: (selector: Entity.IPreSaleFindByUser) => Promise<IFindResponseWithQuantityOfPlots[]>, findById: (selector: shared.IFindByIdRequest) => Promise<IEntityExtended | null>, create: (body: ICreateRequest) => Promise<IFindResponse>, update: (selector: shared.IFindByIdRequest, body: IUpdateRequest) => Promise<IFindResponse | null>, removePlot: (selector: shared.IFindByIdRequest, body: IRemovePlotOrPreSaleProductRequest) => Promise<void>, findPending: () => Promise<IEntityExtended[]>, importToClientProposal: (data: IImportToClientProposalRequest) => Promise<void>;
14
+ export default class Repository implements Entity.IRepository {
15
+ private route;
16
+ private publicRoute;
17
+ private api;
18
+ constructor({ api, route, publicRoute }: IModuleConstructor);
19
+ find(selector: Entity.IPreSaleFindByUser): Promise<IFindResponseWithQuantityOfPlots[]>;
20
+ findById(selector: shared.IFindByIdRequest): Promise<IEntityExtended | null>;
21
+ findPending(): Promise<IEntityExtended[]>;
22
+ create(body: ICreateRequest): Promise<IFindResponse>;
23
+ update(selector: shared.IFindByIdRequest, body: IUpdateRequest): Promise<IFindResponse | null>;
24
+ updatePreSaleQuantity(selector: shared.IFindByIdRequest, body: IUpdatePreSaleQuantityRequest): Promise<IFindResponse | null>;
25
+ removePlot(selector: shared.IFindByIdRequest, body: IRemovePlotOrPreSaleProductRequest): Promise<void>;
26
+ importToClientProposal(data: IImportToClientProposalRequest): Promise<void>;
27
+ }