repzo-sap-absjo 1.0.6 → 1.0.8

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 (80) hide show
  1. package/changelog.md +4 -0
  2. package/lib/actions/create_invoice.d.ts +13 -19
  3. package/lib/actions/create_invoice.js +216 -336
  4. package/lib/actions/create_payment.d.ts +1 -4
  5. package/lib/actions/create_payment.js +125 -171
  6. package/lib/actions/create_proforma.d.ts +1 -4
  7. package/lib/actions/create_proforma.js +165 -268
  8. package/lib/actions/create_return_invoice.d.ts +1 -4
  9. package/lib/actions/create_return_invoice.js +177 -295
  10. package/lib/actions/create_transfer.d.ts +1 -4
  11. package/lib/actions/create_transfer.js +143 -198
  12. package/lib/actions/index.js +15 -23
  13. package/lib/commands/adjust_inventory.d.ts +2 -4
  14. package/lib/commands/adjust_inventory.js +160 -290
  15. package/lib/commands/bank.d.ts +2 -4
  16. package/lib/commands/bank.js +157 -279
  17. package/lib/commands/basic.js +47 -66
  18. package/lib/commands/category.d.ts +1 -3
  19. package/lib/commands/category.js +104 -178
  20. package/lib/commands/channel.d.ts +1 -3
  21. package/lib/commands/channel.js +117 -198
  22. package/lib/commands/client.d.ts +32 -34
  23. package/lib/commands/client.js +244 -404
  24. package/lib/commands/client_disabled.d.ts +1 -3
  25. package/lib/commands/client_disabled.js +94 -163
  26. package/lib/commands/index.d.ts +11 -15
  27. package/lib/commands/index.js +60 -60
  28. package/lib/commands/join.js +66 -192
  29. package/lib/commands/measureunit.d.ts +14 -19
  30. package/lib/commands/measureunit.js +191 -289
  31. package/lib/commands/measureunit_family.d.ts +8 -10
  32. package/lib/commands/measureunit_family.js +138 -250
  33. package/lib/commands/payment_term.d.ts +1 -3
  34. package/lib/commands/payment_term.js +123 -202
  35. package/lib/commands/price_list.d.ts +15 -15
  36. package/lib/commands/price_list.js +327 -571
  37. package/lib/commands/product.d.ts +30 -32
  38. package/lib/commands/product.js +243 -425
  39. package/lib/commands/product_disabled.d.ts +1 -3
  40. package/lib/commands/product_disabled.js +94 -164
  41. package/lib/commands/rep.js +141 -221
  42. package/lib/commands/tag.js +109 -174
  43. package/lib/commands/tax.js +112 -177
  44. package/lib/commands/warehouse.d.ts +1 -3
  45. package/lib/commands/warehouse.js +119 -207
  46. package/lib/index.d.ts +12 -21
  47. package/lib/test/actions/create_invoice.js +188 -193
  48. package/lib/test/actions/create_payment.js +107 -112
  49. package/lib/test/actions/create_proforma.js +216 -220
  50. package/lib/test/actions/create_return_invoice.js +200 -205
  51. package/lib/test/actions/create_transfer.js +115 -120
  52. package/lib/test/commands/adjust_inventory.js +90 -90
  53. package/lib/test/commands/bank.js +90 -90
  54. package/lib/test/commands/basic.js +327 -328
  55. package/lib/test/commands/category.js +90 -90
  56. package/lib/test/commands/channel.js +90 -90
  57. package/lib/test/commands/client.js +353 -355
  58. package/lib/test/commands/client_disabled.js +90 -90
  59. package/lib/test/commands/join.js +327 -328
  60. package/lib/test/commands/measureunit.js +90 -90
  61. package/lib/test/commands/measureunit_family.js +90 -90
  62. package/lib/test/commands/payment_term.js +90 -90
  63. package/lib/test/commands/price_list.js +337 -90
  64. package/lib/test/commands/product.js +90 -90
  65. package/lib/test/commands/product_disabled.js +90 -90
  66. package/lib/test/commands/rep.js +344 -346
  67. package/lib/test/commands/tag.js +90 -90
  68. package/lib/test/commands/tax.js +90 -90
  69. package/lib/test/commands/warehouse.js +90 -90
  70. package/lib/types.d.ts +60 -83
  71. package/lib/util.d.ts +19 -70
  72. package/lib/util.js +144 -170
  73. package/package.json +1 -1
  74. package/src/actions/create_invoice.ts +35 -0
  75. package/src/actions/create_payment.ts +35 -0
  76. package/src/actions/create_proforma.ts +35 -0
  77. package/src/actions/create_return_invoice.ts +35 -0
  78. package/src/actions/create_transfer.ts +34 -0
  79. package/src/commands/price_list.ts +40 -4
  80. package/src/test/commands/price_list.ts +263 -13
