@apideck/unify 0.23.0 → 0.23.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.
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/note.d.ts +5 -0
- package/models/components/note.d.ts.map +1 -1
- package/models/components/note.js +4 -0
- package/models/components/note.js.map +1 -1
- package/models/components/noteinput.d.ts +5 -0
- package/models/components/noteinput.d.ts.map +1 -1
- package/models/components/noteinput.js +4 -0
- package/models/components/noteinput.js.map +1 -1
- package/package.json +5 -1
- package/src/__tests__/activities.test.ts +783 -0
- package/src/__tests__/agedcreditors.test.ts +279 -0
- package/src/__tests__/ageddebtors.test.ts +279 -0
- package/src/__tests__/apideckcompanies.test.ts +712 -0
- package/src/__tests__/apideckcustomers.test.ts +360 -0
- package/src/__tests__/apideckdepartments.test.ts +319 -0
- package/src/__tests__/apiresources.test.ts +61 -0
- package/src/__tests__/apis.test.ts +214 -0
- package/src/__tests__/applicants.test.ts +976 -0
- package/src/__tests__/applications.test.ts +329 -0
- package/src/__tests__/assertions.ts +13 -0
- package/src/__tests__/attachments.test.ts +363 -0
- package/src/__tests__/balancesheet.test.ts +451 -0
- package/src/__tests__/billpayments.test.ts +666 -0
- package/src/__tests__/bills.test.ts +1133 -0
- package/src/__tests__/collections.test.ts +115 -0
- package/src/__tests__/collectiontags.test.ts +66 -0
- package/src/__tests__/collectionticketcomments.test.ts +318 -0
- package/src/__tests__/collectiontickets.test.ts +436 -0
- package/src/__tests__/collectionusers.test.ts +122 -0
- package/src/__tests__/companies.test.ts +1059 -0
- package/src/__tests__/companyinfo.test.ts +218 -0
- package/src/__tests__/connectioncustommappings.test.ts +67 -0
- package/src/__tests__/connections.test.ts +1713 -0
- package/src/__tests__/connectionsettings.test.ts +280 -0
- package/src/__tests__/connectordocs.test.ts +28 -0
- package/src/__tests__/connectors.test.ts +751 -0
- package/src/__tests__/consumerrequestcounts.test.ts +41 -0
- package/src/__tests__/consumers.test.ts +517 -0
- package/src/__tests__/contacts.test.ts +957 -0
- package/src/__tests__/createcallback.test.ts +34 -0
- package/src/__tests__/creditnotes.test.ts +1362 -0
- package/src/__tests__/customers.test.ts +1089 -0
- package/src/__tests__/customfields.test.ts +50 -0
- package/src/__tests__/custommappings.test.ts +63 -0
- package/src/__tests__/departments.test.ts +359 -0
- package/src/__tests__/drivegroups.test.ts +318 -0
- package/src/__tests__/drives.test.ts +311 -0
- package/src/__tests__/employeepayrolls.test.ts +487 -0
- package/src/__tests__/employees.test.ts +1682 -0
- package/src/__tests__/employeeschedules.test.ts +456 -0
- package/src/__tests__/eventlogs.test.ts +157 -0
- package/src/__tests__/expenses.test.ts +566 -0
- package/src/__tests__/files.test.ts +392 -0
- package/src/__tests__/files.ts +56 -0
- package/src/__tests__/folders.test.ts +103 -0
- package/src/__tests__/invoiceitems.test.ts +586 -0
- package/src/__tests__/invoices.test.ts +1561 -0
- package/src/__tests__/jobs.test.ts +837 -0
- package/src/__tests__/journalentries.test.ts +1053 -0
- package/src/__tests__/leads.test.ts +897 -0
- package/src/__tests__/ledgeraccounts.test.ts +594 -0
- package/src/__tests__/locations.test.ts +561 -0
- package/src/__tests__/logs.test.ts +135 -0
- package/src/__tests__/messages.test.ts +396 -0
- package/src/__tests__/mockserver/README.md +52 -0
- package/src/__tests__/notes.test.ts +335 -0
- package/src/__tests__/opportunities.test.ts +503 -0
- package/src/__tests__/orders.test.ts +849 -0
- package/src/__tests__/payments.test.ts +557 -0
- package/src/__tests__/payrolls.test.ts +481 -0
- package/src/__tests__/pipelines.test.ts +383 -0
- package/src/__tests__/products.test.ts +505 -0
- package/src/__tests__/profitandloss.test.ts +221 -0
- package/src/__tests__/purchaseorders.test.ts +1464 -0
- package/src/__tests__/sessions.test.ts +70 -0
- package/src/__tests__/sharedlinks.test.ts +331 -0
- package/src/__tests__/stores.test.ts +39 -0
- package/src/__tests__/subsidiaries.test.ts +316 -0
- package/src/__tests__/suppliers.test.ts +1071 -0
- package/src/__tests__/taxrates.test.ts +472 -0
- package/src/__tests__/testclient.ts +48 -0
- package/src/__tests__/timeoffrequests.test.ts +381 -0
- package/src/__tests__/trackingcategories.test.ts +329 -0
- package/src/__tests__/uploadsessions.test.ts +142 -0
- package/src/__tests__/users.test.ts +667 -0
- package/src/__tests__/validateconnection.test.ts +32 -0
- package/src/__tests__/webhooks.test.ts +248 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/note.ts +9 -0
- package/src/models/components/noteinput.ts +9 -0
|
@@ -0,0 +1,557 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { assert, expect, it, test } from "vitest";
|
|
6
|
+
import { Apideck } from "../index.js";
|
|
7
|
+
import { createTestHTTPClient } from "./testclient.js";
|
|
8
|
+
|
|
9
|
+
test("Payments Accounting Payments All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("accounting.paymentsAll");
|
|
11
|
+
|
|
12
|
+
const apideck = new Apideck({
|
|
13
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
14
|
+
httpClient: testHttpClient,
|
|
15
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const result = await apideck.accounting.payments.list({
|
|
19
|
+
serviceId: "salesforce",
|
|
20
|
+
filter: {
|
|
21
|
+
updatedSince: new Date("2020-09-30T07:43:32.000Z"),
|
|
22
|
+
},
|
|
23
|
+
sort: {
|
|
24
|
+
by: "updated_at",
|
|
25
|
+
},
|
|
26
|
+
passThrough: {
|
|
27
|
+
"search": "San Francisco",
|
|
28
|
+
},
|
|
29
|
+
fields: "id,updated_at",
|
|
30
|
+
});
|
|
31
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
32
|
+
expect(result.getPaymentsResponse).toBeDefined();
|
|
33
|
+
expect(result.getPaymentsResponse).toEqual({
|
|
34
|
+
statusCode: 200,
|
|
35
|
+
status: "OK",
|
|
36
|
+
service: "xero",
|
|
37
|
+
resource: "payments",
|
|
38
|
+
operation: "all",
|
|
39
|
+
data: [
|
|
40
|
+
{
|
|
41
|
+
id: "12345",
|
|
42
|
+
downstreamId: "12345",
|
|
43
|
+
currency: "USD",
|
|
44
|
+
currencyRate: 0.69,
|
|
45
|
+
totalAmount: 49.99,
|
|
46
|
+
reference: "123456",
|
|
47
|
+
paymentMethod: "cash",
|
|
48
|
+
paymentMethodReference: "123456",
|
|
49
|
+
paymentMethodId: "12345",
|
|
50
|
+
account: {
|
|
51
|
+
id: "123456",
|
|
52
|
+
name: "Bank account",
|
|
53
|
+
nominalCode: "N091",
|
|
54
|
+
code: "453",
|
|
55
|
+
},
|
|
56
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
57
|
+
customer: {
|
|
58
|
+
id: "12345",
|
|
59
|
+
displayId: "CUST00101",
|
|
60
|
+
displayName: "Windsurf Shop",
|
|
61
|
+
companyName: "The boring company",
|
|
62
|
+
email: "boring@boring.com",
|
|
63
|
+
},
|
|
64
|
+
companyId: "12345",
|
|
65
|
+
reconciled: true,
|
|
66
|
+
status: "authorised",
|
|
67
|
+
type: "accounts_receivable",
|
|
68
|
+
allocations: [
|
|
69
|
+
{
|
|
70
|
+
id: "123456",
|
|
71
|
+
code: "N091",
|
|
72
|
+
amount: 49.99,
|
|
73
|
+
allocationId: "123456",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "123456",
|
|
77
|
+
code: "N091",
|
|
78
|
+
amount: 49.99,
|
|
79
|
+
allocationId: "123456",
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
note: "Some notes about this transaction",
|
|
83
|
+
number: "123456",
|
|
84
|
+
trackingCategories: [
|
|
85
|
+
{
|
|
86
|
+
id: "123456",
|
|
87
|
+
name: "New York",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "123456",
|
|
91
|
+
name: "New York",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
id: "123456",
|
|
95
|
+
name: "New York",
|
|
96
|
+
},
|
|
97
|
+
],
|
|
98
|
+
customFields: [
|
|
99
|
+
{
|
|
100
|
+
id: "2389328923893298",
|
|
101
|
+
name: "employee_level",
|
|
102
|
+
description: "Employee Level",
|
|
103
|
+
value: 10,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
rowVersion: "1-12345",
|
|
107
|
+
displayId: "123456",
|
|
108
|
+
updatedBy: "12345",
|
|
109
|
+
createdBy: "12345",
|
|
110
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
111
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
112
|
+
passThrough: [
|
|
113
|
+
{
|
|
114
|
+
serviceId: "<id>",
|
|
115
|
+
extendPaths: [
|
|
116
|
+
{
|
|
117
|
+
path: "$.nested.property",
|
|
118
|
+
value: {
|
|
119
|
+
"TaxClassificationRef": {
|
|
120
|
+
"value": "EUC-99990201-V1-00020000",
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
path: "$.nested.property",
|
|
126
|
+
value: {
|
|
127
|
+
"TaxClassificationRef": {
|
|
128
|
+
"value": "EUC-99990201-V1-00020000",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "12345",
|
|
138
|
+
downstreamId: "12345",
|
|
139
|
+
currency: "USD",
|
|
140
|
+
currencyRate: 0.69,
|
|
141
|
+
totalAmount: 49.99,
|
|
142
|
+
reference: "123456",
|
|
143
|
+
paymentMethod: "cash",
|
|
144
|
+
paymentMethodReference: "123456",
|
|
145
|
+
paymentMethodId: "12345",
|
|
146
|
+
account: {
|
|
147
|
+
id: "123456",
|
|
148
|
+
name: "Bank account",
|
|
149
|
+
nominalCode: "N091",
|
|
150
|
+
code: "453",
|
|
151
|
+
},
|
|
152
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
153
|
+
customer: {
|
|
154
|
+
id: "12345",
|
|
155
|
+
displayId: "CUST00101",
|
|
156
|
+
displayName: "Windsurf Shop",
|
|
157
|
+
companyName: "The boring company",
|
|
158
|
+
email: "boring@boring.com",
|
|
159
|
+
},
|
|
160
|
+
companyId: "12345",
|
|
161
|
+
reconciled: true,
|
|
162
|
+
status: "authorised",
|
|
163
|
+
type: "accounts_receivable",
|
|
164
|
+
allocations: [
|
|
165
|
+
{
|
|
166
|
+
id: "123456",
|
|
167
|
+
code: "N091",
|
|
168
|
+
amount: 49.99,
|
|
169
|
+
allocationId: "123456",
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
id: "123456",
|
|
173
|
+
code: "N091",
|
|
174
|
+
amount: 49.99,
|
|
175
|
+
allocationId: "123456",
|
|
176
|
+
},
|
|
177
|
+
],
|
|
178
|
+
note: "Some notes about this transaction",
|
|
179
|
+
number: "123456",
|
|
180
|
+
trackingCategories: [
|
|
181
|
+
{
|
|
182
|
+
id: "123456",
|
|
183
|
+
name: "New York",
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
customFields: [
|
|
187
|
+
{
|
|
188
|
+
id: "2389328923893298",
|
|
189
|
+
name: "employee_level",
|
|
190
|
+
description: "Employee Level",
|
|
191
|
+
value: "Uses Salesforce and Marketo",
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
id: "2389328923893298",
|
|
195
|
+
name: "employee_level",
|
|
196
|
+
description: "Employee Level",
|
|
197
|
+
value: "Uses Salesforce and Marketo",
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
id: "2389328923893298",
|
|
201
|
+
name: "employee_level",
|
|
202
|
+
description: "Employee Level",
|
|
203
|
+
value: [
|
|
204
|
+
"<value>",
|
|
205
|
+
"<value>",
|
|
206
|
+
],
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
rowVersion: "1-12345",
|
|
210
|
+
displayId: "123456",
|
|
211
|
+
updatedBy: "12345",
|
|
212
|
+
createdBy: "12345",
|
|
213
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
214
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
215
|
+
passThrough: [
|
|
216
|
+
{
|
|
217
|
+
serviceId: "<id>",
|
|
218
|
+
extendPaths: [
|
|
219
|
+
{
|
|
220
|
+
path: "$.nested.property",
|
|
221
|
+
value: {
|
|
222
|
+
"TaxClassificationRef": {
|
|
223
|
+
"value": "EUC-99990201-V1-00020000",
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
serviceId: "<id>",
|
|
231
|
+
extendPaths: [
|
|
232
|
+
{
|
|
233
|
+
path: "$.nested.property",
|
|
234
|
+
value: {
|
|
235
|
+
"TaxClassificationRef": {
|
|
236
|
+
"value": "EUC-99990201-V1-00020000",
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
],
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "12345",
|
|
246
|
+
downstreamId: "12345",
|
|
247
|
+
currency: "USD",
|
|
248
|
+
currencyRate: 0.69,
|
|
249
|
+
totalAmount: 49.99,
|
|
250
|
+
reference: "123456",
|
|
251
|
+
paymentMethod: "cash",
|
|
252
|
+
paymentMethodReference: "123456",
|
|
253
|
+
paymentMethodId: "12345",
|
|
254
|
+
account: {
|
|
255
|
+
id: "123456",
|
|
256
|
+
name: "Bank account",
|
|
257
|
+
nominalCode: "N091",
|
|
258
|
+
code: "453",
|
|
259
|
+
},
|
|
260
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
261
|
+
customer: {
|
|
262
|
+
id: "12345",
|
|
263
|
+
displayId: "CUST00101",
|
|
264
|
+
displayName: "Windsurf Shop",
|
|
265
|
+
companyName: "The boring company",
|
|
266
|
+
email: "boring@boring.com",
|
|
267
|
+
},
|
|
268
|
+
companyId: "12345",
|
|
269
|
+
reconciled: true,
|
|
270
|
+
status: "authorised",
|
|
271
|
+
type: "accounts_receivable",
|
|
272
|
+
allocations: [
|
|
273
|
+
{
|
|
274
|
+
id: "123456",
|
|
275
|
+
code: "N091",
|
|
276
|
+
amount: 49.99,
|
|
277
|
+
allocationId: "123456",
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
id: "123456",
|
|
281
|
+
code: "N091",
|
|
282
|
+
amount: 49.99,
|
|
283
|
+
allocationId: "123456",
|
|
284
|
+
},
|
|
285
|
+
],
|
|
286
|
+
note: "Some notes about this transaction",
|
|
287
|
+
number: "123456",
|
|
288
|
+
trackingCategories: [
|
|
289
|
+
{
|
|
290
|
+
id: "123456",
|
|
291
|
+
name: "New York",
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
id: "123456",
|
|
295
|
+
name: "New York",
|
|
296
|
+
},
|
|
297
|
+
],
|
|
298
|
+
customFields: [
|
|
299
|
+
{
|
|
300
|
+
id: "2389328923893298",
|
|
301
|
+
name: "employee_level",
|
|
302
|
+
description: "Employee Level",
|
|
303
|
+
value: [
|
|
304
|
+
{},
|
|
305
|
+
{},
|
|
306
|
+
],
|
|
307
|
+
},
|
|
308
|
+
],
|
|
309
|
+
rowVersion: "1-12345",
|
|
310
|
+
displayId: "123456",
|
|
311
|
+
updatedBy: "12345",
|
|
312
|
+
createdBy: "12345",
|
|
313
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
314
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
315
|
+
passThrough: [
|
|
316
|
+
{
|
|
317
|
+
serviceId: "<id>",
|
|
318
|
+
extendPaths: [
|
|
319
|
+
{
|
|
320
|
+
path: "$.nested.property",
|
|
321
|
+
value: {
|
|
322
|
+
"TaxClassificationRef": {
|
|
323
|
+
"value": "EUC-99990201-V1-00020000",
|
|
324
|
+
},
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
path: "$.nested.property",
|
|
329
|
+
value: {
|
|
330
|
+
"TaxClassificationRef": {
|
|
331
|
+
"value": "EUC-99990201-V1-00020000",
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
},
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
serviceId: "<id>",
|
|
339
|
+
extendPaths: [
|
|
340
|
+
{
|
|
341
|
+
path: "$.nested.property",
|
|
342
|
+
value: {
|
|
343
|
+
"TaxClassificationRef": {
|
|
344
|
+
"value": "EUC-99990201-V1-00020000",
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
],
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
serviceId: "<id>",
|
|
352
|
+
extendPaths: [
|
|
353
|
+
{
|
|
354
|
+
path: "$.nested.property",
|
|
355
|
+
value: {
|
|
356
|
+
"TaxClassificationRef": {
|
|
357
|
+
"value": "EUC-99990201-V1-00020000",
|
|
358
|
+
},
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
},
|
|
365
|
+
],
|
|
366
|
+
meta: {
|
|
367
|
+
itemsOnPage: 50,
|
|
368
|
+
cursors: {
|
|
369
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
370
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
371
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
372
|
+
},
|
|
373
|
+
},
|
|
374
|
+
links: {
|
|
375
|
+
previous:
|
|
376
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
377
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
378
|
+
next:
|
|
379
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
380
|
+
},
|
|
381
|
+
});
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
it.skip("Payments Accounting Payments Add", async () => {
|
|
385
|
+
assert.fail(
|
|
386
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.paymentsAdd.test referencing operation accounting.paymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsAdd.test referencing operation accounting.paymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsAdd.test referencing operation accounting.paymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsAdd.test referencing operation accounting.paymentsAdd with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsAdd.test referencing operation accounting.paymentsAdd with expression in requestBody with type not currently supported`]",
|
|
387
|
+
);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
test("Payments Accounting Payments One", async () => {
|
|
391
|
+
const testHttpClient = createTestHTTPClient("accounting.paymentsOne");
|
|
392
|
+
|
|
393
|
+
const apideck = new Apideck({
|
|
394
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
395
|
+
httpClient: testHttpClient,
|
|
396
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
const result = await apideck.accounting.payments.get({
|
|
400
|
+
id: "<id>",
|
|
401
|
+
serviceId: "salesforce",
|
|
402
|
+
fields: "id,updated_at",
|
|
403
|
+
});
|
|
404
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
405
|
+
expect(result.getPaymentResponse).toBeDefined();
|
|
406
|
+
expect(result.getPaymentResponse).toEqual({
|
|
407
|
+
statusCode: 200,
|
|
408
|
+
status: "OK",
|
|
409
|
+
service: "xero",
|
|
410
|
+
resource: "payments",
|
|
411
|
+
operation: "one",
|
|
412
|
+
data: {
|
|
413
|
+
id: "12345",
|
|
414
|
+
downstreamId: "12345",
|
|
415
|
+
currency: "USD",
|
|
416
|
+
currencyRate: 0.69,
|
|
417
|
+
totalAmount: 49.99,
|
|
418
|
+
reference: "123456",
|
|
419
|
+
paymentMethod: "cash",
|
|
420
|
+
paymentMethodReference: "123456",
|
|
421
|
+
paymentMethodId: "12345",
|
|
422
|
+
account: {
|
|
423
|
+
id: "123456",
|
|
424
|
+
name: "Bank account",
|
|
425
|
+
nominalCode: "N091",
|
|
426
|
+
code: "453",
|
|
427
|
+
},
|
|
428
|
+
transactionDate: new Date("2021-05-01T12:00:00.000Z"),
|
|
429
|
+
customer: {
|
|
430
|
+
id: "12345",
|
|
431
|
+
displayId: "CUST00101",
|
|
432
|
+
displayName: "Windsurf Shop",
|
|
433
|
+
companyName: "The boring company",
|
|
434
|
+
email: "boring@boring.com",
|
|
435
|
+
},
|
|
436
|
+
companyId: "12345",
|
|
437
|
+
reconciled: true,
|
|
438
|
+
status: "authorised",
|
|
439
|
+
type: "accounts_receivable",
|
|
440
|
+
allocations: [
|
|
441
|
+
{
|
|
442
|
+
id: "123456",
|
|
443
|
+
code: "N091",
|
|
444
|
+
amount: 49.99,
|
|
445
|
+
allocationId: "123456",
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
id: "123456",
|
|
449
|
+
code: "N091",
|
|
450
|
+
amount: 49.99,
|
|
451
|
+
allocationId: "123456",
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
id: "123456",
|
|
455
|
+
code: "N091",
|
|
456
|
+
amount: 49.99,
|
|
457
|
+
allocationId: "123456",
|
|
458
|
+
},
|
|
459
|
+
],
|
|
460
|
+
note: "Some notes about this transaction",
|
|
461
|
+
number: "123456",
|
|
462
|
+
trackingCategories: [
|
|
463
|
+
{
|
|
464
|
+
id: "123456",
|
|
465
|
+
name: "New York",
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
id: "123456",
|
|
469
|
+
name: "New York",
|
|
470
|
+
},
|
|
471
|
+
],
|
|
472
|
+
customFields: [
|
|
473
|
+
{
|
|
474
|
+
id: "2389328923893298",
|
|
475
|
+
name: "employee_level",
|
|
476
|
+
description: "Employee Level",
|
|
477
|
+
value: {},
|
|
478
|
+
},
|
|
479
|
+
{
|
|
480
|
+
id: "2389328923893298",
|
|
481
|
+
name: "employee_level",
|
|
482
|
+
description: "Employee Level",
|
|
483
|
+
value: [
|
|
484
|
+
{},
|
|
485
|
+
],
|
|
486
|
+
},
|
|
487
|
+
],
|
|
488
|
+
rowVersion: "1-12345",
|
|
489
|
+
displayId: "123456",
|
|
490
|
+
updatedBy: "12345",
|
|
491
|
+
createdBy: "12345",
|
|
492
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
493
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
494
|
+
passThrough: [
|
|
495
|
+
{
|
|
496
|
+
serviceId: "<id>",
|
|
497
|
+
extendPaths: [
|
|
498
|
+
{
|
|
499
|
+
path: "$.nested.property",
|
|
500
|
+
value: {
|
|
501
|
+
"TaxClassificationRef": {
|
|
502
|
+
"value": "EUC-99990201-V1-00020000",
|
|
503
|
+
},
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
],
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
serviceId: "<id>",
|
|
510
|
+
extendPaths: [
|
|
511
|
+
{
|
|
512
|
+
path: "$.nested.property",
|
|
513
|
+
value: {
|
|
514
|
+
"TaxClassificationRef": {
|
|
515
|
+
"value": "EUC-99990201-V1-00020000",
|
|
516
|
+
},
|
|
517
|
+
},
|
|
518
|
+
},
|
|
519
|
+
],
|
|
520
|
+
},
|
|
521
|
+
],
|
|
522
|
+
},
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
it.skip("Payments Accounting Payments Update", async () => {
|
|
527
|
+
assert.fail(
|
|
528
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`, `workflow step accounting.paymentsUpdate.test referencing operation accounting.paymentsUpdate with expression in requestBody with type not currently supported`]",
|
|
529
|
+
);
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
test("Payments Accounting Payments Delete", async () => {
|
|
533
|
+
const testHttpClient = createTestHTTPClient("accounting.paymentsDelete");
|
|
534
|
+
|
|
535
|
+
const apideck = new Apideck({
|
|
536
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
537
|
+
httpClient: testHttpClient,
|
|
538
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
const result = await apideck.accounting.payments.delete({
|
|
542
|
+
id: "<id>",
|
|
543
|
+
serviceId: "salesforce",
|
|
544
|
+
});
|
|
545
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
546
|
+
expect(result.deletePaymentResponse).toBeDefined();
|
|
547
|
+
expect(result.deletePaymentResponse).toEqual({
|
|
548
|
+
statusCode: 200,
|
|
549
|
+
status: "OK",
|
|
550
|
+
service: "xero",
|
|
551
|
+
resource: "payments",
|
|
552
|
+
operation: "delete",
|
|
553
|
+
data: {
|
|
554
|
+
id: "12345",
|
|
555
|
+
},
|
|
556
|
+
});
|
|
557
|
+
});
|