repzo-sap-absjo 1.0.1

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 (157) hide show
  1. package/README.md +3 -0
  2. package/changelog.md +17 -0
  3. package/lib/actions/create_invoice.d.ts +26 -0
  4. package/lib/actions/create_invoice.js +311 -0
  5. package/lib/actions/create_payment.d.ts +5 -0
  6. package/lib/actions/create_payment.js +177 -0
  7. package/lib/actions/create_proforma.d.ts +5 -0
  8. package/lib/actions/create_proforma.js +241 -0
  9. package/lib/actions/create_return_invoice.d.ts +5 -0
  10. package/lib/actions/create_return_invoice.js +268 -0
  11. package/lib/actions/create_transfer.d.ts +5 -0
  12. package/lib/actions/create_transfer.js +171 -0
  13. package/lib/actions/index.d.ts +3 -0
  14. package/lib/actions/index.js +31 -0
  15. package/lib/commands/adjust_inventory.d.ts +6 -0
  16. package/lib/commands/adjust_inventory.js +303 -0
  17. package/lib/commands/bank.d.ts +7 -0
  18. package/lib/commands/bank.js +301 -0
  19. package/lib/commands/basic.d.ts +2 -0
  20. package/lib/commands/basic.js +73 -0
  21. package/lib/commands/category.d.ts +4 -0
  22. package/lib/commands/category.js +193 -0
  23. package/lib/commands/channel.d.ts +4 -0
  24. package/lib/commands/channel.js +213 -0
  25. package/lib/commands/client.d.ts +39 -0
  26. package/lib/commands/client.js +410 -0
  27. package/lib/commands/client_disabled.d.ts +4 -0
  28. package/lib/commands/client_disabled.js +183 -0
  29. package/lib/commands/index.d.ts +23 -0
  30. package/lib/commands/index.js +82 -0
  31. package/lib/commands/join.d.ts +2 -0
  32. package/lib/commands/join.js +134 -0
  33. package/lib/commands/measureunit.d.ts +23 -0
  34. package/lib/commands/measureunit.js +314 -0
  35. package/lib/commands/measureunit_family.d.ts +12 -0
  36. package/lib/commands/measureunit_family.js +263 -0
  37. package/lib/commands/payment_term.d.ts +4 -0
  38. package/lib/commands/payment_term.js +217 -0
  39. package/lib/commands/price_list.d.ts +18 -0
  40. package/lib/commands/price_list.js +608 -0
  41. package/lib/commands/product.d.ts +39 -0
  42. package/lib/commands/product.js +454 -0
  43. package/lib/commands/product_disabled.d.ts +4 -0
  44. package/lib/commands/product_disabled.js +178 -0
  45. package/lib/commands/rep.d.ts +2 -0
  46. package/lib/commands/rep.js +246 -0
  47. package/lib/commands/tag.d.ts +2 -0
  48. package/lib/commands/tag.js +195 -0
  49. package/lib/commands/tax.d.ts +2 -0
  50. package/lib/commands/tax.js +198 -0
  51. package/lib/commands/warehouse.d.ts +4 -0
  52. package/lib/commands/warehouse.js +221 -0
  53. package/lib/index.d.ts +29 -0
  54. package/lib/index.js +6 -0
  55. package/lib/test/actions/create_invoice.d.ts +1 -0
  56. package/lib/test/actions/create_invoice.js +214 -0
  57. package/lib/test/actions/create_payment.d.ts +1 -0
  58. package/lib/test/actions/create_payment.js +131 -0
  59. package/lib/test/actions/create_proforma.d.ts +1 -0
  60. package/lib/test/actions/create_proforma.js +242 -0
  61. package/lib/test/actions/create_return_invoice.d.ts +1 -0
  62. package/lib/test/actions/create_return_invoice.js +226 -0
  63. package/lib/test/actions/create_transfer.d.ts +1 -0
  64. package/lib/test/actions/create_transfer.js +142 -0
  65. package/lib/test/commands/adjust_inventory.d.ts +1 -0
  66. package/lib/test/commands/adjust_inventory.js +97 -0
  67. package/lib/test/commands/bank.d.ts +1 -0
  68. package/lib/test/commands/bank.js +97 -0
  69. package/lib/test/commands/basic.d.ts +1 -0
  70. package/lib/test/commands/basic.js +339 -0
  71. package/lib/test/commands/category.d.ts +1 -0
  72. package/lib/test/commands/category.js +97 -0
  73. package/lib/test/commands/channel.d.ts +1 -0
  74. package/lib/test/commands/channel.js +97 -0
  75. package/lib/test/commands/client.d.ts +1 -0
  76. package/lib/test/commands/client.js +97 -0
  77. package/lib/test/commands/client_disabled.d.ts +1 -0
  78. package/lib/test/commands/client_disabled.js +97 -0
  79. package/lib/test/commands/join.d.ts +1 -0
  80. package/lib/test/commands/join.js +339 -0
  81. package/lib/test/commands/measureunit.d.ts +1 -0
  82. package/lib/test/commands/measureunit.js +97 -0
  83. package/lib/test/commands/measureunit_family.d.ts +1 -0
  84. package/lib/test/commands/measureunit_family.js +97 -0
  85. package/lib/test/commands/payment_term.d.ts +1 -0
  86. package/lib/test/commands/payment_term.js +97 -0
  87. package/lib/test/commands/price_list.d.ts +1 -0
  88. package/lib/test/commands/price_list.js +97 -0
  89. package/lib/test/commands/product.d.ts +1 -0
  90. package/lib/test/commands/product.js +97 -0
  91. package/lib/test/commands/product_disabled.d.ts +1 -0
  92. package/lib/test/commands/product_disabled.js +97 -0
  93. package/lib/test/commands/rep.d.ts +1 -0
  94. package/lib/test/commands/rep.js +97 -0
  95. package/lib/test/commands/tag.d.ts +1 -0
  96. package/lib/test/commands/tag.js +97 -0
  97. package/lib/test/commands/tax.d.ts +1 -0
  98. package/lib/test/commands/tax.js +97 -0
  99. package/lib/test/commands/warehouse.d.ts +1 -0
  100. package/lib/test/commands/warehouse.js +97 -0
  101. package/lib/types.d.ts +77 -0
  102. package/lib/types.js +1 -0
  103. package/lib/util.d.ts +70 -0
  104. package/lib/util.js +164 -0
  105. package/package.json +51 -0
  106. package/src/actions/create_invoice.ts +275 -0
  107. package/src/actions/create_payment.ts +138 -0
  108. package/src/actions/create_proforma.ts +187 -0
  109. package/src/actions/create_return_invoice.ts +217 -0
  110. package/src/actions/create_transfer.ts +160 -0
  111. package/src/actions/index.ts +27 -0
  112. package/src/commands/adjust_inventory.ts +250 -0
  113. package/src/commands/bank.ts +243 -0
  114. package/src/commands/basic.ts +64 -0
  115. package/src/commands/category.ts +176 -0
  116. package/src/commands/channel.ts +219 -0
  117. package/src/commands/client.ts +368 -0
  118. package/src/commands/client_disabled.ts +158 -0
  119. package/src/commands/index.ts +87 -0
  120. package/src/commands/join.ts +80 -0
  121. package/src/commands/measureunit.ts +276 -0
  122. package/src/commands/measureunit_family.ts +209 -0
  123. package/src/commands/payment_term.ts +224 -0
  124. package/src/commands/price_list.ts +434 -0
  125. package/src/commands/product.ts +359 -0
  126. package/src/commands/product_disabled.ts +152 -0
  127. package/src/commands/rep.ts +209 -0
  128. package/src/commands/tag.ts +173 -0
  129. package/src/commands/tax.ts +178 -0
  130. package/src/commands/warehouse.ts +204 -0
  131. package/src/index.ts +7 -0
  132. package/src/test/actions/create_invoice.ts +214 -0
  133. package/src/test/actions/create_payment.ts +131 -0
  134. package/src/test/actions/create_proforma.ts +242 -0
  135. package/src/test/actions/create_return_invoice.ts +226 -0
  136. package/src/test/actions/create_transfer.ts +142 -0
  137. package/src/test/commands/adjust_inventory.ts +100 -0
  138. package/src/test/commands/bank.ts +100 -0
  139. package/src/test/commands/basic.ts +342 -0
  140. package/src/test/commands/category.ts +100 -0
  141. package/src/test/commands/channel.ts +100 -0
  142. package/src/test/commands/client.ts +100 -0
  143. package/src/test/commands/client_disabled.ts +100 -0
  144. package/src/test/commands/join.ts +342 -0
  145. package/src/test/commands/measureunit.ts +100 -0
  146. package/src/test/commands/measureunit_family.ts +100 -0
  147. package/src/test/commands/payment_term.ts +100 -0
  148. package/src/test/commands/price_list.ts +100 -0
  149. package/src/test/commands/product.ts +100 -0
  150. package/src/test/commands/product_disabled.ts +100 -0
  151. package/src/test/commands/rep.ts +100 -0
  152. package/src/test/commands/tag.ts +100 -0
  153. package/src/test/commands/tax.ts +100 -0
  154. package/src/test/commands/warehouse.ts +100 -0
  155. package/src/types.ts +76 -0
  156. package/src/util.ts +205 -0
  157. package/tsconfig.json +15 -0