@@ -1,243 +1,239 @@
1
1
  import { Actions } from "../../index.js";
2
- Actions(
3
- {
2
+ Actions({
4
3
  version: "2.0",
5
4
  routeKey: "POST /actions",
6
5
  rawPath: "/actions",
7
6
  rawQueryString: "app=repzo-sap-absjo&action=create_proforma",
8
7
  headers: {
9
- action_sync_id: "Actions-0000003",
10
- accept: "*/*",
11
- "accept-encoding": "gzip, deflate",
12
- "content-length": "3658",
13
- "content-type": "application/json",
14
- host: "staging.marketplace.api.repzo.me",
15
- "svix-id": "msg_29I1By29ETyPiZ4SNrc99KIg7D6",
16
- "svix-signature": "v1,OkktM+dibxzeb0M6383POFjBr7DX14HECpBIh17FQnU=",
17
- "svix-timestamp": "1652785653",
18
- "user-agent": "Svix-Webhooks/1.4",
19
- "x-amzn-trace-id": "Root=1-628381f6-0b2c6f346d2eb5d207b582ee",
20
- "x-forwarded-for": "52.215.16.239",
21
- "x-forwarded-port": "443",
22
- "x-forwarded-proto": "https",
8
+ action_sync_id: "Actions-0000003",
9
+ accept: "*/*",
10
+ "accept-encoding": "gzip, deflate",
11
+ "content-length": "3658",
12
+ "content-type": "application/json",
13
+ host: "staging.marketplace.api.repzo.me",
14
+ "svix-id": "msg_29I1By29ETyPiZ4SNrc99KIg7D6",
15
+ "svix-signature": "v1,OkktM+dibxzeb0M6383POFjBr7DX14HECpBIh17FQnU=",
16
+ "svix-timestamp": "1652785653",
17
+ "user-agent": "Svix-Webhooks/1.4",
18
+ "x-amzn-trace-id": "Root=1-628381f6-0b2c6f346d2eb5d207b582ee",
19
+ "x-forwarded-for": "52.215.16.239",
20
+ "x-forwarded-port": "443",
21
+ "x-forwarded-proto": "https",
23
22
  },
24
23
  queryStringParameters: {
25
- action: "create_proforma",
26
- app: "repzo-sap-absjo",
24
+ action: "create_proforma",
25
+ app: "repzo-sap-absjo",
27
26
  },
28
27
  requestContext: {
29
- accountId: "478266140170",
30
- apiId: "ulkb1ikop2",
31
- domainName: "staging.marketplace.api.repzo.me",
32
- domainPrefix: "staging",
33
- http: {
34
- method: "POST",
35
- path: "/actions",
36
- protocol: "HTTP/1.1",
37
- sourceIp: "52.215.16.239",
38
- userAgent: "Svix-Webhooks/1.4",
39
- },
40
- requestId: "SRE-ejb6IAMEPWQ=",
41
- routeKey: "POST /actions",
42
- stage: "$default",
43
- time: "17/May/2022:11:07:34 +0000",
44
- timeEpoch: 1652785654069,
28
+ accountId: "478266140170",
29
+ apiId: "ulkb1ikop2",
30
+ domainName: "staging.marketplace.api.repzo.me",
31
+ domainPrefix: "staging",
32
+ http: {
33
+ method: "POST",
34
+ path: "/actions",
35
+ protocol: "HTTP/1.1",
36
+ sourceIp: "52.215.16.239",
37
+ userAgent: "Svix-Webhooks/1.4",
38
+ },
39
+ requestId: "SRE-ejb6IAMEPWQ=",
40
+ routeKey: "POST /actions",
41
+ stage: "$default",
42
+ time: "17/May/2022:11:07:34 +0000",
43
+ timeEpoch: 1652785654069,
45
44
  },
46
45
  body: JSON.stringify({
47
- _id: "639dc3af162ee0872ff7356c",
48
- processable: true,
49
- client_id: "639ae1df506dfca71557a7f7",
50
- client_name: "تزويد للحلول التجاريه",
51
- comment: "تسليم المفرق ",
52
- creator: {
53
- _id: "6395af40a7fbbe901db1c28c",
54
- type: "rep",
55
- rep: "6395af40a7fbbe901db1c28c",
56
- name: "RET KHALDOUN IBRAHIM MOHAMMAD OTHMAN",
57
- },
58
- latest: true,
59
- version: 1,
60
- time: 1671283619190,
61
- business_day: "2022-12-17",
62
- issue_date: "2022-12-17",
63
- delivery_date: null,
64
- currency: "JOD",
65
- serial_number: {
66
- identifier: "1032",
67
- formatted: "PRO-1032-1602",
68
- count: 1602,
69
- _id: "639dc3af162ee0872ff7356d",
70
- },
71
- route: null,
72
- geo_tag: {
73
- type: "Point",
74
- coordinates: [35.9446535, 31.8430022],
75
- _id: "639dc3af162ee0872ff7356e",
76
- },
77
- sync_id: "29816665-1664-4a06-8300-2414fd111840",
78
- company_namespace: ["unipaljo"],
79
- promotions: [],
80
- priceLists: [
81
- {
82
- _id: "61c9b0740281e55fe35ee7c1",
83
- product_id: "6398bd370242db686d474f58",
84
- variant_id: "6398bd370242db686d474f5a",
85
- pricelist_id: "61c9b01f0281e55fe35ee03e",
86
- price: 1642,
87
- disabled: false,
88
- createdAt: "2021-12-27T12:24:20.168Z",
89
- updatedAt: "2022-02-17T07:44:23.940Z",
46
+ _id: "639dc3af162ee0872ff7356c",
47
+ processable: true,
48
+ client_id: "639ae1df506dfca71557a7f7",
49
+ client_name: "تزويد للحلول التجاريه",
50
+ comment: "تسليم المفرق ",
51
+ creator: {
52
+ _id: "6395af40a7fbbe901db1c28c",
53
+ type: "rep",
54
+ rep: "6395af40a7fbbe901db1c28c",
55
+ name: "RET KHALDOUN IBRAHIM MOHAMMAD OTHMAN",
56
+ },
57
+ latest: true,
58
+ version: 1,
59
+ time: 1671283619190,
60
+ business_day: "2022-12-17",
61
+ issue_date: "2022-12-17",
62
+ delivery_date: null,
63
+ currency: "JOD",
64
+ serial_number: {
65
+ identifier: "1032",
66
+ formatted: "PRO-1032-1602",
67
+ count: 1602,
68
+ _id: "639dc3af162ee0872ff7356d",
90
69
  },
91
- ],
92
- visit_id: "54306e61-ac85-4c99-94e4-9cecd408c4d2",
93
- teams: [],
94
- editor: {
95
- _id: "61943ed1282027d0bff9972f",
96
- type: "admin",
97
- admin: "61943ed1282027d0bff9972f",
98
- name: "Ali Inab",
99
- },
100
- disabled: false,
101
- status: "approved",
102
- items: [
103
- {
104
- isAdditional: false,
105
- variant: {
106
- product_id: "6398bd370242db686d474f58",
107
- product_name: "Unium Chicken Luncheon Meat 500gm @ 15% P.off",
108
- variant_id: "6398bd370242db686d474f5a",
109
- variant_name: "010-UNI-UN0058",
110
- listed_price: 0,
111
- _id: "6398bd370242db686d474f5a",
112
- variant_sku: "",
113
- product_sku: "010-UNI-UN0058",
114
- variant_barcode: "",
115
- product_barcode: "6253005346534",
116
- },
117
- qty: 50,
118
- measureunit: {
119
- parent: "63981c32e9f3eafb51d7f0af",
120
- name: "CRTN",
121
- factor: 24,
122
- disabled: false,
123
- company_namespace: [],
124
- _id: "63981cb0edafde008af0d513",
125
- },
126
- tax: {
127
- name: "امانات ضريبة المبيعات 10%",
128
- rate: 0.1,
129
- type: "additive",
130
- disabled: false,
131
- _id: "639715d5bee5dd4b6b11e430",
132
- },
133
- base_unit_qty: 1200,
134
- overwritePrice: null,
135
- price: 1642,
136
- discounted_price: 1642,
137
- tax_amount: 164,
138
- tax_total: 197040,
139
- discount_value: 0,
140
- gross_value: 1806,
141
- line_total: 2167440,
142
- total_before_tax: 1970400,
143
- modifiers_total: 0,
144
- modifiers_total_before_tax: 0,
145
- modifiers_tax_total: 0,
146
- tax_total_without_modifiers: 197040,
147
- line_total_without_modifiers: 2167440,
148
- total_before_tax_without_modifiers: 1970400,
149
- deductionRatio: 0,
150
- deductedTax: 0,
151
- deduction: 0,
152
- deductionBeforeTax: 0,
153
- lineTotalAfterDeduction: 2167440,
154
- promotions: {
155
- isGet: false,
156
- taken: 0,
157
- free: 1200,
158
- bookings: [],
159
- highlight: false,
160
- },
161
- used_promotions: [],
162
- general_promotions: [],
163
- applicable_promotions: [],
164
- modifiers_groups: [],
165
- company_namespace: [],
166
- note: "",
167
- _id: "639dc3af162ee0872ff7356f",
70
+ route: null,
71
+ geo_tag: {
72
+ type: "Point",
73
+ coordinates: [35.9446535, 31.8430022],
74
+ _id: "639dc3af162ee0872ff7356e",
168
75
  },
169
- ],
170
- subtotal: 1970400,
171
- discount_amount: 0,
172
- taxable_subtotal: 1970400,
173
- tax_amount: 197040,
174
- total: 2167440,
175
- pre_subtotal: 1970400,
176
- pre_discount_amount: 0,
177
- pre_taxable_subtotal: 1970400,
178
- pre_tax_amount: 197040,
179
- pre_total: 2167440,
180
- return_subtotal: 0,
181
- return_discount_amount: 0,
182
- return_taxable_subtotal: 0,
183
- return_tax_amount: 0,
184
- return_total: 0,
185
- deductionRatio: 0,
186
- deductionFixed: 0,
187
- totalDeductedTax: 0,
188
- totalDeduction: 0,
189
- totalDeductionBeforeTax: 0,
190
- totalAfterDeduction: 2167440,
191
- taxes: {
192
- "امانات ضريبة المبيعات 10%": {
193
- name: "امانات ضريبة المبيعات 10%",
194
- rate: 0.1,
195
- total: 197040,
196
- type: "additive",
76
+ sync_id: "29816665-1664-4a06-8300-2414fd111840",
77
+ company_namespace: ["unipaljo"],
78
+ promotions: [],
79
+ priceLists: [
80
+ {
81
+ _id: "61c9b0740281e55fe35ee7c1",
82
+ product_id: "6398bd370242db686d474f58",
83
+ variant_id: "6398bd370242db686d474f5a",
84
+ pricelist_id: "61c9b01f0281e55fe35ee03e",
85
+ price: 1642,
86
+ disabled: false,
87
+ createdAt: "2021-12-27T12:24:20.168Z",
88
+ updatedAt: "2022-02-17T07:44:23.940Z",
89
+ },
90
+ ],
91
+ visit_id: "54306e61-ac85-4c99-94e4-9cecd408c4d2",
92
+ teams: [],
93
+ editor: {
94
+ _id: "61943ed1282027d0bff9972f",
95
+ type: "admin",
96
+ admin: "61943ed1282027d0bff9972f",
97
+ name: "Ali Inab",
197
98
  },
198
- },
199
- overwriteTaxExempt: false,
200
- tax_exempt: false,
201
- shipping_price: 0,
202
- shipping_tax: 0,
203
- shipping_charge: 0,
204
- payment_charge: 0,
205
- total_with_charges: 2167440,
206
- createdAt: "2022-12-17T13:27:11.321Z",
207
- updatedAt: "2022-12-17T18:33:43.378Z",
208
- __v: 0,
99
+ disabled: false,
100
+ status: "approved",
101
+ items: [
102
+ {
103
+ isAdditional: false,
104
+ variant: {
105
+ product_id: "6398bd370242db686d474f58",
106
+ product_name: "Unium Chicken Luncheon Meat 500gm @ 15% P.off",
107
+ variant_id: "6398bd370242db686d474f5a",
108
+ variant_name: "010-UNI-UN0058",
109
+ listed_price: 0,
110
+ _id: "6398bd370242db686d474f5a",
111
+ variant_sku: "",
112
+ product_sku: "010-UNI-UN0058",
113
+ variant_barcode: "",
114
+ product_barcode: "6253005346534",
115
+ },
116
+ qty: 50,
117
+ measureunit: {
118
+ parent: "63981c32e9f3eafb51d7f0af",
119
+ name: "CRTN",
120
+ factor: 24,
121
+ disabled: false,
122
+ company_namespace: [],
123
+ _id: "63981cb0edafde008af0d513",
124
+ },
125
+ tax: {
126
+ name: "امانات ضريبة المبيعات 10%",
127
+ rate: 0.1,
128
+ type: "additive",
129
+ disabled: false,
130
+ _id: "639715d5bee5dd4b6b11e430",
131
+ },
132
+ base_unit_qty: 1200,
133
+ overwritePrice: null,
134
+ price: 1642,
135
+ discounted_price: 1642,
136
+ tax_amount: 164,
137
+ tax_total: 197040,
138
+ discount_value: 0,
139
+ gross_value: 1806,
140
+ line_total: 2167440,
141
+ total_before_tax: 1970400,
142
+ modifiers_total: 0,
143
+ modifiers_total_before_tax: 0,
144
+ modifiers_tax_total: 0,
145
+ tax_total_without_modifiers: 197040,
146
+ line_total_without_modifiers: 2167440,
147
+ total_before_tax_without_modifiers: 1970400,
148
+ deductionRatio: 0,
149
+ deductedTax: 0,
150
+ deduction: 0,
151
+ deductionBeforeTax: 0,
152
+ lineTotalAfterDeduction: 2167440,
153
+ promotions: {
154
+ isGet: false,
155
+ taken: 0,
156
+ free: 1200,
157
+ bookings: [],
158
+ highlight: false,
159
+ },
160
+ used_promotions: [],
161
+ general_promotions: [],
162
+ applicable_promotions: [],
163
+ modifiers_groups: [],
164
+ company_namespace: [],
165
+ note: "",
166
+ _id: "639dc3af162ee0872ff7356f",
167
+ },
168
+ ],
169
+ subtotal: 1970400,
170
+ discount_amount: 0,
171
+ taxable_subtotal: 1970400,
172
+ tax_amount: 197040,
173
+ total: 2167440,
174
+ pre_subtotal: 1970400,
175
+ pre_discount_amount: 0,
176
+ pre_taxable_subtotal: 1970400,
177
+ pre_tax_amount: 197040,
178
+ pre_total: 2167440,
179
+ return_subtotal: 0,
180
+ return_discount_amount: 0,
181
+ return_taxable_subtotal: 0,
182
+ return_tax_amount: 0,
183
+ return_total: 0,
184
+ deductionRatio: 0,
185
+ deductionFixed: 0,
186
+ totalDeductedTax: 0,
187
+ totalDeduction: 0,
188
+ totalDeductionBeforeTax: 0,
189
+ totalAfterDeduction: 2167440,
190
+ taxes: {
191
+ "امانات ضريبة المبيعات 10%": {
192
+ name: "امانات ضريبة المبيعات 10%",
193
+ rate: 0.1,
194
+ total: 197040,
195
+ type: "additive",
196
+ },
197
+ },
198
+ overwriteTaxExempt: false,
199
+ tax_exempt: false,
200
+ shipping_price: 0,
201
+ shipping_tax: 0,
202
+ shipping_charge: 0,
203
+ payment_charge: 0,
204
+ total_with_charges: 2167440,
205
+ createdAt: "2022-12-17T13:27:11.321Z",
206
+ updatedAt: "2022-12-17T18:33:43.378Z",
207
+ __v: 0,
209
208
  }),
210
209
  isBase64Encoded: false,
211
- },
212
- {
210
+ }, {
213
211
  app_id: "",
214
212
  repzoEndPoint: "",
215
213
  serviceEndPoint: "",
216
214
  env: "staging",
217
215
  data: {
218
- invoices: {
219
- createInvoiceHook: false,
220
- createReturnInvoiceHook: false,
221
- },
222
- payments: {
223
- createPaymentHook: false,
224
- },
225
- proformas: {
226
- createApprovedProformaHook: false,
227
- },
228
- transfer: {
229
- createApprovedTransferHook: false,
230
- },
231
- repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
232
- sapHostUrl: "http://unipal.b1pro.com:8083/api",
233
- errorEmail: "maram.alshen@repzoapp.com",
234
- serviceApiKey: "awdas",
235
- warehouseDefaultUpdateDate: "2015-01-01",
236
- DepartmentCode: "D2",
237
- return_reason:
238
- '[{sap_id:1,sap_name:"BarcodeIssue",repzo_name:"Barcodeissue",repzo_id:"62b074972b332895edf114fc"},{sap_id:2,sap_name:"Damaged",repzo_name:"Damaged",repzo_id:"62b074ace96258fb745982e4"},{sap_id:3,sap_name:"Nearexpiry",repzo_name:"Nearexpiry",repzo_id:"62b074c0a066173bd1c1ea0d"},{sap_id:4,sap_name:"Wrongprinting",repzo_name:"Wrongprinting",repzo_id:"62b074d79e7f41f306a4cb42"},{sap_id:5,sap_name:"experied",repzo_name:"Experied",repzo_id:"62b074faa066173bd1c1eec0"}]',
239
- SalPersCode: "111",
240
- SalesPersonCode: "111",
216
+ invoices: {
217
+ createInvoiceHook: false,
218
+ createReturnInvoiceHook: false,
219
+ },
220
+ payments: {
221
+ createPaymentHook: false,
222
+ },
223
+ proformas: {
224
+ createApprovedProformaHook: false,
225
+ },
226
+ transfer: {
227
+ createApprovedTransferHook: false,
228
+ },
229
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
230
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
231
+ errorEmail: "maram.alshen@repzoapp.com",
232
+ serviceApiKey: "awdas",
233
+ warehouseDefaultUpdateDate: "2015-01-01",
234
+ DepartmentCode: "D2",
235
+ return_reason: '[{sap_id:1,sap_name:"BarcodeIssue",repzo_name:"Barcodeissue",repzo_id:"62b074972b332895edf114fc"},{sap_id:2,sap_name:"Damaged",repzo_name:"Damaged",repzo_id:"62b074ace96258fb745982e4"},{sap_id:3,sap_name:"Nearexpiry",repzo_name:"Nearexpiry",repzo_id:"62b074c0a066173bd1c1ea0d"},{sap_id:4,sap_name:"Wrongprinting",repzo_name:"Wrongprinting",repzo_id:"62b074d79e7f41f306a4cb42"},{sap_id:5,sap_name:"experied",repzo_name:"Experied",repzo_id:"62b074faa066173bd1c1eec0"}]',
236
+ SalPersCode: "111",
237
+ SalesPersonCode: "111",
241
238
  },
242
- }
243
- );
239
+ });