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,215 +1,210 @@
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_invoice",
8
7
  headers: {
9
- action_sync_id: "Actions-0000001",
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-0000001",
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_invoice",
26
- app: "repzo-sap-absjo",
24
+ action: "create_invoice",
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
- __v: 0,
48
- _id: "639eaf634428fb70bdc0f1cd",
49
- authorization:
50
- "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lem9uZSI6IkFzaWEvUml5YWRoIiwidXNlcm5hbWUiOiJ1bmlwYWxqbzIwNCIsIm5hbWUiOiJWUyBBeWVzaCBJYnJhaGltICBBbGxib29uIiwic2NvcGUiOiJyZXAiLCJuYW1lU3BhY2UiOlsidW5pcGFsam8iXSwidGVhbSI6WyI2MzhjOWNlOWRmOWRjNzcyOTFiMWQyNzgiXSwiaWRlbnRpZmllciI6MTE2NSwiaWQiOiI2MzZhNWY3ZjYyNmJiOTU5Mzc1NzM1NWQiLCJhcHBfY29kZSI6InJlcHpvX3BybyIsImNvdW50cnlfY29kZSI6WyJKTyJdLCJwZXJtYVN0cmluZyI6InZ2djB2dnZ2djB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYwdnZ2dnZ2djAwMDB2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHZ2dnZ2MHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYiLCJpYXQiOjE2NzEzMzg2NzksImV4cCI6MTY3MTM4MTg3OX0.E2H5w7-idnhtU5bGNcdo5_8E94z5TUdzTqXXNCEr7oA",
51
- business_day: "2022-12-18",
52
- client_id: "639ad007506dfca71556d892",
53
- client_name: "الاصدقاء - الظليل",
54
- comment: "",
55
- company_namespace: ["unisap"],
56
- createdAt: "2022-12-18T06:13:24.425Z",
57
- creator: {
58
- _id: "6395afcaa7fbbe901db1c5d9",
59
- name: "VS Ayesh Ibrahim Allboon",
60
- rep: "6395afcaa7fbbe901db1c5d9",
61
- type: "rep",
62
- },
63
- currency: "JOD",
64
- deductionFixed: 0,
65
- deductionRatio: 0,
66
- delivery_date: null,
67
- discount_amount: 0,
68
- due_date: "2022-12-18",
69
- is_void: false,
70
- issue_date: "2022-12-18",
71
- items: [
72
- {
73
- _id: "639eaf84c843d331be3658c2",
74
- applicable_promotions: [],
75
- base_unit_qty: 4,
76
- class: "invoice",
77
- company_namespace: [],
78
- deductedTax: 0,
79
- deduction: 0,
80
- deductionBeforeTax: 0,
81
- deductionRatio: 0,
82
- discount_value: 0,
83
- discounted_price: 4210,
84
- general_promotions: [],
85
- gross_value: 4884,
86
- isAdditional: false,
87
- lineTotalAfterDeduction: 19534,
88
- line_total: 19534,
89
- line_total_without_modifiers: 19534,
90
- measureunit: {
91
- _id: "63981ca3bee5dd4b6b12e8c6",
92
- company_namespace: [],
93
- disabled: false,
94
- factor: 1,
95
- name: "PC",
96
- parent: "63981c32e9f3eafb51d7f0af",
97
- },
98
- modifiers_groups: [],
99
- modifiers_tax_total: 0,
100
- modifiers_total: 0,
101
- modifiers_total_before_tax: 0,
102
- note: "",
103
- overwritePrice: null,
104
- price: 4210,
105
- qty: 4,
106
- tax: {
107
- _id: "639715d5edafde008aefe936",
108
- disabled: false,
109
- name: "امانات ضريبة المبيعات 16%",
110
- rate: 0.16,
111
- type: "additive",
112
- },
113
- tax_amount: 674,
114
- tax_total: 2694,
115
- tax_total_without_modifiers: 2694,
116
- total_before_tax: 16840,
117
- total_before_tax_without_modifiers: 16840,
118
- used_promotions: [],
119
- variant: {
120
- _id: "6398a6ade8a1cfdd26dc66fe",
121
- listed_price: 0,
122
- product_id: "6398a6ade8a1cfdd26dc66fc",
123
- product_name: "BREITSAMER HONEY GOLDEN 500GR",
124
- variant_id: "6398a6ade8a1cfdd26dc66fe",
125
- variant_name: "010-BRE-HO0008",
126
- },
46
+ __v: 0,
47
+ _id: "639eaf634428fb70bdc0f1cd",
48
+ authorization: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0aW1lem9uZSI6IkFzaWEvUml5YWRoIiwidXNlcm5hbWUiOiJ1bmlwYWxqbzIwNCIsIm5hbWUiOiJWUyBBeWVzaCBJYnJhaGltICBBbGxib29uIiwic2NvcGUiOiJyZXAiLCJuYW1lU3BhY2UiOlsidW5pcGFsam8iXSwidGVhbSI6WyI2MzhjOWNlOWRmOWRjNzcyOTFiMWQyNzgiXSwiaWRlbnRpZmllciI6MTE2NSwiaWQiOiI2MzZhNWY3ZjYyNmJiOTU5Mzc1NzM1NWQiLCJhcHBfY29kZSI6InJlcHpvX3BybyIsImNvdW50cnlfY29kZSI6WyJKTyJdLCJwZXJtYVN0cmluZyI6InZ2djB2dnZ2djB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYwdnZ2dnZ2djAwMDB2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHZ2dnZ2MHZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2MHYwdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnYiLCJpYXQiOjE2NzEzMzg2NzksImV4cCI6MTY3MTM4MTg3OX0.E2H5w7-idnhtU5bGNcdo5_8E94z5TUdzTqXXNCEr7oA",
49
+ business_day: "2022-12-18",
50
+ client_id: "639ad007506dfca71556d892",
51
+ client_name: "الاصدقاء - الظليل",
52
+ comment: "",
53
+ company_namespace: ["unisap"],
54
+ createdAt: "2022-12-18T06:13:24.425Z",
55
+ creator: {
56
+ _id: "6395afcaa7fbbe901db1c5d9",
57
+ name: "VS Ayesh Ibrahim Allboon",
58
+ rep: "6395afcaa7fbbe901db1c5d9",
59
+ type: "rep",
60
+ },
61
+ currency: "JOD",
62
+ deductionFixed: 0,
63
+ deductionRatio: 0,
64
+ delivery_date: null,
65
+ discount_amount: 0,
66
+ due_date: "2022-12-18",
67
+ is_void: false,
68
+ issue_date: "2022-12-18",
69
+ items: [
70
+ {
71
+ _id: "639eaf84c843d331be3658c2",
72
+ applicable_promotions: [],
73
+ base_unit_qty: 4,
74
+ class: "invoice",
75
+ company_namespace: [],
76
+ deductedTax: 0,
77
+ deduction: 0,
78
+ deductionBeforeTax: 0,
79
+ deductionRatio: 0,
80
+ discount_value: 0,
81
+ discounted_price: 4210,
82
+ general_promotions: [],
83
+ gross_value: 4884,
84
+ isAdditional: false,
85
+ lineTotalAfterDeduction: 19534,
86
+ line_total: 19534,
87
+ line_total_without_modifiers: 19534,
88
+ measureunit: {
89
+ _id: "63981ca3bee5dd4b6b12e8c6",
90
+ company_namespace: [],
91
+ disabled: false,
92
+ factor: 1,
93
+ name: "PC",
94
+ parent: "63981c32e9f3eafb51d7f0af",
95
+ },
96
+ modifiers_groups: [],
97
+ modifiers_tax_total: 0,
98
+ modifiers_total: 0,
99
+ modifiers_total_before_tax: 0,
100
+ note: "",
101
+ overwritePrice: null,
102
+ price: 4210,
103
+ qty: 4,
104
+ tax: {
105
+ _id: "639715d5edafde008aefe936",
106
+ disabled: false,
107
+ name: "امانات ضريبة المبيعات 16%",
108
+ rate: 0.16,
109
+ type: "additive",
110
+ },
111
+ tax_amount: 674,
112
+ tax_total: 2694,
113
+ tax_total_without_modifiers: 2694,
114
+ total_before_tax: 16840,
115
+ total_before_tax_without_modifiers: 16840,
116
+ used_promotions: [],
117
+ variant: {
118
+ _id: "6398a6ade8a1cfdd26dc66fe",
119
+ listed_price: 0,
120
+ product_id: "6398a6ade8a1cfdd26dc66fc",
121
+ product_name: "BREITSAMER HONEY GOLDEN 500GR",
122
+ variant_id: "6398a6ade8a1cfdd26dc66fe",
123
+ variant_name: "010-BRE-HO0008",
124
+ },
125
+ },
126
+ ],
127
+ latest: true,
128
+ origin_warehouse: "6391cce3f3a9fd99bd2d17e4",
129
+ overwriteTaxExempt: false,
130
+ pre_discount_amount: 0,
131
+ pre_subtotal: 16840,
132
+ pre_tax_amount: 2694,
133
+ pre_taxable_subtotal: 16840,
134
+ pre_total: 19534,
135
+ processable: true,
136
+ promotions: [],
137
+ return_discount_amount: 0,
138
+ return_items: [],
139
+ return_subtotal: 0,
140
+ return_tax_amount: 0,
141
+ return_taxable_subtotal: 0,
142
+ return_total: 0,
143
+ route: null,
144
+ serial_number: {
145
+ _id: "639eaf84c843d331be3658bd",
146
+ count: 80,
147
+ formatted: "INV-1165-80",
148
+ identifier: "1165",
127
149
  },
128
- ],
129
- latest: true,
130
- origin_warehouse: "6391cce3f3a9fd99bd2d17e4",
131
- overwriteTaxExempt: false,
132
- pre_discount_amount: 0,
133
- pre_subtotal: 16840,
134
- pre_tax_amount: 2694,
135
- pre_taxable_subtotal: 16840,
136
- pre_total: 19534,
137
- processable: true,
138
- promotions: [],
139
- return_discount_amount: 0,
140
- return_items: [],
141
- return_subtotal: 0,
142
- return_tax_amount: 0,
143
- return_taxable_subtotal: 0,
144
- return_total: 0,
145
- route: null,
146
- serial_number: {
147
- _id: "639eaf84c843d331be3658bd",
148
- count: 80,
149
- formatted: "INV-1165-80",
150
- identifier: "1165",
151
- },
152
- shipping_charge: 0,
153
- shipping_price: 0,
154
- shipping_tax: 0,
155
- signature: null,
156
- status: "paid",
157
- subtotal: 16840,
158
- sync_id: "948ff1f9-b654-4a87-8858-9d11cb353de4",
159
- tax_amount: 2694,
160
- tax_exempt: false,
161
- taxable_subtotal: 16840,
162
- taxes: {
163
- "امانات ضريبة المبيعات 16%": {
164
- name: "امانات ضريبة المبيعات 16%",
165
- rate: 0.16,
166
- total: 2694,
167
- type: "additive",
150
+ shipping_charge: 0,
151
+ shipping_price: 0,
152
+ shipping_tax: 0,
153
+ signature: null,
154
+ status: "paid",
155
+ subtotal: 16840,
156
+ sync_id: "948ff1f9-b654-4a87-8858-9d11cb353de4",
157
+ tax_amount: 2694,
158
+ tax_exempt: false,
159
+ taxable_subtotal: 16840,
160
+ taxes: {
161
+ "امانات ضريبة المبيعات 16%": {
162
+ name: "امانات ضريبة المبيعات 16%",
163
+ rate: 0.16,
164
+ total: 2694,
165
+ type: "additive",
166
+ },
168
167
  },
169
- },
170
- teams: ["638c9ce9df9dc77291b1d278"],
171
- time: 1671343991648,
172
- total: 19534,
173
- totalDeductedTax: 0,
174
- totalDeduction: 0,
175
- totalDeductionBeforeTax: 0,
176
- total_with_charges: 19534,
177
- transaction_processed: true,
178
- updatedAt: "2022-12-18T06:13:29.951Z",
179
- version: 2,
180
- visit_id: "15c245fa-3767-4efa-ae63-f5ee962b699d",
168
+ teams: ["638c9ce9df9dc77291b1d278"],
169
+ time: 1671343991648,
170
+ total: 19534,
171
+ totalDeductedTax: 0,
172
+ totalDeduction: 0,
173
+ totalDeductionBeforeTax: 0,
174
+ total_with_charges: 19534,
175
+ transaction_processed: true,
176
+ updatedAt: "2022-12-18T06:13:29.951Z",
177
+ version: 2,
178
+ visit_id: "15c245fa-3767-4efa-ae63-f5ee962b699d",
181
179
  }),
182
180
  isBase64Encoded: false,
183
- },
184
- {
181
+ }, {
185
182
  app_id: "",
186
183
  repzoEndPoint: "",
187
184
  serviceEndPoint: "",
188
185
  env: "staging",
189
186
  data: {
190
- invoices: {
191
- createInvoiceHook: false,
192
- createReturnInvoiceHook: false,
193
- },
194
- payments: {
195
- createPaymentHook: false,
196
- },
197
- proformas: {
198
- createApprovedProformaHook: false,
199
- },
200
- transfer: {
201
- createApprovedTransferHook: false,
202
- },
203
- repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
204
- sapHostUrl: "http://unipal.b1pro.com:8083/api",
205
- errorEmail: "maram.alshen@repzoapp.com",
206
- serviceApiKey: "awdas",
207
- warehouseDefaultUpdateDate: "2015-01-01",
208
- DepartmentCode: "D2",
209
- return_reason:
210
- '[{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"}]',
211
- SalPersCode: "111",
212
- SalesPersonCode: "111",
187
+ invoices: {
188
+ createInvoiceHook: false,
189
+ createReturnInvoiceHook: false,
190
+ },
191
+ payments: {
192
+ createPaymentHook: false,
193
+ },
194
+ proformas: {
195
+ createApprovedProformaHook: false,
196
+ },
197
+ transfer: {
198
+ createApprovedTransferHook: false,
199
+ },
200
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
201
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
202
+ errorEmail: "maram.alshen@repzoapp.com",
203
+ serviceApiKey: "awdas",
204
+ warehouseDefaultUpdateDate: "2015-01-01",
205
+ DepartmentCode: "D2",
206
+ 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"}]',
207
+ SalPersCode: "111",
208
+ SalesPersonCode: "111",
213
209
  },
214
- }
215
- );
210
+ });
@@ -1,132 +1,127 @@
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_payment",
8
7
  headers: {
9
- action_sync_id: "Actions-0000004",
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-0000004",
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_payment",
26
- app: "repzo-sap-absjo",
24
+ action: "create_payment",
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: "639da8a8298f9ea4d6d543dd",
48
- status: "unconsumed",
49
- remainder: 3651631,
50
- amount: 3651631,
51
- client_id: "639adef7b4dc172fc503645e",
52
- client_name: "ماي ماركت _ مسكه لتجارة المواد الغذائية",
53
- creator: {
54
- _id: "6395af44a7fbbe901db1c2aa",
55
- type: "rep",
56
- name: "RET MUSTAFA MOHAMMAD RASHEED ABDALLAH",
57
- },
58
- time: 1671276710322,
59
- serial_number: {
60
- identifier: "1036",
61
- formatted: "PAY-1036-362",
62
- count: 362,
63
- _id: "639da8a8298f9ea4d6d543de",
64
- },
65
- route: null,
66
- paytime: "2022-12-17",
67
- note: "",
68
- currency: "JOD",
69
- payment_type: "check",
70
- check: {
71
- drawer_name: "شركة مسكة لتجارة المواد الغذائيه ",
72
- bank: "639863e6333b84929c539077",
73
- bank_branch: "دابوق ",
74
- check_number: 11322,
75
- check_date: "2022-12-17",
76
- photo:
77
- "https://repzo-media-service.s3.eu-west-2.amazonaws.com/unisap/image/2022/12/17/f7027375-8e21-4b0d-baff-15bc7e642803.jpeg",
78
- media: [],
79
- caption: null,
80
- disabled: false,
81
- _id: "639da8a8298f9ea4d6d543df",
82
- },
83
- company_namespace: ["unisap"],
84
- sync_id: "0109372a-8479-44ba-b519-5f1041afca8e",
85
- teams: [],
86
- paymentsData: {
87
- amount: -3651631,
88
- paid: 0,
89
- balance: -3651631,
90
- payments: [],
91
- _id: "639da8a8298f9ea4d6d543e0",
92
- },
93
- reference: "",
94
- createdAt: "2022-12-17T11:31:52.069Z",
95
- updatedAt: "2022-12-17T11:31:52.069Z",
96
- __v: 0,
97
- balance_to_refund: 3651631,
46
+ _id: "639da8a8298f9ea4d6d543dd",
47
+ status: "unconsumed",
48
+ remainder: 3651631,
49
+ amount: 3651631,
50
+ client_id: "639adef7b4dc172fc503645e",
51
+ client_name: "ماي ماركت _ مسكه لتجارة المواد الغذائية",
52
+ creator: {
53
+ _id: "6395af44a7fbbe901db1c2aa",
54
+ type: "rep",
55
+ name: "RET MUSTAFA MOHAMMAD RASHEED ABDALLAH",
56
+ },
57
+ time: 1671276710322,
58
+ serial_number: {
59
+ identifier: "1036",
60
+ formatted: "PAY-1036-362",
61
+ count: 362,
62
+ _id: "639da8a8298f9ea4d6d543de",
63
+ },
64
+ route: null,
65
+ paytime: "2022-12-17",
66
+ note: "",
67
+ currency: "JOD",
68
+ payment_type: "check",
69
+ check: {
70
+ drawer_name: "شركة مسكة لتجارة المواد الغذائيه ",
71
+ bank: "639863e6333b84929c539077",
72
+ bank_branch: "دابوق ",
73
+ check_number: 11322,
74
+ check_date: "2022-12-17",
75
+ photo: "https://repzo-media-service.s3.eu-west-2.amazonaws.com/unisap/image/2022/12/17/f7027375-8e21-4b0d-baff-15bc7e642803.jpeg",
76
+ media: [],
77
+ caption: null,
78
+ disabled: false,
79
+ _id: "639da8a8298f9ea4d6d543df",
80
+ },
81
+ company_namespace: ["unisap"],
82
+ sync_id: "0109372a-8479-44ba-b519-5f1041afca8e",
83
+ teams: [],
84
+ paymentsData: {
85
+ amount: -3651631,
86
+ paid: 0,
87
+ balance: -3651631,
88
+ payments: [],
89
+ _id: "639da8a8298f9ea4d6d543e0",
90
+ },
91
+ reference: "",
92
+ createdAt: "2022-12-17T11:31:52.069Z",
93
+ updatedAt: "2022-12-17T11:31:52.069Z",
94
+ __v: 0,
95
+ balance_to_refund: 3651631,
98
96
  }),