@@ -0,0 +1,226 @@
1
+ import { Actions } from "../../index.js";
2
+ Actions(
3
+ {
4
+ version: "2.0",
5
+ routeKey: "POST /actions",
6
+ rawPath: "/actions",
7
+ rawQueryString: "app=repzo-sap-absjo&action=create_return_invoice",
8
+ headers: {
9
+ action_sync_id: "Actions-0000002", // SYNC_ID
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",
23
+ },
24
+ queryStringParameters: {
25
+ action: "create_return_invoice",
26
+ app: "repzo-sap-absjo",
27
+ },
28
+ 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,
45
+ },
46
+ body: JSON.stringify({
47
+ __v: 0,
48
+ _id: "639ebfa7637f0245185a2de4",
49
+ authorization:
50
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lem9uZSI6IkFzaWEvUml5YWRoIiwidXNlcm5hbWUiOiJ1bmlwYWxqbzE1NyIsIm5hbWUiOiJESVNUUklCVVRFUiBEaWFhIEFidSBzaGFyZWViIiwic2NvcGUiOiJyZXAiLCJuYW1lU3BhY2UiOlsidW5pcGFsam8iXSwidGVhbSI6W10sImlkZW50aWZpZXIiOjEwNzQsImlkIjoiNjI2Njc3OTJiNzM4ODg4ZDg1ZGY5MTUyIiwiYXBwX2NvZGUiOiJyZXB6b19wcm8iLCJjb3VudHJ5X2NvZGUiOlsiSk8iXSwicGVybWFTdHJpbmciOiJ2dnYwdnZ2dnYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHZ2dnZ2dnYwMDAwdjB2MHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2djB2dnZ2djB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2djB2MHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2IiwiaWF0IjoxNjcxMzQ3ODQ5LCJleHAiOjE2NzEzOTEwNDl9.bh1tiS0XyjiQspt9nMiFNMrkcTojgwKF1hAAgh4v1fI",
51
+ business_day: "2022-12-18",
52
+ client_id: "639ae371b4dc172fc5039b40",
53
+ client_name: "MCE_المؤسسة الاستهلاكية العسكرية",
54
+ comment: "",
55
+ company_namespace: ["unisap"],
56
+ consumption: {
57
+ _id: "639ebfba462a9df7c259ffeb",
58
+ remainder: 15120,
59
+ status: "unconsumed",
60
+ },
61
+ createdAt: "2022-12-18T07:22:34.876Z",
62
+ creator: {
63
+ _id: "6395af8076a399e2b1315687",
64
+ name: "DISTRIBUTER Diaa Abu shareeb",
65
+ rep: "6395af8076a399e2b1315687",
66
+ type: "rep",
67
+ },
68
+ currency: "JOD",
69
+ deductionFixed: 0,
70
+ deductionRatio: 0,
71
+ delivery_date: null,
72
+ discount_amount: 0,
73
+ due_date: "2023-03-18",
74
+ geo_tag: {
75
+ _id: "639ebfba462a9df7c259ffe8",
76
+ coordinates: [35.74179, 32.1129259],
77
+ type: "Point",
78
+ },
79
+ is_void: false,
80
+ issue_date: "2022-12-18",
81
+ items: [],
82
+ latest: true,
83
+ origin_warehouse: "6391cca5ca8b3e4981aa36e5",
84
+ overwriteTaxExempt: false,
85
+ payment_charge: 0,
86
+ pre_discount_amount: 0,
87
+ pre_subtotal: 0,
88
+ pre_tax_amount: 0,
89
+ pre_taxable_subtotal: 0,
90
+ pre_total: 0,
91
+ processable: true,
92
+ promotions: [],
93
+ return_discount_amount: 0,
94
+ return_items: [
95
+ {
96
+ _id: "639ebfba462a9df7c259ffec",
97
+ applicable_promotions: [],
98
+ base_unit_qty: -68,
99
+ class: "return",
100
+ company_namespace: [],
101
+ discount_value: 0,
102
+ discounted_price: 218,
103
+ general_promotions: [],
104
+ gross_value: 222,
105
+ isAdditional: false,
106
+ line_total: -15120,
107
+ line_total_without_modifiers: -15120,
108
+ measureunit: {
109
+ _id: "63981c98bee5dd4b6b12e4c5",
110
+ company_namespace: [],
111
+ disabled: false,
112
+ factor: 1,
113
+ name: "PC",
114
+ parent: "63981c32e9f3eafb51d7f0af",
115
+ },
116
+ modifiers_groups: [],
117
+ modifiers_tax_total: 0,
118
+ modifiers_total: 0,
119
+ modifiers_total_before_tax: 0,
120
+ note: "",
121
+ overwritePrice: null,
122
+ price: 218,
123
+ qty: -68,
124
+ return_reason: "62b074c0a066173bd1c1ea0d",
125
+ tax: {
126
+ _id: "639715dbbee5dd4b6b11e674",
127
+ disabled: false,
128
+ name: "امانات ضريبة المبيعات %2",
129
+ rate: 0.02,
130
+ type: "additive",
131
+ },
132
+ tax_amount: 4,
133
+ tax_total: -296,
134
+ tax_total_without_modifiers: -296,
135
+ total_before_tax: -14824,
136
+ total_before_tax_without_modifiers: -14824,
137
+ used_promotions: [],
138
+ variant: {
139
+ _id: "6398a562e8a1cfdd26dc5e37",
140
+ listed_price: 0,
141
+ product_id: "6398a562e8a1cfdd26dc5e35",
142
+ product_name: "Heinz Tomato Paste Tetra Pack (12M) 6X8X135gm",
143
+ variant_id: "6398a562e8a1cfdd26dc5e37",
144
+ variant_name: "010-HEI-HE0156",
145
+ },
146
+ },
147
+ ],
148
+ return_serial_number: {
149
+ _id: "639ebfba462a9df7c259ffe9",
150
+ count: 155,
151
+ formatted: "RTN-1074-155",
152
+ identifier: "1074",
153
+ },
154
+ return_subtotal: 14824,
155
+ return_tax_amount: 296,
156
+ return_taxable_subtotal: 14824,
157
+ return_total: 15120,
158
+ route: null,
159
+ serial_number: {
160
+ _id: "639ebfba462a9df7c259ffe7",
161
+ count: 155,
162
+ formatted: "INV-1074-155",
163
+ identifier: "1074",
164
+ },
165
+ shipping_charge: 0,
166
+ shipping_price: 0,
167
+ shipping_tax: 0,
168
+ signature: null,
169
+ status: "paid",
170
+ subtotal: -14824,
171
+ sync_id: "a34651d8-c586-415b-8914-91da62aeaa3f",
172
+ tax_amount: -296,
173
+ tax_exempt: false,
174
+ taxable_subtotal: -14824,
175
+ taxes: {
176
+ "امانات ضريبة المبيعات %2": {
177
+ name: "امانات ضريبة المبيعات %2",
178
+ rate: 0.02,
179
+ total: -296,
180
+ type: "additive",
181
+ },
182
+ },
183
+ teams: [],
184
+ time: 1671348150444,
185
+ total: -15120,
186
+ totalDeductedTax: 0,
187
+ totalDeduction: 0,
188
+ totalDeductionBeforeTax: 0,
189
+ total_with_charges: -15120,
190
+ transaction_processed: true,
191
+ updatedAt: "2022-12-18T07:22:34.998Z",
192
+ version: 2,
193
+ }),
194
+ isBase64Encoded: false,
195
+ },
196
+ {
197
+ repzoEndPoint: "",
198
+ serviceEndPoint: "",
199
+ env: "staging",
200
+ data: {
201
+ invoices: {
202
+ createInvoiceHook: false,
203
+ createReturnInvoiceHook: false,
204
+ },
205
+ payments: {
206
+ createPaymentHook: false,
207
+ },
208
+ proformas: {
209
+ createApprovedProformaHook: false,
210
+ },
211
+ transfer: {
212
+ createApprovedTransferHook: false,
213
+ },
214
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
215
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
216
+ errorEmail: "maram.alshen@repzoapp.com",
217
+ serviceApiKey: "awdas",
218
+ warehouseDefaultUpdateDate: "2015-01-01",
219
+ DepartmentCode: "D2",
220
+ return_reason:
221
+ '[{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"}]',
222
+ SalPersCode: "111",
223
+ SalesPersonCode: "111",
224
+ },
225
+ }
226
+ );
@@ -0,0 +1,142 @@
1
+ import { Actions } from "../../index.js";
2
+ Actions(
3
+ {
4
+ version: "2.0",
5
+ routeKey: "POST /actions",
6
+ rawPath: "/actions",
7
+ rawQueryString: "app=repzo-sap-absjo&action=create_transfer",
8
+ headers: {
9
+ action_sync_id: "Actions-0000005", // SYNC_ID
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",
23
+ },
24
+ queryStringParameters: {
25
+ action: "create_transfer",
26
+ app: "repzo-sap-absjo",
27
+ },
28
+ 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,
45
+ },
46
+ body: JSON.stringify({
47
+ __v: 0,
48
+ _id: "639ec8c54183c8b556b44687",
49
+ authorization:
50
+ "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYxZjY2ZWEzYThlZGE1MTQxNDllOGY1ZSIsImVtYWlsIjoid2FsZWVkLm1vaGFtbWFkQHVuaXBhbGd0LmNvbSIsIm5hbWUiOiJXYWxlZWQgTW9oYW1tYWQiLCJ0ZWFtIjpbXSwic2NvcGUiOiJhZG1pbiIsIm5hbWVTcGFjZSI6WyJ1bmlwYWxqbyJdLCJwZXJtYVN0cmluZyI6InZ2djB2b3Z2bzB2dnZvb3Zvb3Z2dm9vb29vb29vb29vbzBvb292dm9vdm92dm9vb29vb3Z2b29vb29vb29vb3ZvdjBvdnZ2dm92b3Z2dm9vb3Zvb3Zvb29vb28wb3Z2dnZ2djAwMDBvMHYwdm9vb29vdm9vdm9vdm92b29vb292b292b3Z2b292b29vb29vb29vb29vb29vb29vb29vb29vb29zb29vb29zb291b29vb291dXV1dXVvb3Zvb28wMG9vb29vMG9vb29vMG9vb29vb29vb29vb29vb29vb29vb29vb29vb3Z2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYiLCJ0aW1lem9uZSI6IkFzaWEvUml5YWRoIiwiYXBwX2NvZGUiOiJyZXB6b19wcm8iLCJjb3VudHJ5X2NvZGUiOlsiSk8iXSwiaWF0IjoxNjcxMzQxMjU1LCJleHAiOjE2NzEzODQ0NTV9.M8tGNeyKGoBDpPJ-7A5_sZvVi4KQSFk64hG_jCgRm5Q",
51
+ business_day: "2022-12-18",
52
+ company_namespace: ["unipaljo"],
53
+ createdAt: "2022-12-18T08:01:09.790Z",
54
+ creator: {
55
+ _id: "6395af32a7fbbe901db1c22f",
56
+ name: "VS Omar Saleh Khalif Al-Kharas",
57
+ type: "rep",
58
+ },
59
+ from: {
60
+ __v: 0,
61
+ _id: "6391cca5ca8b3e4981aa36e5",
62
+ code: "1",
63
+ company_namespace: ["unipaljo"],
64
+ createdAt: "2021-12-27T11:31:13.774Z",
65
+ disabled: false,
66
+ name: "المستودع الرئيسي",
67
+ type: "main",
68
+ updatedAt: "2022-12-18T07:53:25.629Z",
69
+ },
70
+ items_count: 11,
71
+ serial_number: {
72
+ _id: "639ec8c54183c8b556b44688",
73
+ count: 204,
74
+ formatted: "TRN-1018-204",
75
+ identifier: "1018",
76
+ },
77
+ status: "processed",
78
+ sync_id: "76c43919-e414-4e94-af99-eac0fdb323ab",
79
+ teams: ["638c9ce9df9dc77291b1d278"],
80
+ time: 1671350468404,
81
+ to: {
82
+ __v: 0,
83
+ _id: "6391ccb3f3a9fd99bd2d1698",
84
+ code: "VS18",
85
+ company_namespace: ["unipaljo"],
86
+ createdAt: "2021-12-27T11:31:14.803Z",
87
+ disabled: false,
88
+ name: "VS Omar Saleh Khalif Al-Kharas",
89
+ type: "van",
90
+ updatedAt: "2022-12-18T07:53:36.052Z",
91
+ },
92
+ total_items_base_unit_qty: 2249,
93
+ type: "load",
94
+ updatedAt: "2022-12-18T08:37:02.304Z",
95
+ variants: [
96
+ {
97
+ _id: "6398a6c30242db686d4715ec",
98
+ measure_unit_factor: 25,
99
+ measure_unit_id: "63981cc4bee5dd4b6b12f5f4",
100
+ measure_unit_name: "CRTN",
101
+ measure_unit_qty: 5,
102
+ product_id: "6398a6c30242db686d4715ea",
103
+ product_name: "NADEC WHITE FETA CHEESE 200GR",
104
+ qty: 125,
105
+ variant_id: "6398a6c30242db686d4715ec",
106
+ variant_name: "010-NAD-CH0039",
107
+ },
108
+ ],
109
+ }),
110
+ isBase64Encoded: false,
111
+ },
112
+ {
113
+ repzoEndPoint: "",
114
+ serviceEndPoint: "",
115
+ env: "staging",
116
+ data: {
117
+ invoices: {
118
+ createInvoiceHook: false,
119
+ createReturnInvoiceHook: false,
120
+ },
121
+ payments: {
122
+ createPaymentHook: false,
123
+ },
124
+ proformas: {
125
+ createApprovedProformaHook: false,
126
+ },
127
+ transfer: {
128
+ createApprovedTransferHook: false,
129
+ },
130
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
131
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
132
+ errorEmail: "maram.alshen@repzoapp.com",
133
+ serviceApiKey: "awdas",
134
+ warehouseDefaultUpdateDate: "2015-01-01",
135
+ DepartmentCode: "D2",
136
+ return_reason:
137
+ '[{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"}]',
138
+ SalPersCode: "111",
139
+ SalesPersonCode: "111",
140
+ },
141
+ }
142
+ );
@@ -0,0 +1,100 @@
1
+ import { CommandEvent, Result } from "../../types";
2
+ import { Commands } from "../../index.js";
3
+
4
+ let commandEvent: CommandEvent | any = {
5
+ app: {
6
+ _id: "6391a53edb71ef6435719794",
7
+ name: "SAP",
8
+ disabled: false,
9
+ available_app: {
10
+ _id: "6391a268db71ef64357195da",
11
+ name: "repzo-sap-absjo",
12
+ title: "SAP ABS JO",
13
+ logo: "https://www.e2abs.com/wp-content/uploads/2021/03/Website-Main-Logo-1.svg",
14
+ description: "",
15
+ disabled: false,
16
+ JSONSchema: {
17
+ title: "SAP Integration Settings",
18
+ type: "object",
19
+ required: ["repzoApiKey", "sapHostUrl"],
20
+ properties: {
21
+ repzoApiKey: {
22
+ type: "string",
23
+ title: "Repzo API KEY",
24
+ },
25
+ sapHostUrl: {
26
+ type: "string",
27
+ title: "SAP Host Url",
28
+ },
29
+ errorEmail: {
30
+ type: "string",
31
+ format: "email",
32
+ title: "Email in case of error",
33
+ },
34
+ warehouseDefaultUpdateDate: {
35
+ type: "string",
36
+ format: "date",
37
+ title: "Warehouse: Default Update Date",
38
+ },
39
+ },
40
+ },
41
+ options_JSONSchema: {
42
+ title: "SAP Integration Optional Settings",
43
+ type: "object",
44
+ required: [],
45
+ properties: {
46
+ bench_time_warehouse: {
47
+ title: "Bench Time: Warehouse",
48
+ type: "string",
49
+ format: "date",
50
+ },
51
+ },
52
+ },
53
+ app_settings: {
54
+ repo: "",
55
+ serviceEndPoint: "",
56
+ _id: "6391a268db71ef64357195db",
57
+ },
58
+ app_category: "6249fa8466312f76e595634a",
59
+ commands: [
60
+ {
61
+ command: "basic",
62
+ name: "Full Sync",
63
+ description: "",
64
+ _id: "6391a268db71ef64357195dc",
65
+ },
66
+ {
67
+ command: "join",
68
+ name: "Join",
69
+ description: "",
70
+ _id: "6391a268db71ef64357195dd",
71
+ },
72
+ ],
73
+ actions: [],
74
+ createdAt: "2022-12-08T08:38:00.915Z",
75
+ updatedAt: "2022-12-08T09:42:49.236Z",
76
+ __v: 0,
77
+ },
78
+ company_namespace: ["unisap"],
79
+ formData: {
80
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
81
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
82
+ errorEmail: "maram.alshen@repzoapp.com",
83
+ serviceApiKey: "awdas",
84
+ warehouseDefaultUpdateDate: "2015-01-01",
85
+ },
86
+ options_formData: {},
87
+ createdAt: "2022-12-08T08:50:06.903Z",
88
+ updatedAt: "2022-12-08T09:43:21.620Z",
89
+ __v: 0,
90
+ },
91
+ end_of_day: "04:00",
92
+ nameSpace: ["unisap"],
93
+ timezone: "Asia/Amman",
94
+ meta: "",
95
+ env: "staging",
96
+ sync_id: "47c9c804-e136-4d54-928a-000016",
97
+ command: "adjust_inventory",
98
+ };
99
+
100
+ Commands(commandEvent);
@@ -0,0 +1,100 @@
1
+ import { CommandEvent, Result } from "../../types";
2
+ import { Commands } from "../../index.js";
3
+
4
+ let commandEvent: CommandEvent | any = {
5
+ app: {
6
+ _id: "6391a53edb71ef6435719794",
7
+ name: "SAP",
8
+ disabled: false,
9
+ available_app: {
10
+ _id: "6391a268db71ef64357195da",
11
+ name: "repzo-sap-absjo",
12
+ title: "SAP ABS JO",
13
+ logo: "https://www.e2abs.com/wp-content/uploads/2021/03/Website-Main-Logo-1.svg",
14
+ description: "",
15
+ disabled: false,
16
+ JSONSchema: {
17
+ title: "SAP Integration Settings",
18
+ type: "object",
19
+ required: ["repzoApiKey", "sapHostUrl"],
20
+ properties: {
21
+ repzoApiKey: {
22
+ type: "string",
23
+ title: "Repzo API KEY",
24
+ },
25
+ sapHostUrl: {
26
+ type: "string",
27
+ title: "SAP Host Url",
28
+ },
29
+ errorEmail: {
30
+ type: "string",
31
+ format: "email",
32
+ title: "Email in case of error",
33
+ },
34
+ warehouseDefaultUpdateDate: {
35
+ type: "string",
36
+ format: "date",
37
+ title: "Warehouse: Default Update Date",
38
+ },
39
+ },
40
+ },
41
+ options_JSONSchema: {
42
+ title: "SAP Integration Optional Settings",
43
+ type: "object",
44
+ required: [],
45
+ properties: {
46
+ bench_time_warehouse: {
47
+ title: "Bench Time: Warehouse",
48
+ type: "string",
49
+ format: "date",
50
+ },
51
+ },
52
+ },
53
+ app_settings: {
54
+ repo: "",
55
+ serviceEndPoint: "",
56
+ _id: "6391a268db71ef64357195db",
57
+ },
58
+ app_category: "6249fa8466312f76e595634a",
59
+ commands: [
60
+ {
61
+ command: "basic",
62
+ name: "Full Sync",
63
+ description: "",
64
+ _id: "6391a268db71ef64357195dc",
65
+ },
66
+ {
67
+ command: "join",
68
+ name: "Join",
69
+ description: "",
70
+ _id: "6391a268db71ef64357195dd",
71
+ },
72
+ ],
73
+ actions: [],
74
+ createdAt: "2022-12-08T08:38:00.915Z",
75
+ updatedAt: "2022-12-08T09:42:49.236Z",
76
+ __v: 0,
77
+ },
78
+ company_namespace: ["unisap"],
79
+ formData: {
80
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
81
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
82
+ errorEmail: "maram.alshen@repzoapp.com",
83
+ serviceApiKey: "awdas",
84
+ warehouseDefaultUpdateDate: "2015-01-01",
85
+ },
86
+ options_formData: {},
87
+ createdAt: "2022-12-08T08:50:06.903Z",
88
+ updatedAt: "2022-12-08T09:43:21.620Z",
89
+ __v: 0,
90
+ },
91
+ end_of_day: "04:00",
92
+ nameSpace: ["unisap"],
93
+ timezone: "Asia/Amman",
94
+ meta: "",
95
+ env: "staging",
96
+ sync_id: "47c9c804-e136-4d54-928a-000009",
97
+ command: "bank",
98
+ };
99
+
100
+ Commands(commandEvent);