@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,1053 @@
|
|
|
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("Journalentries Accounting Journal Entries All", async () => {
|
|
10
|
+
const testHttpClient = createTestHTTPClient("accounting.journalEntriesAll");
|
|
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.journalEntries.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.getJournalEntriesResponse).toBeDefined();
|
|
33
|
+
expect(result.getJournalEntriesResponse).toEqual({
|
|
34
|
+
statusCode: 200,
|
|
35
|
+
status: "OK",
|
|
36
|
+
service: "quickbooks",
|
|
37
|
+
resource: "journal-entries",
|
|
38
|
+
operation: "all",
|
|
39
|
+
data: [
|
|
40
|
+
{
|
|
41
|
+
id: "12345",
|
|
42
|
+
title:
|
|
43
|
+
"Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
|
|
44
|
+
currencyRate: 0.69,
|
|
45
|
+
currency: "USD",
|
|
46
|
+
companyId: "12345",
|
|
47
|
+
lineItems: [
|
|
48
|
+
{
|
|
49
|
+
id: "12345",
|
|
50
|
+
description:
|
|
51
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
52
|
+
taxAmount: 27500,
|
|
53
|
+
subTotal: 27500,
|
|
54
|
+
totalAmount: 27500,
|
|
55
|
+
type: "debit",
|
|
56
|
+
taxRate: {
|
|
57
|
+
id: "123456",
|
|
58
|
+
code: "N-T",
|
|
59
|
+
name: "GST on Purchases",
|
|
60
|
+
rate: 10,
|
|
61
|
+
},
|
|
62
|
+
trackingCategories: [
|
|
63
|
+
{
|
|
64
|
+
id: "123456",
|
|
65
|
+
name: "New York",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "123456",
|
|
69
|
+
name: "New York",
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "123456",
|
|
73
|
+
name: "New York",
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
ledgerAccount: {
|
|
77
|
+
id: "123456",
|
|
78
|
+
name: "Bank account",
|
|
79
|
+
nominalCode: "N091",
|
|
80
|
+
code: "453",
|
|
81
|
+
},
|
|
82
|
+
customer: {
|
|
83
|
+
id: "12345",
|
|
84
|
+
displayId: "CUST00101",
|
|
85
|
+
displayName: "Windsurf Shop",
|
|
86
|
+
companyName: "The boring company",
|
|
87
|
+
email: "boring@boring.com",
|
|
88
|
+
},
|
|
89
|
+
supplier: {
|
|
90
|
+
id: "12345",
|
|
91
|
+
displayId: "SUPP00101",
|
|
92
|
+
displayName: "Windsurf Shop",
|
|
93
|
+
companyName: "The boring company",
|
|
94
|
+
address: {
|
|
95
|
+
id: "123",
|
|
96
|
+
type: "primary",
|
|
97
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
98
|
+
name: "HQ US",
|
|
99
|
+
line1: "Main street",
|
|
100
|
+
line2: "apt #",
|
|
101
|
+
line3: "Suite #",
|
|
102
|
+
line4: "delivery instructions",
|
|
103
|
+
streetNumber: "25",
|
|
104
|
+
city: "San Francisco",
|
|
105
|
+
state: "CA",
|
|
106
|
+
postalCode: "94104",
|
|
107
|
+
country: "US",
|
|
108
|
+
latitude: "40.759211",
|
|
109
|
+
longitude: "-73.984638",
|
|
110
|
+
county: "Santa Clara",
|
|
111
|
+
contactName: "Elon Musk",
|
|
112
|
+
salutation: "Mr",
|
|
113
|
+
phoneNumber: "111-111-1111",
|
|
114
|
+
fax: "122-111-1111",
|
|
115
|
+
email: "elon@musk.com",
|
|
116
|
+
website: "https://elonmusk.com",
|
|
117
|
+
notes: "Address notes or delivery instructions.",
|
|
118
|
+
rowVersion: "1-12345",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
departmentId: "12345",
|
|
122
|
+
locationId: "12345",
|
|
123
|
+
lineNumber: 1,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "12345",
|
|
127
|
+
description:
|
|
128
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
129
|
+
taxAmount: 27500,
|
|
130
|
+
subTotal: 27500,
|
|
131
|
+
totalAmount: 27500,
|
|
132
|
+
type: "debit",
|
|
133
|
+
taxRate: {
|
|
134
|
+
id: "123456",
|
|
135
|
+
code: "N-T",
|
|
136
|
+
name: "GST on Purchases",
|
|
137
|
+
rate: 10,
|
|
138
|
+
},
|
|
139
|
+
trackingCategories: [
|
|
140
|
+
{
|
|
141
|
+
id: "123456",
|
|
142
|
+
name: "New York",
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
ledgerAccount: {
|
|
146
|
+
id: "123456",
|
|
147
|
+
name: "Bank account",
|
|
148
|
+
nominalCode: "N091",
|
|
149
|
+
code: "453",
|
|
150
|
+
},
|
|
151
|
+
customer: {
|
|
152
|
+
id: "12345",
|
|
153
|
+
displayId: "CUST00101",
|
|
154
|
+
displayName: "Windsurf Shop",
|
|
155
|
+
companyName: "The boring company",
|
|
156
|
+
email: "boring@boring.com",
|
|
157
|
+
},
|
|
158
|
+
supplier: {
|
|
159
|
+
id: "12345",
|
|
160
|
+
displayId: "SUPP00101",
|
|
161
|
+
displayName: "Windsurf Shop",
|
|
162
|
+
companyName: "The boring company",
|
|
163
|
+
address: {
|
|
164
|
+
id: "123",
|
|
165
|
+
type: "primary",
|
|
166
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
167
|
+
name: "HQ US",
|
|
168
|
+
line1: "Main street",
|
|
169
|
+
line2: "apt #",
|
|
170
|
+
line3: "Suite #",
|
|
171
|
+
line4: "delivery instructions",
|
|
172
|
+
streetNumber: "25",
|
|
173
|
+
city: "San Francisco",
|
|
174
|
+
state: "CA",
|
|
175
|
+
postalCode: "94104",
|
|
176
|
+
country: "US",
|
|
177
|
+
latitude: "40.759211",
|
|
178
|
+
longitude: "-73.984638",
|
|
179
|
+
county: "Santa Clara",
|
|
180
|
+
contactName: "Elon Musk",
|
|
181
|
+
salutation: "Mr",
|
|
182
|
+
phoneNumber: "111-111-1111",
|
|
183
|
+
fax: "122-111-1111",
|
|
184
|
+
email: "elon@musk.com",
|
|
185
|
+
website: "https://elonmusk.com",
|
|
186
|
+
notes: "Address notes or delivery instructions.",
|
|
187
|
+
rowVersion: "1-12345",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
departmentId: "12345",
|
|
191
|
+
locationId: "12345",
|
|
192
|
+
lineNumber: 1,
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
memo: "Thank you for your business and have a great day!",
|
|
196
|
+
postedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
197
|
+
journalSymbol: "IND",
|
|
198
|
+
taxType: "sales",
|
|
199
|
+
taxCode: "1234",
|
|
200
|
+
number: "OIT00546",
|
|
201
|
+
trackingCategories: [
|
|
202
|
+
{
|
|
203
|
+
id: "123456",
|
|
204
|
+
name: "New York",
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
accountingPeriod: "01-24",
|
|
208
|
+
updatedBy: "12345",
|
|
209
|
+
createdBy: "12345",
|
|
210
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
211
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
212
|
+
rowVersion: "1-12345",
|
|
213
|
+
customFields: [
|
|
214
|
+
{
|
|
215
|
+
id: "2389328923893298",
|
|
216
|
+
name: "employee_level",
|
|
217
|
+
description: "Employee Level",
|
|
218
|
+
value: {},
|
|
219
|
+
},
|
|
220
|
+
],
|
|
221
|
+
passThrough: [
|
|
222
|
+
{
|
|
223
|
+
serviceId: "<id>",
|
|
224
|
+
extendPaths: [
|
|
225
|
+
{
|
|
226
|
+
path: "$.nested.property",
|
|
227
|
+
value: {
|
|
228
|
+
"TaxClassificationRef": {
|
|
229
|
+
"value": "EUC-99990201-V1-00020000",
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
serviceId: "<id>",
|
|
237
|
+
extendPaths: [
|
|
238
|
+
{
|
|
239
|
+
path: "$.nested.property",
|
|
240
|
+
value: {
|
|
241
|
+
"TaxClassificationRef": {
|
|
242
|
+
"value": "EUC-99990201-V1-00020000",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
path: "$.nested.property",
|
|
248
|
+
value: {
|
|
249
|
+
"TaxClassificationRef": {
|
|
250
|
+
"value": "EUC-99990201-V1-00020000",
|
|
251
|
+
},
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
path: "$.nested.property",
|
|
256
|
+
value: {
|
|
257
|
+
"TaxClassificationRef": {
|
|
258
|
+
"value": "EUC-99990201-V1-00020000",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
],
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
id: "12345",
|
|
268
|
+
title:
|
|
269
|
+
"Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
|
|
270
|
+
currencyRate: 0.69,
|
|
271
|
+
currency: "USD",
|
|
272
|
+
companyId: "12345",
|
|
273
|
+
lineItems: [
|
|
274
|
+
{
|
|
275
|
+
id: "12345",
|
|
276
|
+
description:
|
|
277
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
278
|
+
taxAmount: 27500,
|
|
279
|
+
subTotal: 27500,
|
|
280
|
+
totalAmount: 27500,
|
|
281
|
+
type: "debit",
|
|
282
|
+
taxRate: {
|
|
283
|
+
id: "123456",
|
|
284
|
+
code: "N-T",
|
|
285
|
+
name: "GST on Purchases",
|
|
286
|
+
rate: 10,
|
|
287
|
+
},
|
|
288
|
+
trackingCategories: [
|
|
289
|
+
{
|
|
290
|
+
id: "123456",
|
|
291
|
+
name: "New York",
|
|
292
|
+
},
|
|
293
|
+
],
|
|
294
|
+
ledgerAccount: {
|
|
295
|
+
id: "123456",
|
|
296
|
+
name: "Bank account",
|
|
297
|
+
nominalCode: "N091",
|
|
298
|
+
code: "453",
|
|
299
|
+
},
|
|
300
|
+
customer: {
|
|
301
|
+
id: "12345",
|
|
302
|
+
displayId: "CUST00101",
|
|
303
|
+
displayName: "Windsurf Shop",
|
|
304
|
+
companyName: "The boring company",
|
|
305
|
+
email: "boring@boring.com",
|
|
306
|
+
},
|
|
307
|
+
supplier: {
|
|
308
|
+
id: "12345",
|
|
309
|
+
displayId: "SUPP00101",
|
|
310
|
+
displayName: "Windsurf Shop",
|
|
311
|
+
companyName: "The boring company",
|
|
312
|
+
address: {
|
|
313
|
+
id: "123",
|
|
314
|
+
type: "primary",
|
|
315
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
316
|
+
name: "HQ US",
|
|
317
|
+
line1: "Main street",
|
|
318
|
+
line2: "apt #",
|
|
319
|
+
line3: "Suite #",
|
|
320
|
+
line4: "delivery instructions",
|
|
321
|
+
streetNumber: "25",
|
|
322
|
+
city: "San Francisco",
|
|
323
|
+
state: "CA",
|
|
324
|
+
postalCode: "94104",
|
|
325
|
+
country: "US",
|
|
326
|
+
latitude: "40.759211",
|
|
327
|
+
longitude: "-73.984638",
|
|
328
|
+
county: "Santa Clara",
|
|
329
|
+
contactName: "Elon Musk",
|
|
330
|
+
salutation: "Mr",
|
|
331
|
+
phoneNumber: "111-111-1111",
|
|
332
|
+
fax: "122-111-1111",
|
|
333
|
+
email: "elon@musk.com",
|
|
334
|
+
website: "https://elonmusk.com",
|
|
335
|
+
notes: "Address notes or delivery instructions.",
|
|
336
|
+
rowVersion: "1-12345",
|
|
337
|
+
},
|
|
338
|
+
},
|
|
339
|
+
departmentId: "12345",
|
|
340
|
+
locationId: "12345",
|
|
341
|
+
lineNumber: 1,
|
|
342
|
+
},
|
|
343
|
+
],
|
|
344
|
+
memo: "Thank you for your business and have a great day!",
|
|
345
|
+
postedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
346
|
+
journalSymbol: "IND",
|
|
347
|
+
taxType: "sales",
|
|
348
|
+
taxCode: "1234",
|
|
349
|
+
number: "OIT00546",
|
|
350
|
+
trackingCategories: [
|
|
351
|
+
{
|
|
352
|
+
id: "123456",
|
|
353
|
+
name: "New York",
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
id: "123456",
|
|
357
|
+
name: "New York",
|
|
358
|
+
},
|
|
359
|
+
{
|
|
360
|
+
id: "123456",
|
|
361
|
+
name: "New York",
|
|
362
|
+
},
|
|
363
|
+
],
|
|
364
|
+
accountingPeriod: "01-24",
|
|
365
|
+
updatedBy: "12345",
|
|
366
|
+
createdBy: "12345",
|
|
367
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
368
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
369
|
+
rowVersion: "1-12345",
|
|
370
|
+
customFields: [
|
|
371
|
+
{
|
|
372
|
+
id: "2389328923893298",
|
|
373
|
+
name: "employee_level",
|
|
374
|
+
description: "Employee Level",
|
|
375
|
+
value: {},
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
id: "2389328923893298",
|
|
379
|
+
name: "employee_level",
|
|
380
|
+
description: "Employee Level",
|
|
381
|
+
value: "Uses Salesforce and Marketo",
|
|
382
|
+
},
|
|
383
|
+
],
|
|
384
|
+
passThrough: [
|
|
385
|
+
{
|
|
386
|
+
serviceId: "<id>",
|
|
387
|
+
extendPaths: [
|
|
388
|
+
{
|
|
389
|
+
path: "$.nested.property",
|
|
390
|
+
value: {
|
|
391
|
+
"TaxClassificationRef": {
|
|
392
|
+
"value": "EUC-99990201-V1-00020000",
|
|
393
|
+
},
|
|
394
|
+
},
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
path: "$.nested.property",
|
|
398
|
+
value: {
|
|
399
|
+
"TaxClassificationRef": {
|
|
400
|
+
"value": "EUC-99990201-V1-00020000",
|
|
401
|
+
},
|
|
402
|
+
},
|
|
403
|
+
},
|
|
404
|
+
],
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "12345",
|
|
410
|
+
title:
|
|
411
|
+
"Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
|
|
412
|
+
currencyRate: 0.69,
|
|
413
|
+
currency: "USD",
|
|
414
|
+
companyId: "12345",
|
|
415
|
+
lineItems: [
|
|
416
|
+
{
|
|
417
|
+
id: "12345",
|
|
418
|
+
description:
|
|
419
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
420
|
+
taxAmount: 27500,
|
|
421
|
+
subTotal: 27500,
|
|
422
|
+
totalAmount: 27500,
|
|
423
|
+
type: "debit",
|
|
424
|
+
taxRate: {
|
|
425
|
+
id: "123456",
|
|
426
|
+
code: "N-T",
|
|
427
|
+
name: "GST on Purchases",
|
|
428
|
+
rate: 10,
|
|
429
|
+
},
|
|
430
|
+
trackingCategories: [
|
|
431
|
+
{
|
|
432
|
+
id: "123456",
|
|
433
|
+
name: "New York",
|
|
434
|
+
},
|
|
435
|
+
],
|
|
436
|
+
ledgerAccount: {
|
|
437
|
+
id: "123456",
|
|
438
|
+
name: "Bank account",
|
|
439
|
+
nominalCode: "N091",
|
|
440
|
+
code: "453",
|
|
441
|
+
},
|
|
442
|
+
customer: {
|
|
443
|
+
id: "12345",
|
|
444
|
+
displayId: "CUST00101",
|
|
445
|
+
displayName: "Windsurf Shop",
|
|
446
|
+
companyName: "The boring company",
|
|
447
|
+
email: "boring@boring.com",
|
|
448
|
+
},
|
|
449
|
+
supplier: {
|
|
450
|
+
id: "12345",
|
|
451
|
+
displayId: "SUPP00101",
|
|
452
|
+
displayName: "Windsurf Shop",
|
|
453
|
+
companyName: "The boring company",
|
|
454
|
+
address: {
|
|
455
|
+
id: "123",
|
|
456
|
+
type: "primary",
|
|
457
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
458
|
+
name: "HQ US",
|
|
459
|
+
line1: "Main street",
|
|
460
|
+
line2: "apt #",
|
|
461
|
+
line3: "Suite #",
|
|
462
|
+
line4: "delivery instructions",
|
|
463
|
+
streetNumber: "25",
|
|
464
|
+
city: "San Francisco",
|
|
465
|
+
state: "CA",
|
|
466
|
+
postalCode: "94104",
|
|
467
|
+
country: "US",
|
|
468
|
+
latitude: "40.759211",
|
|
469
|
+
longitude: "-73.984638",
|
|
470
|
+
county: "Santa Clara",
|
|
471
|
+
contactName: "Elon Musk",
|
|
472
|
+
salutation: "Mr",
|
|
473
|
+
phoneNumber: "111-111-1111",
|
|
474
|
+
fax: "122-111-1111",
|
|
475
|
+
email: "elon@musk.com",
|
|
476
|
+
website: "https://elonmusk.com",
|
|
477
|
+
notes: "Address notes or delivery instructions.",
|
|
478
|
+
rowVersion: "1-12345",
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
departmentId: "12345",
|
|
482
|
+
locationId: "12345",
|
|
483
|
+
lineNumber: 1,
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
id: "12345",
|
|
487
|
+
description:
|
|
488
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
489
|
+
taxAmount: 27500,
|
|
490
|
+
subTotal: 27500,
|
|
491
|
+
totalAmount: 27500,
|
|
492
|
+
type: "debit",
|
|
493
|
+
taxRate: {
|
|
494
|
+
id: "123456",
|
|
495
|
+
code: "N-T",
|
|
496
|
+
name: "GST on Purchases",
|
|
497
|
+
rate: 10,
|
|
498
|
+
},
|
|
499
|
+
trackingCategories: [
|
|
500
|
+
{
|
|
501
|
+
id: "123456",
|
|
502
|
+
name: "New York",
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
id: "123456",
|
|
506
|
+
name: "New York",
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
id: "123456",
|
|
510
|
+
name: "New York",
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
ledgerAccount: {
|
|
514
|
+
id: "123456",
|
|
515
|
+
name: "Bank account",
|
|
516
|
+
nominalCode: "N091",
|
|
517
|
+
code: "453",
|
|
518
|
+
},
|
|
519
|
+
customer: {
|
|
520
|
+
id: "12345",
|
|
521
|
+
displayId: "CUST00101",
|
|
522
|
+
displayName: "Windsurf Shop",
|
|
523
|
+
companyName: "The boring company",
|
|
524
|
+
email: "boring@boring.com",
|
|
525
|
+
},
|
|
526
|
+
supplier: {
|
|
527
|
+
id: "12345",
|
|
528
|
+
displayId: "SUPP00101",
|
|
529
|
+
displayName: "Windsurf Shop",
|
|
530
|
+
companyName: "The boring company",
|
|
531
|
+
address: {
|
|
532
|
+
id: "123",
|
|
533
|
+
type: "primary",
|
|
534
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
535
|
+
name: "HQ US",
|
|
536
|
+
line1: "Main street",
|
|
537
|
+
line2: "apt #",
|
|
538
|
+
line3: "Suite #",
|
|
539
|
+
line4: "delivery instructions",
|
|
540
|
+
streetNumber: "25",
|
|
541
|
+
city: "San Francisco",
|
|
542
|
+
state: "CA",
|
|
543
|
+
postalCode: "94104",
|
|
544
|
+
country: "US",
|
|
545
|
+
latitude: "40.759211",
|
|
546
|
+
longitude: "-73.984638",
|
|
547
|
+
county: "Santa Clara",
|
|
548
|
+
contactName: "Elon Musk",
|
|
549
|
+
salutation: "Mr",
|
|
550
|
+
phoneNumber: "111-111-1111",
|
|
551
|
+
fax: "122-111-1111",
|
|
552
|
+
email: "elon@musk.com",
|
|
553
|
+
website: "https://elonmusk.com",
|
|
554
|
+
notes: "Address notes or delivery instructions.",
|
|
555
|
+
rowVersion: "1-12345",
|
|
556
|
+
},
|
|
557
|
+
},
|
|
558
|
+
departmentId: "12345",
|
|
559
|
+
locationId: "12345",
|
|
560
|
+
lineNumber: 1,
|
|
561
|
+
},
|
|
562
|
+
],
|
|
563
|
+
memo: "Thank you for your business and have a great day!",
|
|
564
|
+
postedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
565
|
+
journalSymbol: "IND",
|
|
566
|
+
taxType: "sales",
|
|
567
|
+
taxCode: "1234",
|
|
568
|
+
number: "OIT00546",
|
|
569
|
+
trackingCategories: [
|
|
570
|
+
{
|
|
571
|
+
id: "123456",
|
|
572
|
+
name: "New York",
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
id: "123456",
|
|
576
|
+
name: "New York",
|
|
577
|
+
},
|
|
578
|
+
],
|
|
579
|
+
accountingPeriod: "01-24",
|
|
580
|
+
updatedBy: "12345",
|
|
581
|
+
createdBy: "12345",
|
|
582
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
583
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
584
|
+
rowVersion: "1-12345",
|
|
585
|
+
customFields: [
|
|
586
|
+
{
|
|
587
|
+
id: "2389328923893298",
|
|
588
|
+
name: "employee_level",
|
|
589
|
+
description: "Employee Level",
|
|
590
|
+
value: true,
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
id: "2389328923893298",
|
|
594
|
+
name: "employee_level",
|
|
595
|
+
description: "Employee Level",
|
|
596
|
+
value: "Uses Salesforce and Marketo",
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
id: "2389328923893298",
|
|
600
|
+
name: "employee_level",
|
|
601
|
+
description: "Employee Level",
|
|
602
|
+
value: 10,
|
|
603
|
+
},
|
|
604
|
+
],
|
|
605
|
+
passThrough: [
|
|
606
|
+
{
|
|
607
|
+
serviceId: "<id>",
|
|
608
|
+
extendPaths: [
|
|
609
|
+
{
|
|
610
|
+
path: "$.nested.property",
|
|
611
|
+
value: {
|
|
612
|
+
"TaxClassificationRef": {
|
|
613
|
+
"value": "EUC-99990201-V1-00020000",
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
},
|
|
617
|
+
],
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
serviceId: "<id>",
|
|
621
|
+
extendPaths: [
|
|
622
|
+
{
|
|
623
|
+
path: "$.nested.property",
|
|
624
|
+
value: {
|
|
625
|
+
"TaxClassificationRef": {
|
|
626
|
+
"value": "EUC-99990201-V1-00020000",
|
|
627
|
+
},
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
path: "$.nested.property",
|
|
632
|
+
value: {
|
|
633
|
+
"TaxClassificationRef": {
|
|
634
|
+
"value": "EUC-99990201-V1-00020000",
|
|
635
|
+
},
|
|
636
|
+
},
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
path: "$.nested.property",
|
|
640
|
+
value: {
|
|
641
|
+
"TaxClassificationRef": {
|
|
642
|
+
"value": "EUC-99990201-V1-00020000",
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
},
|
|
646
|
+
],
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
serviceId: "<id>",
|
|
650
|
+
extendPaths: [
|
|
651
|
+
{
|
|
652
|
+
path: "$.nested.property",
|
|
653
|
+
value: {
|
|
654
|
+
"TaxClassificationRef": {
|
|
655
|
+
"value": "EUC-99990201-V1-00020000",
|
|
656
|
+
},
|
|
657
|
+
},
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
path: "$.nested.property",
|
|
661
|
+
value: {
|
|
662
|
+
"TaxClassificationRef": {
|
|
663
|
+
"value": "EUC-99990201-V1-00020000",
|
|
664
|
+
},
|
|
665
|
+
},
|
|
666
|
+
},
|
|
667
|
+
],
|
|
668
|
+
},
|
|
669
|
+
],
|
|
670
|
+
},
|
|
671
|
+
],
|
|
672
|
+
meta: {
|
|
673
|
+
itemsOnPage: 50,
|
|
674
|
+
cursors: {
|
|
675
|
+
previous: "em9oby1jcm06OnBhZ2U6OjE=",
|
|
676
|
+
current: "em9oby1jcm06OnBhZ2U6OjI=",
|
|
677
|
+
next: "em9oby1jcm06OnBhZ2U6OjM=",
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
links: {
|
|
681
|
+
previous:
|
|
682
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjE%3D",
|
|
683
|
+
current: "https://unify.apideck.com/crm/companies",
|
|
684
|
+
next:
|
|
685
|
+
"https://unify.apideck.com/crm/companies?cursor=em9oby1jcm06OnBhZ2U6OjM",
|
|
686
|
+
},
|
|
687
|
+
});
|
|
688
|
+
});
|
|
689
|
+
|
|
690
|
+
it.skip("Journalentries Accounting Journal Entries Add", async () => {
|
|
691
|
+
assert.fail(
|
|
692
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.journalEntriesAdd.test referencing operation accounting.journalEntriesAdd with expression in requestBody with type not currently supported`]",
|
|
693
|
+
);
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
test("Journalentries Accounting Journal Entries One", async () => {
|
|
697
|
+
const testHttpClient = createTestHTTPClient("accounting.journalEntriesOne");
|
|
698
|
+
|
|
699
|
+
const apideck = new Apideck({
|
|
700
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
701
|
+
httpClient: testHttpClient,
|
|
702
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
703
|
+
});
|
|
704
|
+
|
|
705
|
+
const result = await apideck.accounting.journalEntries.get({
|
|
706
|
+
id: "<id>",
|
|
707
|
+
serviceId: "salesforce",
|
|
708
|
+
fields: "id,updated_at",
|
|
709
|
+
});
|
|
710
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
711
|
+
expect(result.getJournalEntryResponse).toBeDefined();
|
|
712
|
+
expect(result.getJournalEntryResponse).toEqual({
|
|
713
|
+
statusCode: 200,
|
|
714
|
+
status: "OK",
|
|
715
|
+
service: "quickbooks",
|
|
716
|
+
resource: "journal-entries",
|
|
717
|
+
operation: "one",
|
|
718
|
+
data: {
|
|
719
|
+
id: "12345",
|
|
720
|
+
title: "Purchase Invoice-Inventory (USD): 2019/02/01 Batch Summary Entry",
|
|
721
|
+
currencyRate: 0.69,
|
|
722
|
+
currency: "USD",
|
|
723
|
+
companyId: "12345",
|
|
724
|
+
lineItems: [
|
|
725
|
+
{
|
|
726
|
+
id: "12345",
|
|
727
|
+
description:
|
|
728
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
729
|
+
taxAmount: 27500,
|
|
730
|
+
subTotal: 27500,
|
|
731
|
+
totalAmount: 27500,
|
|
732
|
+
type: "debit",
|
|
733
|
+
taxRate: {
|
|
734
|
+
id: "123456",
|
|
735
|
+
code: "N-T",
|
|
736
|
+
name: "GST on Purchases",
|
|
737
|
+
rate: 10,
|
|
738
|
+
},
|
|
739
|
+
trackingCategories: [
|
|
740
|
+
{
|
|
741
|
+
id: "123456",
|
|
742
|
+
name: "New York",
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
id: "123456",
|
|
746
|
+
name: "New York",
|
|
747
|
+
},
|
|
748
|
+
],
|
|
749
|
+
ledgerAccount: {
|
|
750
|
+
id: "123456",
|
|
751
|
+
name: "Bank account",
|
|
752
|
+
nominalCode: "N091",
|
|
753
|
+
code: "453",
|
|
754
|
+
},
|
|
755
|
+
customer: {
|
|
756
|
+
id: "12345",
|
|
757
|
+
displayId: "CUST00101",
|
|
758
|
+
displayName: "Windsurf Shop",
|
|
759
|
+
companyName: "The boring company",
|
|
760
|
+
email: "boring@boring.com",
|
|
761
|
+
},
|
|
762
|
+
supplier: {
|
|
763
|
+
id: "12345",
|
|
764
|
+
displayId: "SUPP00101",
|
|
765
|
+
displayName: "Windsurf Shop",
|
|
766
|
+
companyName: "The boring company",
|
|
767
|
+
address: {
|
|
768
|
+
id: "123",
|
|
769
|
+
type: "primary",
|
|
770
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
771
|
+
name: "HQ US",
|
|
772
|
+
line1: "Main street",
|
|
773
|
+
line2: "apt #",
|
|
774
|
+
line3: "Suite #",
|
|
775
|
+
line4: "delivery instructions",
|
|
776
|
+
streetNumber: "25",
|
|
777
|
+
city: "San Francisco",
|
|
778
|
+
state: "CA",
|
|
779
|
+
postalCode: "94104",
|
|
780
|
+
country: "US",
|
|
781
|
+
latitude: "40.759211",
|
|
782
|
+
longitude: "-73.984638",
|
|
783
|
+
county: "Santa Clara",
|
|
784
|
+
contactName: "Elon Musk",
|
|
785
|
+
salutation: "Mr",
|
|
786
|
+
phoneNumber: "111-111-1111",
|
|
787
|
+
fax: "122-111-1111",
|
|
788
|
+
email: "elon@musk.com",
|
|
789
|
+
website: "https://elonmusk.com",
|
|
790
|
+
notes: "Address notes or delivery instructions.",
|
|
791
|
+
rowVersion: "1-12345",
|
|
792
|
+
},
|
|
793
|
+
},
|
|
794
|
+
departmentId: "12345",
|
|
795
|
+
locationId: "12345",
|
|
796
|
+
lineNumber: 1,
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
id: "12345",
|
|
800
|
+
description:
|
|
801
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
802
|
+
taxAmount: 27500,
|
|
803
|
+
subTotal: 27500,
|
|
804
|
+
totalAmount: 27500,
|
|
805
|
+
type: "debit",
|
|
806
|
+
taxRate: {
|
|
807
|
+
id: "123456",
|
|
808
|
+
code: "N-T",
|
|
809
|
+
name: "GST on Purchases",
|
|
810
|
+
rate: 10,
|
|
811
|
+
},
|
|
812
|
+
trackingCategories: [
|
|
813
|
+
{
|
|
814
|
+
id: "123456",
|
|
815
|
+
name: "New York",
|
|
816
|
+
},
|
|
817
|
+
{
|
|
818
|
+
id: "123456",
|
|
819
|
+
name: "New York",
|
|
820
|
+
},
|
|
821
|
+
],
|
|
822
|
+
ledgerAccount: {
|
|
823
|
+
id: "123456",
|
|
824
|
+
name: "Bank account",
|
|
825
|
+
nominalCode: "N091",
|
|
826
|
+
code: "453",
|
|
827
|
+
},
|
|
828
|
+
customer: {
|
|
829
|
+
id: "12345",
|
|
830
|
+
displayId: "CUST00101",
|
|
831
|
+
displayName: "Windsurf Shop",
|
|
832
|
+
companyName: "The boring company",
|
|
833
|
+
email: "boring@boring.com",
|
|
834
|
+
},
|
|
835
|
+
supplier: {
|
|
836
|
+
id: "12345",
|
|
837
|
+
displayId: "SUPP00101",
|
|
838
|
+
displayName: "Windsurf Shop",
|
|
839
|
+
companyName: "The boring company",
|
|
840
|
+
address: {
|
|
841
|
+
id: "123",
|
|
842
|
+
type: "primary",
|
|
843
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
844
|
+
name: "HQ US",
|
|
845
|
+
line1: "Main street",
|
|
846
|
+
line2: "apt #",
|
|
847
|
+
line3: "Suite #",
|
|
848
|
+
line4: "delivery instructions",
|
|
849
|
+
streetNumber: "25",
|
|
850
|
+
city: "San Francisco",
|
|
851
|
+
state: "CA",
|
|
852
|
+
postalCode: "94104",
|
|
853
|
+
country: "US",
|
|
854
|
+
latitude: "40.759211",
|
|
855
|
+
longitude: "-73.984638",
|
|
856
|
+
county: "Santa Clara",
|
|
857
|
+
contactName: "Elon Musk",
|
|
858
|
+
salutation: "Mr",
|
|
859
|
+
phoneNumber: "111-111-1111",
|
|
860
|
+
fax: "122-111-1111",
|
|
861
|
+
email: "elon@musk.com",
|
|
862
|
+
website: "https://elonmusk.com",
|
|
863
|
+
notes: "Address notes or delivery instructions.",
|
|
864
|
+
rowVersion: "1-12345",
|
|
865
|
+
},
|
|
866
|
+
},
|
|
867
|
+
departmentId: "12345",
|
|
868
|
+
locationId: "12345",
|
|
869
|
+
lineNumber: 1,
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
id: "12345",
|
|
873
|
+
description:
|
|
874
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
875
|
+
taxAmount: 27500,
|
|
876
|
+
subTotal: 27500,
|
|
877
|
+
totalAmount: 27500,
|
|
878
|
+
type: "debit",
|
|
879
|
+
taxRate: {
|
|
880
|
+
id: "123456",
|
|
881
|
+
code: "N-T",
|
|
882
|
+
name: "GST on Purchases",
|
|
883
|
+
rate: 10,
|
|
884
|
+
},
|
|
885
|
+
trackingCategories: [
|
|
886
|
+
{
|
|
887
|
+
id: "123456",
|
|
888
|
+
name: "New York",
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
id: "123456",
|
|
892
|
+
name: "New York",
|
|
893
|
+
},
|
|
894
|
+
],
|
|
895
|
+
ledgerAccount: {
|
|
896
|
+
id: "123456",
|
|
897
|
+
name: "Bank account",
|
|
898
|
+
nominalCode: "N091",
|
|
899
|
+
code: "453",
|
|
900
|
+
},
|
|
901
|
+
customer: {
|
|
902
|
+
id: "12345",
|
|
903
|
+
displayId: "CUST00101",
|
|
904
|
+
displayName: "Windsurf Shop",
|
|
905
|
+
companyName: "The boring company",
|
|
906
|
+
email: "boring@boring.com",
|
|
907
|
+
},
|
|
908
|
+
supplier: {
|
|
909
|
+
id: "12345",
|
|
910
|
+
displayId: "SUPP00101",
|
|
911
|
+
displayName: "Windsurf Shop",
|
|
912
|
+
companyName: "The boring company",
|
|
913
|
+
address: {
|
|
914
|
+
id: "123",
|
|
915
|
+
type: "primary",
|
|
916
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
917
|
+
name: "HQ US",
|
|
918
|
+
line1: "Main street",
|
|
919
|
+
line2: "apt #",
|
|
920
|
+
line3: "Suite #",
|
|
921
|
+
line4: "delivery instructions",
|
|
922
|
+
streetNumber: "25",
|
|
923
|
+
city: "San Francisco",
|
|
924
|
+
state: "CA",
|
|
925
|
+
postalCode: "94104",
|
|
926
|
+
country: "US",
|
|
927
|
+
latitude: "40.759211",
|
|
928
|
+
longitude: "-73.984638",
|
|
929
|
+
county: "Santa Clara",
|
|
930
|
+
contactName: "Elon Musk",
|
|
931
|
+
salutation: "Mr",
|
|
932
|
+
phoneNumber: "111-111-1111",
|
|
933
|
+
fax: "122-111-1111",
|
|
934
|
+
email: "elon@musk.com",
|
|
935
|
+
website: "https://elonmusk.com",
|
|
936
|
+
notes: "Address notes or delivery instructions.",
|
|
937
|
+
rowVersion: "1-12345",
|
|
938
|
+
},
|
|
939
|
+
},
|
|
940
|
+
departmentId: "12345",
|
|
941
|
+
locationId: "12345",
|
|
942
|
+
lineNumber: 1,
|
|
943
|
+
},
|
|
944
|
+
],
|
|
945
|
+
memo: "Thank you for your business and have a great day!",
|
|
946
|
+
postedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
947
|
+
journalSymbol: "IND",
|
|
948
|
+
taxType: "sales",
|
|
949
|
+
taxCode: "1234",
|
|
950
|
+
number: "OIT00546",
|
|
951
|
+
trackingCategories: [
|
|
952
|
+
{
|
|
953
|
+
id: "123456",
|
|
954
|
+
name: "New York",
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
id: "123456",
|
|
958
|
+
name: "New York",
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
id: "123456",
|
|
962
|
+
name: "New York",
|
|
963
|
+
},
|
|
964
|
+
],
|
|
965
|
+
accountingPeriod: "01-24",
|
|
966
|
+
updatedBy: "12345",
|
|
967
|
+
createdBy: "12345",
|
|
968
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
969
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
970
|
+
rowVersion: "1-12345",
|
|
971
|
+
customFields: [
|
|
972
|
+
{
|
|
973
|
+
id: "2389328923893298",
|
|
974
|
+
name: "employee_level",
|
|
975
|
+
description: "Employee Level",
|
|
976
|
+
value: true,
|
|
977
|
+
},
|
|
978
|
+
{
|
|
979
|
+
id: "2389328923893298",
|
|
980
|
+
name: "employee_level",
|
|
981
|
+
description: "Employee Level",
|
|
982
|
+
value: 10,
|
|
983
|
+
},
|
|
984
|
+
],
|
|
985
|
+
passThrough: [
|
|
986
|
+
{
|
|
987
|
+
serviceId: "<id>",
|
|
988
|
+
extendPaths: [
|
|
989
|
+
{
|
|
990
|
+
path: "$.nested.property",
|
|
991
|
+
value: {
|
|
992
|
+
"TaxClassificationRef": {
|
|
993
|
+
"value": "EUC-99990201-V1-00020000",
|
|
994
|
+
},
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
|
+
{
|
|
998
|
+
path: "$.nested.property",
|
|
999
|
+
value: {
|
|
1000
|
+
"TaxClassificationRef": {
|
|
1001
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1002
|
+
},
|
|
1003
|
+
},
|
|
1004
|
+
},
|
|
1005
|
+
{
|
|
1006
|
+
path: "$.nested.property",
|
|
1007
|
+
value: {
|
|
1008
|
+
"TaxClassificationRef": {
|
|
1009
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1010
|
+
},
|
|
1011
|
+
},
|
|
1012
|
+
},
|
|
1013
|
+
],
|
|
1014
|
+
},
|
|
1015
|
+
],
|
|
1016
|
+
},
|
|
1017
|
+
});
|
|
1018
|
+
});
|
|
1019
|
+
|
|
1020
|
+
it.skip("Journalentries Accounting Journal Entries Update", async () => {
|
|
1021
|
+
assert.fail(
|
|
1022
|
+
"incomplete test found please make sure to address the following errors: [`workflow step accounting.journalEntriesUpdate.test referencing operation accounting.journalEntriesUpdate with expression in requestBody with type not currently supported`]",
|
|
1023
|
+
);
|
|
1024
|
+
});
|
|
1025
|
+
|
|
1026
|
+
test("Journalentries Accounting Journal Entries Delete", async () => {
|
|
1027
|
+
const testHttpClient = createTestHTTPClient(
|
|
1028
|
+
"accounting.journalEntriesDelete",
|
|
1029
|
+
);
|
|
1030
|
+
|
|
1031
|
+
const apideck = new Apideck({
|
|
1032
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1033
|
+
httpClient: testHttpClient,
|
|
1034
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1035
|
+
});
|
|
1036
|
+
|
|
1037
|
+
const result = await apideck.accounting.journalEntries.delete({
|
|
1038
|
+
id: "<id>",
|
|
1039
|
+
serviceId: "salesforce",
|
|
1040
|
+
});
|
|
1041
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
1042
|
+
expect(result.deleteJournalEntryResponse).toBeDefined();
|
|
1043
|
+
expect(result.deleteJournalEntryResponse).toEqual({
|
|
1044
|
+
statusCode: 200,
|
|
1045
|
+
status: "OK",
|
|
1046
|
+
service: "quickbooks",
|
|
1047
|
+
resource: "journal-entries",
|
|
1048
|
+
operation: "delete",
|
|
1049
|
+
data: {
|
|
1050
|
+
id: "12345",
|
|
1051
|
+
},
|
|
1052
|
+
});
|
|
1053
|
+
});
|