99
97
  isBase64Encoded: false,
100
- },
101
- {
98
+ }, {
102
99
  app_id: "",
103
100
  repzoEndPoint: "",
104
101
  serviceEndPoint: "",
105
102
  env: "staging",
106
103
  data: {
107
- invoices: {
108
- createInvoiceHook: false,
109
- createReturnInvoiceHook: false,
110
- },
111
- payments: {
112
- createPaymentHook: false,
113
- },
114
- proformas: {
115
- createApprovedProformaHook: false,
116
- },
117
- transfer: {
118
- createApprovedTransferHook: false,
119
- },
120
- repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
121
- sapHostUrl: "http://unipal.b1pro.com:8083/api",
122
- errorEmail: "maram.alshen@repzoapp.com",
123
- serviceApiKey: "awdas",
124
- warehouseDefaultUpdateDate: "2015-01-01",
125
- DepartmentCode: "D2",
126
- return_reason:
127
- '[{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"}]',
128
- SalPersCode: "111",
129
- SalesPersonCode: "111",
104
+ invoices: {
105
+ createInvoiceHook: false,
106
+ createReturnInvoiceHook: false,
107
+ },
108
+ payments: {
109
+ createPaymentHook: false,
110
+ },
111
+ proformas: {
112
+ createApprovedProformaHook: false,
113
+ },
114
+ transfer: {
115
+ createApprovedTransferHook: false,
116
+ },
117
+ repzoApiKey: "L98_Pc8qZG2R5hZIIMjxLQNUgUzT3_0aX2BuLvkyh74",
118
+ sapHostUrl: "http://unipal.b1pro.com:8083/api",
119
+ errorEmail: "maram.alshen@repzoapp.com",
120
+ serviceApiKey: "awdas",
121
+ warehouseDefaultUpdateDate: "2015-01-01",
122
+ DepartmentCode: "D2",
123
+ 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"}]',
124
+ SalPersCode: "111",
125
+ SalesPersonCode: "111",
130
126
  },
131
- }
132
- );
127
+ });