@apideck/unify 0.27.0 → 0.28.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/README.md +5 -5
- package/docs/sdks/categories/README.md +12 -0
- package/docs/sdks/companies/README.md +4 -4
- package/examples/README.md +26 -0
- package/examples/accountingTaxRatesList.example.ts +41 -0
- package/examples/package-lock.json +613 -0
- package/examples/package.json +18 -0
- package/funcs/accountingCategoriesGet.d.ts.map +1 -1
- package/funcs/accountingCategoriesGet.js +4 -2
- package/funcs/accountingCategoriesGet.js.map +1 -1
- package/funcs/accountingCategoriesList.d.ts.map +1 -1
- package/funcs/accountingCategoriesList.js +4 -2
- package/funcs/accountingCategoriesList.js.map +1 -1
- package/funcs/crmCompaniesCreate.js +1 -1
- package/funcs/crmCompaniesCreate.js.map +1 -1
- package/funcs/crmCompaniesUpdate.js +1 -1
- package/funcs/crmCompaniesUpdate.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +4 -4
- package/lib/config.js +4 -4
- package/models/components/balancesheetfilter.d.ts +5 -0
- package/models/components/balancesheetfilter.d.ts.map +1 -1
- package/models/components/balancesheetfilter.js +4 -0
- package/models/components/balancesheetfilter.js.map +1 -1
- package/models/components/bankaccount.d.ts +5 -0
- package/models/components/bankaccount.d.ts.map +1 -1
- package/models/components/bankaccount.js +2 -0
- package/models/components/bankaccount.js.map +1 -1
- package/models/components/bankaccount1.d.ts +123 -0
- package/models/components/bankaccount1.d.ts.map +1 -0
- package/models/components/bankaccount1.js +128 -0
- package/models/components/bankaccount1.js.map +1 -0
- package/models/components/categoriesfilter.d.ts +67 -0
- package/models/components/categoriesfilter.d.ts.map +1 -0
- package/models/components/categoriesfilter.js +82 -0
- package/models/components/categoriesfilter.js.map +1 -0
- package/models/components/category.d.ts +39 -0
- package/models/components/category.d.ts.map +1 -1
- package/models/components/category.js +26 -1
- package/models/components/category.js.map +1 -1
- package/models/components/{company.d.ts → company1.d.ts} +32 -32
- package/models/components/company1.d.ts.map +1 -0
- package/models/components/{company.js → company1.js} +37 -37
- package/models/components/company1.js.map +1 -0
- package/models/components/companyinfo.d.ts +5 -0
- package/models/components/companyinfo.d.ts.map +1 -1
- package/models/components/companyinfo.js +4 -0
- package/models/components/companyinfo.js.map +1 -1
- package/models/components/connection.d.ts +13 -13
- package/models/components/connection.d.ts.map +1 -1
- package/models/components/connection.js +16 -17
- package/models/components/connection.js.map +1 -1
- package/models/components/customfield.d.ts +37 -38
- package/models/components/customfield.d.ts.map +1 -1
- package/models/components/customfield.js +25 -54
- package/models/components/customfield.js.map +1 -1
- package/models/components/getcompaniesresponse.d.ts +3 -3
- package/models/components/getcompaniesresponse.d.ts.map +1 -1
- package/models/components/getcompaniesresponse.js +3 -3
- package/models/components/getcompaniesresponse.js.map +1 -1
- package/models/components/getcompanyresponse.d.ts +3 -3
- package/models/components/getcompanyresponse.d.ts.map +1 -1
- package/models/components/getcompanyresponse.js +3 -3
- package/models/components/getcompanyresponse.js.map +1 -1
- package/models/components/index.d.ts +3 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +3 -1
- package/models/components/index.js.map +1 -1
- package/models/components/invoicelineitem.d.ts +10 -0
- package/models/components/invoicelineitem.d.ts.map +1 -1
- package/models/components/invoicelineitem.js +8 -0
- package/models/components/invoicelineitem.js.map +1 -1
- package/models/components/profitandlossfilter.d.ts +5 -0
- package/models/components/profitandlossfilter.d.ts.map +1 -1
- package/models/components/profitandlossfilter.js +4 -0
- package/models/components/profitandlossfilter.js.map +1 -1
- package/models/components/simpleformfieldoption.d.ts +13 -13
- package/models/components/simpleformfieldoption.d.ts.map +1 -1
- package/models/components/simpleformfieldoption.js +16 -16
- package/models/components/simpleformfieldoption.js.map +1 -1
- package/models/components/supplier.d.ts +10 -0
- package/models/components/supplier.d.ts.map +1 -1
- package/models/components/supplier.js +4 -0
- package/models/components/supplier.js.map +1 -1
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +8 -2
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/badrequestresponse.js +1 -1
- package/models/errors/badrequestresponse.js.map +1 -1
- package/models/errors/notfoundresponse.js +1 -1
- package/models/errors/notfoundresponse.js.map +1 -1
- package/models/errors/paymentrequiredresponse.js +1 -1
- package/models/errors/paymentrequiredresponse.js.map +1 -1
- package/models/errors/unauthorizedresponse.js +1 -1
- package/models/errors/unauthorizedresponse.js.map +1 -1
- package/models/errors/unprocessableresponse.js +1 -1
- package/models/errors/unprocessableresponse.js.map +1 -1
- package/models/operations/accountingcategoriesall.d.ts +5 -0
- package/models/operations/accountingcategoriesall.d.ts.map +1 -1
- package/models/operations/accountingcategoriesall.js +2 -0
- package/models/operations/accountingcategoriesall.js.map +1 -1
- package/models/operations/accountingcategoriesone.d.ts +5 -0
- package/models/operations/accountingcategoriesone.d.ts.map +1 -1
- package/models/operations/accountingcategoriesone.js +2 -0
- package/models/operations/accountingcategoriesone.js.map +1 -1
- package/models/operations/crmcompaniesadd.d.ts +2 -2
- package/models/operations/crmcompaniesadd.d.ts.map +1 -1
- package/models/operations/crmcompaniesadd.js +4 -4
- package/models/operations/crmcompaniesadd.js.map +1 -1
- package/models/operations/crmcompaniesupdate.d.ts +2 -2
- package/models/operations/crmcompaniesupdate.d.ts.map +1 -1
- package/models/operations/crmcompaniesupdate.js +4 -4
- package/models/operations/crmcompaniesupdate.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/activities.test.ts +364 -13
- package/src/__tests__/apideckcompanies.test.ts +373 -9
- package/src/__tests__/apideckdepartments.test.ts +181 -9
- package/src/__tests__/applicants.test.ts +473 -9
- package/src/__tests__/applications.test.ts +189 -9
- package/src/__tests__/bankfeedaccounts.test.ts +4 -4
- package/src/__tests__/billpayments.test.ts +378 -20
- package/src/__tests__/bills.test.ts +500 -9
- package/src/__tests__/collectionticketcomments.test.ts +183 -7
- package/src/__tests__/collectiontickets.test.ts +191 -7
- package/src/__tests__/companies.test.ts +607 -78
- package/src/__tests__/connections.test.ts +409 -5
- package/src/__tests__/connectionsettings.test.ts +410 -5
- package/src/__tests__/contacts.test.ts +470 -13
- package/src/__tests__/creditnotes.test.ts +819 -148
- package/src/__tests__/customers.test.ts +517 -13
- package/src/__tests__/customobjects.test.ts +150 -9
- package/src/__tests__/customobjectschemas.test.ts +321 -9
- package/src/__tests__/departments.test.ts +173 -9
- package/src/__tests__/drivegroups.test.ts +181 -9
- package/src/__tests__/drives.test.ts +179 -9
- package/src/__tests__/employees.test.ts +829 -94
- package/src/__tests__/expenses.test.ts +338 -15
- package/src/__tests__/files.test.ts +106 -5
- package/src/__tests__/folders.test.ts +296 -13
- package/src/__tests__/invoiceitems.test.ts +272 -9
- package/src/__tests__/invoices.test.ts +695 -89
- package/src/__tests__/journalentries.test.ts +490 -8
- package/src/__tests__/leads.test.ts +450 -13
- package/src/__tests__/ledgeraccounts.test.ts +248 -19
- package/src/__tests__/locations.test.ts +298 -9
- package/src/__tests__/messages.test.ts +195 -9
- package/src/__tests__/notes.test.ts +191 -9
- package/src/__tests__/opportunities.test.ts +218 -9
- package/src/__tests__/payments.test.ts +323 -20
- package/src/__tests__/pipelines.test.ts +194 -9
- package/src/__tests__/purchaseorders.test.ts +847 -178
- package/src/__tests__/sharedlinks.test.ts +183 -9
- package/src/__tests__/subsidiaries.test.ts +183 -9
- package/src/__tests__/suppliers.test.ts +509 -13
- package/src/__tests__/taxrates.test.ts +235 -12
- package/src/__tests__/timeoffrequests.test.ts +210 -9
- package/src/__tests__/trackingcategories.test.ts +187 -7
- package/src/__tests__/uploadsessions.test.ts +78 -5
- package/src/__tests__/users.test.ts +356 -9
- package/src/funcs/accountingCategoriesGet.ts +15 -5
- package/src/funcs/accountingCategoriesList.ts +17 -7
- package/src/funcs/crmCompaniesCreate.ts +1 -1
- package/src/funcs/crmCompaniesUpdate.ts +1 -1
- package/src/lib/config.ts +4 -4
- package/src/models/components/balancesheetfilter.ts +9 -0
- package/src/models/components/bankaccount.ts +7 -0
- package/src/models/components/bankaccount1.ts +207 -0
- package/src/models/components/categoriesfilter.ts +104 -0
- package/src/models/components/category.ts +39 -0
- package/src/models/components/{company.ts → company1.ts} +131 -128
- package/src/models/components/companyinfo.ts +9 -0
- package/src/models/components/connection.ts +27 -20
- package/src/models/components/customfield.ts +51 -83
- package/src/models/components/getcompaniesresponse.ts +9 -9
- package/src/models/components/getcompanyresponse.ts +9 -9
- package/src/models/components/index.ts +3 -1
- package/src/models/components/invoicelineitem.ts +18 -0
- package/src/models/components/profitandlossfilter.ts +9 -0
- package/src/models/components/simpleformfieldoption.ts +21 -18
- package/src/models/components/supplier.ts +14 -0
- package/src/models/errors/apierror.ts +8 -2
- package/src/models/errors/badrequestresponse.ts +1 -1
- package/src/models/errors/notfoundresponse.ts +1 -1
- package/src/models/errors/paymentrequiredresponse.ts +1 -1
- package/src/models/errors/unauthorizedresponse.ts +1 -1
- package/src/models/errors/unprocessableresponse.ts +1 -1
- package/src/models/operations/accountingcategoriesall.ts +7 -0
- package/src/models/operations/accountingcategoriesone.ts +7 -0
- package/src/models/operations/crmcompaniesadd.ts +6 -6
- package/src/models/operations/crmcompaniesupdate.ts +6 -6
- package/models/components/company.d.ts.map +0 -1
- package/models/components/company.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { expect, test } from "vitest";
|
|
6
6
|
import { Apideck } from "../index.js";
|
|
7
7
|
import { RFCDate } from "../types/index.js";
|
|
8
8
|
import { createTestHTTPClient } from "./testclient.js";
|
|
@@ -455,10 +455,10 @@ test("Purchaseorders Accounting Purchase Orders All", async () => {
|
|
|
455
455
|
id: "2389328923893298",
|
|
456
456
|
name: "employee_level",
|
|
457
457
|
description: "Employee Level",
|
|
458
|
-
value:
|
|
459
|
-
{},
|
|
460
|
-
{},
|
|
461
|
-
|
|
458
|
+
value: {
|
|
459
|
+
"0": {},
|
|
460
|
+
"1": {},
|
|
461
|
+
},
|
|
462
462
|
},
|
|
463
463
|
],
|
|
464
464
|
rowVersion: "1-12345",
|
|
@@ -832,17 +832,17 @@ test("Purchaseorders Accounting Purchase Orders All", async () => {
|
|
|
832
832
|
id: "2389328923893298",
|
|
833
833
|
name: "employee_level",
|
|
834
834
|
description: "Employee Level",
|
|
835
|
-
value:
|
|
836
|
-
{},
|
|
837
|
-
|
|
835
|
+
value: {
|
|
836
|
+
"0": {},
|
|
837
|
+
},
|
|
838
838
|
},
|
|
839
839
|
{
|
|
840
840
|
id: "2389328923893298",
|
|
841
841
|
name: "employee_level",
|
|
842
842
|
description: "Employee Level",
|
|
843
|
-
value:
|
|
844
|
-
{},
|
|
845
|
-
|
|
843
|
+
value: {
|
|
844
|
+
"0": {},
|
|
845
|
+
},
|
|
846
846
|
},
|
|
847
847
|
],
|
|
848
848
|
rowVersion: "1-12345",
|
|
@@ -1013,14 +1013,8 @@ test("Purchaseorders Accounting Purchase Orders All", async () => {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
});
|
|
1015
1015
|
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
"incomplete test found please make sure to address the following errors: [`workflow step accounting.purchaseOrdersAdd.test referencing operation accounting.purchaseOrdersAdd with expression in requestBody with type not currently supported`]",
|
|
1019
|
-
);
|
|
1020
|
-
});
|
|
1021
|
-
|
|
1022
|
-
test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
1023
|
-
const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersOne");
|
|
1016
|
+
test("Purchaseorders Accounting Purchase Orders Add", async () => {
|
|
1017
|
+
const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersAdd");
|
|
1024
1018
|
|
|
1025
1019
|
const apideck = new Apideck({
|
|
1026
1020
|
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
@@ -1028,30 +1022,16 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1028
1022
|
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1029
1023
|
});
|
|
1030
1024
|
|
|
1031
|
-
const result = await apideck.accounting.purchaseOrders.
|
|
1032
|
-
id: "<id>",
|
|
1025
|
+
const result = await apideck.accounting.purchaseOrders.create({
|
|
1033
1026
|
consumerId: "test-consumer",
|
|
1034
1027
|
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
1035
1028
|
serviceId: "salesforce",
|
|
1036
|
-
|
|
1037
|
-
expect(result.httpMeta.response.status).toBe(200);
|
|
1038
|
-
expect(result.getPurchaseOrderResponse).toBeDefined();
|
|
1039
|
-
expect(result.getPurchaseOrderResponse).toEqual({
|
|
1040
|
-
statusCode: 200,
|
|
1041
|
-
status: "OK",
|
|
1042
|
-
service: "quickbooks",
|
|
1043
|
-
resource: "PurchaseOrders",
|
|
1044
|
-
operation: "one",
|
|
1045
|
-
data: {
|
|
1046
|
-
id: "12345",
|
|
1047
|
-
downstreamId: "12345",
|
|
1029
|
+
purchaseOrder: {
|
|
1048
1030
|
poNumber: "90000117",
|
|
1049
1031
|
reference: "123456",
|
|
1050
1032
|
supplier: {
|
|
1051
1033
|
id: "12345",
|
|
1052
|
-
displayId: "SUPP00101",
|
|
1053
1034
|
displayName: "Windsurf Shop",
|
|
1054
|
-
companyName: "The boring company",
|
|
1055
1035
|
address: {
|
|
1056
1036
|
id: "123",
|
|
1057
1037
|
type: "primary",
|
|
@@ -1115,8 +1095,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1115
1095
|
},
|
|
1116
1096
|
taxRate: {
|
|
1117
1097
|
id: "123456",
|
|
1118
|
-
code: "N-T",
|
|
1119
|
-
name: "GST on Purchases",
|
|
1120
1098
|
rate: 10,
|
|
1121
1099
|
},
|
|
1122
1100
|
trackingCategories: [
|
|
@@ -1131,7 +1109,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1131
1109
|
],
|
|
1132
1110
|
ledgerAccount: {
|
|
1133
1111
|
id: "123456",
|
|
1134
|
-
name: "Bank account",
|
|
1135
1112
|
nominalCode: "N091",
|
|
1136
1113
|
code: "453",
|
|
1137
1114
|
},
|
|
@@ -1140,80 +1117,16 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1140
1117
|
id: "2389328923893298",
|
|
1141
1118
|
name: "employee_level",
|
|
1142
1119
|
description: "Employee Level",
|
|
1143
|
-
value:
|
|
1144
|
-
},
|
|
1145
|
-
{
|
|
1146
|
-
id: "2389328923893298",
|
|
1147
|
-
name: "employee_level",
|
|
1148
|
-
description: "Employee Level",
|
|
1149
|
-
value: [
|
|
1150
|
-
{},
|
|
1151
|
-
],
|
|
1152
|
-
},
|
|
1153
|
-
],
|
|
1154
|
-
rowVersion: "1-12345",
|
|
1155
|
-
updatedBy: "12345",
|
|
1156
|
-
createdBy: "12345",
|
|
1157
|
-
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1158
|
-
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1159
|
-
},
|
|
1160
|
-
{
|
|
1161
|
-
id: "12345",
|
|
1162
|
-
rowId: "12345",
|
|
1163
|
-
code: "120-C",
|
|
1164
|
-
lineNumber: 1,
|
|
1165
|
-
description:
|
|
1166
|
-
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1167
|
-
type: "sales_item",
|
|
1168
|
-
taxAmount: 27500,
|
|
1169
|
-
totalAmount: 27500,
|
|
1170
|
-
quantity: 1,
|
|
1171
|
-
unitPrice: 27500.5,
|
|
1172
|
-
unitOfMeasure: "pc.",
|
|
1173
|
-
discountPercentage: 0.01,
|
|
1174
|
-
discountAmount: 19.99,
|
|
1175
|
-
locationId: "12345",
|
|
1176
|
-
departmentId: "12345",
|
|
1177
|
-
item: {
|
|
1178
|
-
id: "12344",
|
|
1179
|
-
code: "120-C",
|
|
1180
|
-
name: "Model Y",
|
|
1181
|
-
},
|
|
1182
|
-
taxRate: {
|
|
1183
|
-
id: "123456",
|
|
1184
|
-
code: "N-T",
|
|
1185
|
-
name: "GST on Purchases",
|
|
1186
|
-
rate: 10,
|
|
1187
|
-
},
|
|
1188
|
-
trackingCategories: [
|
|
1189
|
-
{
|
|
1190
|
-
id: "123456",
|
|
1191
|
-
name: "New York",
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
id: "123456",
|
|
1195
|
-
name: "New York",
|
|
1120
|
+
value: "Uses Salesforce and Marketo",
|
|
1196
1121
|
},
|
|
1197
|
-
],
|
|
1198
|
-
ledgerAccount: {
|
|
1199
|
-
id: "123456",
|
|
1200
|
-
name: "Bank account",
|
|
1201
|
-
nominalCode: "N091",
|
|
1202
|
-
code: "453",
|
|
1203
|
-
},
|
|
1204
|
-
customFields: [
|
|
1205
1122
|
{
|
|
1206
1123
|
id: "2389328923893298",
|
|
1207
1124
|
name: "employee_level",
|
|
1208
1125
|
description: "Employee Level",
|
|
1209
|
-
value:
|
|
1126
|
+
value: "Uses Salesforce and Marketo",
|
|
1210
1127
|
},
|
|
1211
1128
|
],
|
|
1212
1129
|
rowVersion: "1-12345",
|
|
1213
|
-
updatedBy: "12345",
|
|
1214
|
-
createdBy: "12345",
|
|
1215
|
-
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1216
|
-
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1217
1130
|
},
|
|
1218
1131
|
{
|
|
1219
1132
|
id: "12345",
|
|
@@ -1239,8 +1152,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1239
1152
|
},
|
|
1240
1153
|
taxRate: {
|
|
1241
1154
|
id: "123456",
|
|
1242
|
-
code: "N-T",
|
|
1243
|
-
name: "GST on Purchases",
|
|
1244
1155
|
rate: 10,
|
|
1245
1156
|
},
|
|
1246
1157
|
trackingCategories: [
|
|
@@ -1259,7 +1170,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1259
1170
|
],
|
|
1260
1171
|
ledgerAccount: {
|
|
1261
1172
|
id: "123456",
|
|
1262
|
-
name: "Bank account",
|
|
1263
1173
|
nominalCode: "N091",
|
|
1264
1174
|
code: "453",
|
|
1265
1175
|
},
|
|
@@ -1268,7 +1178,7 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1268
1178
|
id: "2389328923893298",
|
|
1269
1179
|
name: "employee_level",
|
|
1270
1180
|
description: "Employee Level",
|
|
1271
|
-
value:
|
|
1181
|
+
value: "Uses Salesforce and Marketo",
|
|
1272
1182
|
},
|
|
1273
1183
|
{
|
|
1274
1184
|
id: "2389328923893298",
|
|
@@ -1276,12 +1186,14 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1276
1186
|
description: "Employee Level",
|
|
1277
1187
|
value: 10,
|
|
1278
1188
|
},
|
|
1189
|
+
{
|
|
1190
|
+
id: "2389328923893298",
|
|
1191
|
+
name: "employee_level",
|
|
1192
|
+
description: "Employee Level",
|
|
1193
|
+
value: "Uses Salesforce and Marketo",
|
|
1194
|
+
},
|
|
1279
1195
|
],
|
|
1280
1196
|
rowVersion: "1-12345",
|
|
1281
|
-
updatedBy: "12345",
|
|
1282
|
-
createdBy: "12345",
|
|
1283
|
-
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1284
|
-
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1285
1197
|
},
|
|
1286
1198
|
],
|
|
1287
1199
|
shippingAddress: {
|
|
@@ -1312,7 +1224,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1312
1224
|
},
|
|
1313
1225
|
ledgerAccount: {
|
|
1314
1226
|
id: "123456",
|
|
1315
|
-
name: "Bank account",
|
|
1316
1227
|
nominalCode: "N091",
|
|
1317
1228
|
code: "453",
|
|
1318
1229
|
},
|
|
@@ -1342,6 +1253,14 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1342
1253
|
id: "123456",
|
|
1343
1254
|
name: "New York",
|
|
1344
1255
|
},
|
|
1256
|
+
{
|
|
1257
|
+
id: "123456",
|
|
1258
|
+
name: "New York",
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
id: "123456",
|
|
1262
|
+
name: "New York",
|
|
1263
|
+
},
|
|
1345
1264
|
],
|
|
1346
1265
|
customFields: [
|
|
1347
1266
|
{
|
|
@@ -1350,63 +1269,25 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1350
1269
|
description: "Employee Level",
|
|
1351
1270
|
value: {},
|
|
1352
1271
|
},
|
|
1353
|
-
],
|
|
1354
|
-
rowVersion: "1-12345",
|
|
1355
|
-
updatedBy: "12345",
|
|
1356
|
-
createdBy: "12345",
|
|
1357
|
-
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1358
|
-
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1359
|
-
passThrough: [
|
|
1360
1272
|
{
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
},
|
|
1370
|
-
},
|
|
1371
|
-
{
|
|
1372
|
-
path: "$.nested.property",
|
|
1373
|
-
value: {
|
|
1374
|
-
"TaxClassificationRef": {
|
|
1375
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1376
|
-
},
|
|
1377
|
-
},
|
|
1378
|
-
},
|
|
1379
|
-
],
|
|
1273
|
+
id: "2389328923893298",
|
|
1274
|
+
name: "employee_level",
|
|
1275
|
+
description: "Employee Level",
|
|
1276
|
+
value: {
|
|
1277
|
+
"0": "<value>",
|
|
1278
|
+
"1": "<value>",
|
|
1279
|
+
"2": "<value>",
|
|
1280
|
+
},
|
|
1380
1281
|
},
|
|
1381
1282
|
{
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
value: {
|
|
1387
|
-
"TaxClassificationRef": {
|
|
1388
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1389
|
-
},
|
|
1390
|
-
},
|
|
1391
|
-
},
|
|
1392
|
-
{
|
|
1393
|
-
path: "$.nested.property",
|
|
1394
|
-
value: {
|
|
1395
|
-
"TaxClassificationRef": {
|
|
1396
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1397
|
-
},
|
|
1398
|
-
},
|
|
1399
|
-
},
|
|
1400
|
-
{
|
|
1401
|
-
path: "$.nested.property",
|
|
1402
|
-
value: {
|
|
1403
|
-
"TaxClassificationRef": {
|
|
1404
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1405
|
-
},
|
|
1406
|
-
},
|
|
1407
|
-
},
|
|
1408
|
-
],
|
|
1283
|
+
id: "2389328923893298",
|
|
1284
|
+
name: "employee_level",
|
|
1285
|
+
description: "Employee Level",
|
|
1286
|
+
value: true,
|
|
1409
1287
|
},
|
|
1288
|
+
],
|
|
1289
|
+
rowVersion: "1-12345",
|
|
1290
|
+
passThrough: [
|
|
1410
1291
|
{
|
|
1411
1292
|
serviceId: "<id>",
|
|
1412
1293
|
extendPaths: [
|
|
@@ -1418,25 +1299,813 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1418
1299
|
},
|
|
1419
1300
|
},
|
|
1420
1301
|
},
|
|
1421
|
-
{
|
|
1422
|
-
path: "$.nested.property",
|
|
1423
|
-
value: {
|
|
1424
|
-
"TaxClassificationRef": {
|
|
1425
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1428
|
-
},
|
|
1429
1302
|
],
|
|
1430
1303
|
},
|
|
1431
1304
|
],
|
|
1432
1305
|
},
|
|
1433
1306
|
});
|
|
1307
|
+
expect(result.httpMeta.response.status).toBe(201);
|
|
1308
|
+
expect(result.createPurchaseOrderResponse).toBeDefined();
|
|
1309
|
+
expect(result.createPurchaseOrderResponse).toEqual({
|
|
1310
|
+
statusCode: 200,
|
|
1311
|
+
status: "OK",
|
|
1312
|
+
service: "quickbooks",
|
|
1313
|
+
resource: "PurchaseOrders",
|
|
1314
|
+
operation: "add",
|
|
1315
|
+
data: {
|
|
1316
|
+
id: "12345",
|
|
1317
|
+
},
|
|
1318
|
+
});
|
|
1434
1319
|
});
|
|
1435
1320
|
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1321
|
+
test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
1322
|
+
const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersOne");
|
|
1323
|
+
|
|
1324
|
+
const apideck = new Apideck({
|
|
1325
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1326
|
+
httpClient: testHttpClient,
|
|
1327
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1328
|
+
});
|
|
1329
|
+
|
|
1330
|
+
const result = await apideck.accounting.purchaseOrders.get({
|
|
1331
|
+
id: "<id>",
|
|
1332
|
+
consumerId: "test-consumer",
|
|
1333
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
1334
|
+
serviceId: "salesforce",
|
|
1335
|
+
});
|
|
1336
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
1337
|
+
expect(result.getPurchaseOrderResponse).toBeDefined();
|
|
1338
|
+
expect(result.getPurchaseOrderResponse).toEqual({
|
|
1339
|
+
statusCode: 200,
|
|
1340
|
+
status: "OK",
|
|
1341
|
+
service: "quickbooks",
|
|
1342
|
+
resource: "PurchaseOrders",
|
|
1343
|
+
operation: "one",
|
|
1344
|
+
data: {
|
|
1345
|
+
id: "12345",
|
|
1346
|
+
downstreamId: "12345",
|
|
1347
|
+
poNumber: "90000117",
|
|
1348
|
+
reference: "123456",
|
|
1349
|
+
supplier: {
|
|
1350
|
+
id: "12345",
|
|
1351
|
+
displayId: "SUPP00101",
|
|
1352
|
+
displayName: "Windsurf Shop",
|
|
1353
|
+
companyName: "The boring company",
|
|
1354
|
+
address: {
|
|
1355
|
+
id: "123",
|
|
1356
|
+
type: "primary",
|
|
1357
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1358
|
+
name: "HQ US",
|
|
1359
|
+
line1: "Main street",
|
|
1360
|
+
line2: "apt #",
|
|
1361
|
+
line3: "Suite #",
|
|
1362
|
+
line4: "delivery instructions",
|
|
1363
|
+
streetNumber: "25",
|
|
1364
|
+
city: "San Francisco",
|
|
1365
|
+
state: "CA",
|
|
1366
|
+
postalCode: "94104",
|
|
1367
|
+
country: "US",
|
|
1368
|
+
latitude: "40.759211",
|
|
1369
|
+
longitude: "-73.984638",
|
|
1370
|
+
county: "Santa Clara",
|
|
1371
|
+
contactName: "Elon Musk",
|
|
1372
|
+
salutation: "Mr",
|
|
1373
|
+
phoneNumber: "111-111-1111",
|
|
1374
|
+
fax: "122-111-1111",
|
|
1375
|
+
email: "elon@musk.com",
|
|
1376
|
+
website: "https://elonmusk.com",
|
|
1377
|
+
notes: "Address notes or delivery instructions.",
|
|
1378
|
+
rowVersion: "1-12345",
|
|
1379
|
+
},
|
|
1380
|
+
},
|
|
1381
|
+
companyId: "12345",
|
|
1382
|
+
status: "open",
|
|
1383
|
+
issuedDate: new RFCDate("2020-09-30"),
|
|
1384
|
+
deliveryDate: new RFCDate("2020-09-30"),
|
|
1385
|
+
expectedArrivalDate: new RFCDate("2020-09-30"),
|
|
1386
|
+
currency: "USD",
|
|
1387
|
+
currencyRate: 0.69,
|
|
1388
|
+
subTotal: 27500,
|
|
1389
|
+
totalTax: 2500,
|
|
1390
|
+
total: 27500,
|
|
1391
|
+
taxInclusive: true,
|
|
1392
|
+
lineItems: [
|
|
1393
|
+
{
|
|
1394
|
+
id: "12345",
|
|
1395
|
+
rowId: "12345",
|
|
1396
|
+
code: "120-C",
|
|
1397
|
+
lineNumber: 1,
|
|
1398
|
+
description:
|
|
1399
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1400
|
+
type: "sales_item",
|
|
1401
|
+
taxAmount: 27500,
|
|
1402
|
+
totalAmount: 27500,
|
|
1403
|
+
quantity: 1,
|
|
1404
|
+
unitPrice: 27500.5,
|
|
1405
|
+
unitOfMeasure: "pc.",
|
|
1406
|
+
discountPercentage: 0.01,
|
|
1407
|
+
discountAmount: 19.99,
|
|
1408
|
+
locationId: "12345",
|
|
1409
|
+
departmentId: "12345",
|
|
1410
|
+
item: {
|
|
1411
|
+
id: "12344",
|
|
1412
|
+
code: "120-C",
|
|
1413
|
+
name: "Model Y",
|
|
1414
|
+
},
|
|
1415
|
+
taxRate: {
|
|
1416
|
+
id: "123456",
|
|
1417
|
+
code: "N-T",
|
|
1418
|
+
name: "GST on Purchases",
|
|
1419
|
+
rate: 10,
|
|
1420
|
+
},
|
|
1421
|
+
trackingCategories: [
|
|
1422
|
+
{
|
|
1423
|
+
id: "123456",
|
|
1424
|
+
name: "New York",
|
|
1425
|
+
},
|
|
1426
|
+
{
|
|
1427
|
+
id: "123456",
|
|
1428
|
+
name: "New York",
|
|
1429
|
+
},
|
|
1430
|
+
],
|
|
1431
|
+
ledgerAccount: {
|
|
1432
|
+
id: "123456",
|
|
1433
|
+
name: "Bank account",
|
|
1434
|
+
nominalCode: "N091",
|
|
1435
|
+
code: "453",
|
|
1436
|
+
},
|
|
1437
|
+
customFields: [
|
|
1438
|
+
{
|
|
1439
|
+
id: "2389328923893298",
|
|
1440
|
+
name: "employee_level",
|
|
1441
|
+
description: "Employee Level",
|
|
1442
|
+
value: {},
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
id: "2389328923893298",
|
|
1446
|
+
name: "employee_level",
|
|
1447
|
+
description: "Employee Level",
|
|
1448
|
+
value: {
|
|
1449
|
+
"0": {},
|
|
1450
|
+
},
|
|
1451
|
+
},
|
|
1452
|
+
],
|
|
1453
|
+
rowVersion: "1-12345",
|
|
1454
|
+
updatedBy: "12345",
|
|
1455
|
+
createdBy: "12345",
|
|
1456
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1457
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
id: "12345",
|
|
1461
|
+
rowId: "12345",
|
|
1462
|
+
code: "120-C",
|
|
1463
|
+
lineNumber: 1,
|
|
1464
|
+
description:
|
|
1465
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1466
|
+
type: "sales_item",
|
|
1467
|
+
taxAmount: 27500,
|
|
1468
|
+
totalAmount: 27500,
|
|
1469
|
+
quantity: 1,
|
|
1470
|
+
unitPrice: 27500.5,
|
|
1471
|
+
unitOfMeasure: "pc.",
|
|
1472
|
+
discountPercentage: 0.01,
|
|
1473
|
+
discountAmount: 19.99,
|
|
1474
|
+
locationId: "12345",
|
|
1475
|
+
departmentId: "12345",
|
|
1476
|
+
item: {
|
|
1477
|
+
id: "12344",
|
|
1478
|
+
code: "120-C",
|
|
1479
|
+
name: "Model Y",
|
|
1480
|
+
},
|
|
1481
|
+
taxRate: {
|
|
1482
|
+
id: "123456",
|
|
1483
|
+
code: "N-T",
|
|
1484
|
+
name: "GST on Purchases",
|
|
1485
|
+
rate: 10,
|
|
1486
|
+
},
|
|
1487
|
+
trackingCategories: [
|
|
1488
|
+
{
|
|
1489
|
+
id: "123456",
|
|
1490
|
+
name: "New York",
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
id: "123456",
|
|
1494
|
+
name: "New York",
|
|
1495
|
+
},
|
|
1496
|
+
],
|
|
1497
|
+
ledgerAccount: {
|
|
1498
|
+
id: "123456",
|
|
1499
|
+
name: "Bank account",
|
|
1500
|
+
nominalCode: "N091",
|
|
1501
|
+
code: "453",
|
|
1502
|
+
},
|
|
1503
|
+
customFields: [
|
|
1504
|
+
{
|
|
1505
|
+
id: "2389328923893298",
|
|
1506
|
+
name: "employee_level",
|
|
1507
|
+
description: "Employee Level",
|
|
1508
|
+
value: 10,
|
|
1509
|
+
},
|
|
1510
|
+
],
|
|
1511
|
+
rowVersion: "1-12345",
|
|
1512
|
+
updatedBy: "12345",
|
|
1513
|
+
createdBy: "12345",
|
|
1514
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1515
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
id: "12345",
|
|
1519
|
+
rowId: "12345",
|
|
1520
|
+
code: "120-C",
|
|
1521
|
+
lineNumber: 1,
|
|
1522
|
+
description:
|
|
1523
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1524
|
+
type: "sales_item",
|
|
1525
|
+
taxAmount: 27500,
|
|
1526
|
+
totalAmount: 27500,
|
|
1527
|
+
quantity: 1,
|
|
1528
|
+
unitPrice: 27500.5,
|
|
1529
|
+
unitOfMeasure: "pc.",
|
|
1530
|
+
discountPercentage: 0.01,
|
|
1531
|
+
discountAmount: 19.99,
|
|
1532
|
+
locationId: "12345",
|
|
1533
|
+
departmentId: "12345",
|
|
1534
|
+
item: {
|
|
1535
|
+
id: "12344",
|
|
1536
|
+
code: "120-C",
|
|
1537
|
+
name: "Model Y",
|
|
1538
|
+
},
|
|
1539
|
+
taxRate: {
|
|
1540
|
+
id: "123456",
|
|
1541
|
+
code: "N-T",
|
|
1542
|
+
name: "GST on Purchases",
|
|
1543
|
+
rate: 10,
|
|
1544
|
+
},
|
|
1545
|
+
trackingCategories: [
|
|
1546
|
+
{
|
|
1547
|
+
id: "123456",
|
|
1548
|
+
name: "New York",
|
|
1549
|
+
},
|
|
1550
|
+
{
|
|
1551
|
+
id: "123456",
|
|
1552
|
+
name: "New York",
|
|
1553
|
+
},
|
|
1554
|
+
{
|
|
1555
|
+
id: "123456",
|
|
1556
|
+
name: "New York",
|
|
1557
|
+
},
|
|
1558
|
+
],
|
|
1559
|
+
ledgerAccount: {
|
|
1560
|
+
id: "123456",
|
|
1561
|
+
name: "Bank account",
|
|
1562
|
+
nominalCode: "N091",
|
|
1563
|
+
code: "453",
|
|
1564
|
+
},
|
|
1565
|
+
customFields: [
|
|
1566
|
+
{
|
|
1567
|
+
id: "2389328923893298",
|
|
1568
|
+
name: "employee_level",
|
|
1569
|
+
description: "Employee Level",
|
|
1570
|
+
value: {},
|
|
1571
|
+
},
|
|
1572
|
+
{
|
|
1573
|
+
id: "2389328923893298",
|
|
1574
|
+
name: "employee_level",
|
|
1575
|
+
description: "Employee Level",
|
|
1576
|
+
value: 10,
|
|
1577
|
+
},
|
|
1578
|
+
],
|
|
1579
|
+
rowVersion: "1-12345",
|
|
1580
|
+
updatedBy: "12345",
|
|
1581
|
+
createdBy: "12345",
|
|
1582
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1583
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1584
|
+
},
|
|
1585
|
+
],
|
|
1586
|
+
shippingAddress: {
|
|
1587
|
+
id: "123",
|
|
1588
|
+
type: "primary",
|
|
1589
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1590
|
+
name: "HQ US",
|
|
1591
|
+
line1: "Main street",
|
|
1592
|
+
line2: "apt #",
|
|
1593
|
+
line3: "Suite #",
|
|
1594
|
+
line4: "delivery instructions",
|
|
1595
|
+
streetNumber: "25",
|
|
1596
|
+
city: "San Francisco",
|
|
1597
|
+
state: "CA",
|
|
1598
|
+
postalCode: "94104",
|
|
1599
|
+
country: "US",
|
|
1600
|
+
latitude: "40.759211",
|
|
1601
|
+
longitude: "-73.984638",
|
|
1602
|
+
county: "Santa Clara",
|
|
1603
|
+
contactName: "Elon Musk",
|
|
1604
|
+
salutation: "Mr",
|
|
1605
|
+
phoneNumber: "111-111-1111",
|
|
1606
|
+
fax: "122-111-1111",
|
|
1607
|
+
email: "elon@musk.com",
|
|
1608
|
+
website: "https://elonmusk.com",
|
|
1609
|
+
notes: "Address notes or delivery instructions.",
|
|
1610
|
+
rowVersion: "1-12345",
|
|
1611
|
+
},
|
|
1612
|
+
ledgerAccount: {
|
|
1613
|
+
id: "123456",
|
|
1614
|
+
name: "Bank account",
|
|
1615
|
+
nominalCode: "N091",
|
|
1616
|
+
code: "453",
|
|
1617
|
+
},
|
|
1618
|
+
templateId: "123456",
|
|
1619
|
+
discountPercentage: 5.5,
|
|
1620
|
+
bankAccount: {
|
|
1621
|
+
bankName: "Monzo",
|
|
1622
|
+
accountNumber: "123465",
|
|
1623
|
+
accountName: "SPACEX LLC",
|
|
1624
|
+
accountType: "credit_card",
|
|
1625
|
+
iban: "CH2989144532982975332",
|
|
1626
|
+
bic: "AUDSCHGGXXX",
|
|
1627
|
+
routingNumber: "012345678",
|
|
1628
|
+
bsbNumber: "062-001",
|
|
1629
|
+
branchIdentifier: "001",
|
|
1630
|
+
bankCode: "BNH",
|
|
1631
|
+
currency: "USD",
|
|
1632
|
+
},
|
|
1633
|
+
accountingByRow: false,
|
|
1634
|
+
dueDate: new RFCDate("2020-10-30"),
|
|
1635
|
+
paymentMethod: "cash",
|
|
1636
|
+
taxCode: "1234",
|
|
1637
|
+
channel: "email",
|
|
1638
|
+
memo: "Thank you for the partnership and have a great day!",
|
|
1639
|
+
trackingCategories: [
|
|
1640
|
+
{
|
|
1641
|
+
id: "123456",
|
|
1642
|
+
name: "New York",
|
|
1643
|
+
},
|
|
1644
|
+
],
|
|
1645
|
+
customFields: [
|
|
1646
|
+
{
|
|
1647
|
+
id: "2389328923893298",
|
|
1648
|
+
name: "employee_level",
|
|
1649
|
+
description: "Employee Level",
|
|
1650
|
+
value: {},
|
|
1651
|
+
},
|
|
1652
|
+
],
|
|
1653
|
+
rowVersion: "1-12345",
|
|
1654
|
+
updatedBy: "12345",
|
|
1655
|
+
createdBy: "12345",
|
|
1656
|
+
updatedAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1657
|
+
createdAt: new Date("2020-09-30T07:43:32.000Z"),
|
|
1658
|
+
passThrough: [
|
|
1659
|
+
{
|
|
1660
|
+
serviceId: "<id>",
|
|
1661
|
+
extendPaths: [
|
|
1662
|
+
{
|
|
1663
|
+
path: "$.nested.property",
|
|
1664
|
+
value: {
|
|
1665
|
+
"TaxClassificationRef": {
|
|
1666
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1667
|
+
},
|
|
1668
|
+
},
|
|
1669
|
+
},
|
|
1670
|
+
{
|
|
1671
|
+
path: "$.nested.property",
|
|
1672
|
+
value: {
|
|
1673
|
+
"TaxClassificationRef": {
|
|
1674
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1675
|
+
},
|
|
1676
|
+
},
|
|
1677
|
+
},
|
|
1678
|
+
],
|
|
1679
|
+
},
|
|
1680
|
+
{
|
|
1681
|
+
serviceId: "<id>",
|
|
1682
|
+
extendPaths: [
|
|
1683
|
+
{
|
|
1684
|
+
path: "$.nested.property",
|
|
1685
|
+
value: {
|
|
1686
|
+
"TaxClassificationRef": {
|
|
1687
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1688
|
+
},
|
|
1689
|
+
},
|
|
1690
|
+
},
|
|
1691
|
+
{
|
|
1692
|
+
path: "$.nested.property",
|
|
1693
|
+
value: {
|
|
1694
|
+
"TaxClassificationRef": {
|
|
1695
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1696
|
+
},
|
|
1697
|
+
},
|
|
1698
|
+
},
|
|
1699
|
+
{
|
|
1700
|
+
path: "$.nested.property",
|
|
1701
|
+
value: {
|
|
1702
|
+
"TaxClassificationRef": {
|
|
1703
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1704
|
+
},
|
|
1705
|
+
},
|
|
1706
|
+
},
|
|
1707
|
+
],
|
|
1708
|
+
},
|
|
1709
|
+
{
|
|
1710
|
+
serviceId: "<id>",
|
|
1711
|
+
extendPaths: [
|
|
1712
|
+
{
|
|
1713
|
+
path: "$.nested.property",
|
|
1714
|
+
value: {
|
|
1715
|
+
"TaxClassificationRef": {
|
|
1716
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1717
|
+
},
|
|
1718
|
+
},
|
|
1719
|
+
},
|
|
1720
|
+
{
|
|
1721
|
+
path: "$.nested.property",
|
|
1722
|
+
value: {
|
|
1723
|
+
"TaxClassificationRef": {
|
|
1724
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1725
|
+
},
|
|
1726
|
+
},
|
|
1727
|
+
},
|
|
1728
|
+
],
|
|
1729
|
+
},
|
|
1730
|
+
],
|
|
1731
|
+
},
|
|
1732
|
+
});
|
|
1733
|
+
});
|
|
1734
|
+
|
|
1735
|
+
test("Purchaseorders Accounting Purchase Orders Update", async () => {
|
|
1736
|
+
const testHttpClient = createTestHTTPClient(
|
|
1737
|
+
"accounting.purchaseOrdersUpdate",
|
|
1738
|
+
);
|
|
1739
|
+
|
|
1740
|
+
const apideck = new Apideck({
|
|
1741
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1742
|
+
httpClient: testHttpClient,
|
|
1743
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1744
|
+
});
|
|
1745
|
+
|
|
1746
|
+
const result = await apideck.accounting.purchaseOrders.update({
|
|
1747
|
+
id: "<id>",
|
|
1748
|
+
consumerId: "test-consumer",
|
|
1749
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
1750
|
+
serviceId: "salesforce",
|
|
1751
|
+
purchaseOrder: {
|
|
1752
|
+
poNumber: "90000117",
|
|
1753
|
+
reference: "123456",
|
|
1754
|
+
supplier: {
|
|
1755
|
+
id: "12345",
|
|
1756
|
+
displayName: "Windsurf Shop",
|
|
1757
|
+
address: {
|
|
1758
|
+
id: "123",
|
|
1759
|
+
type: "primary",
|
|
1760
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1761
|
+
name: "HQ US",
|
|
1762
|
+
line1: "Main street",
|
|
1763
|
+
line2: "apt #",
|
|
1764
|
+
line3: "Suite #",
|
|
1765
|
+
line4: "delivery instructions",
|
|
1766
|
+
streetNumber: "25",
|
|
1767
|
+
city: "San Francisco",
|
|
1768
|
+
state: "CA",
|
|
1769
|
+
postalCode: "94104",
|
|
1770
|
+
country: "US",
|
|
1771
|
+
latitude: "40.759211",
|
|
1772
|
+
longitude: "-73.984638",
|
|
1773
|
+
county: "Santa Clara",
|
|
1774
|
+
contactName: "Elon Musk",
|
|
1775
|
+
salutation: "Mr",
|
|
1776
|
+
phoneNumber: "111-111-1111",
|
|
1777
|
+
fax: "122-111-1111",
|
|
1778
|
+
email: "elon@musk.com",
|
|
1779
|
+
website: "https://elonmusk.com",
|
|
1780
|
+
notes: "Address notes or delivery instructions.",
|
|
1781
|
+
rowVersion: "1-12345",
|
|
1782
|
+
},
|
|
1783
|
+
},
|
|
1784
|
+
companyId: "12345",
|
|
1785
|
+
status: "open",
|
|
1786
|
+
issuedDate: new RFCDate("2020-09-30"),
|
|
1787
|
+
deliveryDate: new RFCDate("2020-09-30"),
|
|
1788
|
+
expectedArrivalDate: new RFCDate("2020-09-30"),
|
|
1789
|
+
currency: "USD",
|
|
1790
|
+
currencyRate: 0.69,
|
|
1791
|
+
subTotal: 27500,
|
|
1792
|
+
totalTax: 2500,
|
|
1793
|
+
total: 27500,
|
|
1794
|
+
taxInclusive: true,
|
|
1795
|
+
lineItems: [
|
|
1796
|
+
{
|
|
1797
|
+
id: "12345",
|
|
1798
|
+
rowId: "12345",
|
|
1799
|
+
code: "120-C",
|
|
1800
|
+
lineNumber: 1,
|
|
1801
|
+
description:
|
|
1802
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1803
|
+
type: "sales_item",
|
|
1804
|
+
taxAmount: 27500,
|
|
1805
|
+
totalAmount: 27500,
|
|
1806
|
+
quantity: 1,
|
|
1807
|
+
unitPrice: 27500.5,
|
|
1808
|
+
unitOfMeasure: "pc.",
|
|
1809
|
+
discountPercentage: 0.01,
|
|
1810
|
+
discountAmount: 19.99,
|
|
1811
|
+
locationId: "12345",
|
|
1812
|
+
departmentId: "12345",
|
|
1813
|
+
item: {
|
|
1814
|
+
id: "12344",
|
|
1815
|
+
code: "120-C",
|
|
1816
|
+
name: "Model Y",
|
|
1817
|
+
},
|
|
1818
|
+
taxRate: {
|
|
1819
|
+
id: "123456",
|
|
1820
|
+
rate: 10,
|
|
1821
|
+
},
|
|
1822
|
+
trackingCategories: [
|
|
1823
|
+
{
|
|
1824
|
+
id: "123456",
|
|
1825
|
+
name: "New York",
|
|
1826
|
+
},
|
|
1827
|
+
{
|
|
1828
|
+
id: "123456",
|
|
1829
|
+
name: "New York",
|
|
1830
|
+
},
|
|
1831
|
+
],
|
|
1832
|
+
ledgerAccount: {
|
|
1833
|
+
id: "123456",
|
|
1834
|
+
nominalCode: "N091",
|
|
1835
|
+
code: "453",
|
|
1836
|
+
},
|
|
1837
|
+
customFields: [
|
|
1838
|
+
{
|
|
1839
|
+
id: "2389328923893298",
|
|
1840
|
+
name: "employee_level",
|
|
1841
|
+
description: "Employee Level",
|
|
1842
|
+
value: {
|
|
1843
|
+
"0": {},
|
|
1844
|
+
"1": {},
|
|
1845
|
+
},
|
|
1846
|
+
},
|
|
1847
|
+
{
|
|
1848
|
+
id: "2389328923893298",
|
|
1849
|
+
name: "employee_level",
|
|
1850
|
+
description: "Employee Level",
|
|
1851
|
+
value: true,
|
|
1852
|
+
},
|
|
1853
|
+
],
|
|
1854
|
+
rowVersion: "1-12345",
|
|
1855
|
+
},
|
|
1856
|
+
{
|
|
1857
|
+
id: "12345",
|
|
1858
|
+
rowId: "12345",
|
|
1859
|
+
code: "120-C",
|
|
1860
|
+
lineNumber: 1,
|
|
1861
|
+
description:
|
|
1862
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1863
|
+
type: "sales_item",
|
|
1864
|
+
taxAmount: 27500,
|
|
1865
|
+
totalAmount: 27500,
|
|
1866
|
+
quantity: 1,
|
|
1867
|
+
unitPrice: 27500.5,
|
|
1868
|
+
unitOfMeasure: "pc.",
|
|
1869
|
+
discountPercentage: 0.01,
|
|
1870
|
+
discountAmount: 19.99,
|
|
1871
|
+
locationId: "12345",
|
|
1872
|
+
departmentId: "12345",
|
|
1873
|
+
item: {
|
|
1874
|
+
id: "12344",
|
|
1875
|
+
code: "120-C",
|
|
1876
|
+
name: "Model Y",
|
|
1877
|
+
},
|
|
1878
|
+
taxRate: {
|
|
1879
|
+
id: "123456",
|
|
1880
|
+
rate: 10,
|
|
1881
|
+
},
|
|
1882
|
+
trackingCategories: [
|
|
1883
|
+
{
|
|
1884
|
+
id: "123456",
|
|
1885
|
+
name: "New York",
|
|
1886
|
+
},
|
|
1887
|
+
{
|
|
1888
|
+
id: "123456",
|
|
1889
|
+
name: "New York",
|
|
1890
|
+
},
|
|
1891
|
+
{
|
|
1892
|
+
id: "123456",
|
|
1893
|
+
name: "New York",
|
|
1894
|
+
},
|
|
1895
|
+
],
|
|
1896
|
+
ledgerAccount: {
|
|
1897
|
+
id: "123456",
|
|
1898
|
+
nominalCode: "N091",
|
|
1899
|
+
code: "453",
|
|
1900
|
+
},
|
|
1901
|
+
customFields: [
|
|
1902
|
+
{
|
|
1903
|
+
id: "2389328923893298",
|
|
1904
|
+
name: "employee_level",
|
|
1905
|
+
description: "Employee Level",
|
|
1906
|
+
value: {
|
|
1907
|
+
"0": {},
|
|
1908
|
+
},
|
|
1909
|
+
},
|
|
1910
|
+
],
|
|
1911
|
+
rowVersion: "1-12345",
|
|
1912
|
+
},
|
|
1913
|
+
{
|
|
1914
|
+
id: "12345",
|
|
1915
|
+
rowId: "12345",
|
|
1916
|
+
code: "120-C",
|
|
1917
|
+
lineNumber: 1,
|
|
1918
|
+
description:
|
|
1919
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1920
|
+
type: "sales_item",
|
|
1921
|
+
taxAmount: 27500,
|
|
1922
|
+
totalAmount: 27500,
|
|
1923
|
+
quantity: 1,
|
|
1924
|
+
unitPrice: 27500.5,
|
|
1925
|
+
unitOfMeasure: "pc.",
|
|
1926
|
+
discountPercentage: 0.01,
|
|
1927
|
+
discountAmount: 19.99,
|
|
1928
|
+
locationId: "12345",
|
|
1929
|
+
departmentId: "12345",
|
|
1930
|
+
item: {
|
|
1931
|
+
id: "12344",
|
|
1932
|
+
code: "120-C",
|
|
1933
|
+
name: "Model Y",
|
|
1934
|
+
},
|
|
1935
|
+
taxRate: {
|
|
1936
|
+
id: "123456",
|
|
1937
|
+
rate: 10,
|
|
1938
|
+
},
|
|
1939
|
+
trackingCategories: [
|
|
1940
|
+
{
|
|
1941
|
+
id: "123456",
|
|
1942
|
+
name: "New York",
|
|
1943
|
+
},
|
|
1944
|
+
],
|
|
1945
|
+
ledgerAccount: {
|
|
1946
|
+
id: "123456",
|
|
1947
|
+
nominalCode: "N091",
|
|
1948
|
+
code: "453",
|
|
1949
|
+
},
|
|
1950
|
+
customFields: [
|
|
1951
|
+
{
|
|
1952
|
+
id: "2389328923893298",
|
|
1953
|
+
name: "employee_level",
|
|
1954
|
+
description: "Employee Level",
|
|
1955
|
+
value: "Uses Salesforce and Marketo",
|
|
1956
|
+
},
|
|
1957
|
+
],
|
|
1958
|
+
rowVersion: "1-12345",
|
|
1959
|
+
},
|
|
1960
|
+
],
|
|
1961
|
+
shippingAddress: {
|
|
1962
|
+
id: "123",
|
|
1963
|
+
type: "primary",
|
|
1964
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1965
|
+
name: "HQ US",
|
|
1966
|
+
line1: "Main street",
|
|
1967
|
+
line2: "apt #",
|
|
1968
|
+
line3: "Suite #",
|
|
1969
|
+
line4: "delivery instructions",
|
|
1970
|
+
streetNumber: "25",
|
|
1971
|
+
city: "San Francisco",
|
|
1972
|
+
state: "CA",
|
|
1973
|
+
postalCode: "94104",
|
|
1974
|
+
country: "US",
|
|
1975
|
+
latitude: "40.759211",
|
|
1976
|
+
longitude: "-73.984638",
|
|
1977
|
+
county: "Santa Clara",
|
|
1978
|
+
contactName: "Elon Musk",
|
|
1979
|
+
salutation: "Mr",
|
|
1980
|
+
phoneNumber: "111-111-1111",
|
|
1981
|
+
fax: "122-111-1111",
|
|
1982
|
+
email: "elon@musk.com",
|
|
1983
|
+
website: "https://elonmusk.com",
|
|
1984
|
+
notes: "Address notes or delivery instructions.",
|
|
1985
|
+
rowVersion: "1-12345",
|
|
1986
|
+
},
|
|
1987
|
+
ledgerAccount: {
|
|
1988
|
+
id: "123456",
|
|
1989
|
+
nominalCode: "N091",
|
|
1990
|
+
code: "453",
|
|
1991
|
+
},
|
|
1992
|
+
templateId: "123456",
|
|
1993
|
+
discountPercentage: 5.5,
|
|
1994
|
+
bankAccount: {
|
|
1995
|
+
bankName: "Monzo",
|
|
1996
|
+
accountNumber: "123465",
|
|
1997
|
+
accountName: "SPACEX LLC",
|
|
1998
|
+
accountType: "credit_card",
|
|
1999
|
+
iban: "CH2989144532982975332",
|
|
2000
|
+
bic: "AUDSCHGGXXX",
|
|
2001
|
+
routingNumber: "012345678",
|
|
2002
|
+
bsbNumber: "062-001",
|
|
2003
|
+
branchIdentifier: "001",
|
|
2004
|
+
bankCode: "BNH",
|
|
2005
|
+
currency: "USD",
|
|
2006
|
+
},
|
|
2007
|
+
accountingByRow: false,
|
|
2008
|
+
dueDate: new RFCDate("2020-10-30"),
|
|
2009
|
+
paymentMethod: "cash",
|
|
2010
|
+
taxCode: "1234",
|
|
2011
|
+
channel: "email",
|
|
2012
|
+
memo: "Thank you for the partnership and have a great day!",
|
|
2013
|
+
trackingCategories: [
|
|
2014
|
+
{
|
|
2015
|
+
id: "123456",
|
|
2016
|
+
name: "New York",
|
|
2017
|
+
},
|
|
2018
|
+
{
|
|
2019
|
+
id: "123456",
|
|
2020
|
+
name: "New York",
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
id: "123456",
|
|
2024
|
+
name: "New York",
|
|
2025
|
+
},
|
|
2026
|
+
],
|
|
2027
|
+
customFields: [
|
|
2028
|
+
{
|
|
2029
|
+
id: "2389328923893298",
|
|
2030
|
+
name: "employee_level",
|
|
2031
|
+
description: "Employee Level",
|
|
2032
|
+
value: 10,
|
|
2033
|
+
},
|
|
2034
|
+
{
|
|
2035
|
+
id: "2389328923893298",
|
|
2036
|
+
name: "employee_level",
|
|
2037
|
+
description: "Employee Level",
|
|
2038
|
+
value: true,
|
|
2039
|
+
},
|
|
2040
|
+
{
|
|
2041
|
+
id: "2389328923893298",
|
|
2042
|
+
name: "employee_level",
|
|
2043
|
+
description: "Employee Level",
|
|
2044
|
+
value: {
|
|
2045
|
+
"0": "<value>",
|
|
2046
|
+
"1": "<value>",
|
|
2047
|
+
},
|
|
2048
|
+
},
|
|
2049
|
+
],
|
|
2050
|
+
rowVersion: "1-12345",
|
|
2051
|
+
passThrough: [
|
|
2052
|
+
{
|
|
2053
|
+
serviceId: "<id>",
|
|
2054
|
+
extendPaths: [
|
|
2055
|
+
{
|
|
2056
|
+
path: "$.nested.property",
|
|
2057
|
+
value: {
|
|
2058
|
+
"TaxClassificationRef": {
|
|
2059
|
+
"value": "EUC-99990201-V1-00020000",
|
|
2060
|
+
},
|
|
2061
|
+
},
|
|
2062
|
+
},
|
|
2063
|
+
],
|
|
2064
|
+
},
|
|
2065
|
+
{
|
|
2066
|
+
serviceId: "<id>",
|
|
2067
|
+
extendPaths: [
|
|
2068
|
+
{
|
|
2069
|
+
path: "$.nested.property",
|
|
2070
|
+
value: {
|
|
2071
|
+
"TaxClassificationRef": {
|
|
2072
|
+
"value": "EUC-99990201-V1-00020000",
|
|
2073
|
+
},
|
|
2074
|
+
},
|
|
2075
|
+
},
|
|
2076
|
+
{
|
|
2077
|
+
path: "$.nested.property",
|
|
2078
|
+
value: {
|
|
2079
|
+
"TaxClassificationRef": {
|
|
2080
|
+
"value": "EUC-99990201-V1-00020000",
|
|
2081
|
+
},
|
|
2082
|
+
},
|
|
2083
|
+
},
|
|
2084
|
+
{
|
|
2085
|
+
path: "$.nested.property",
|
|
2086
|
+
value: {
|
|
2087
|
+
"TaxClassificationRef": {
|
|
2088
|
+
"value": "EUC-99990201-V1-00020000",
|
|
2089
|
+
},
|
|
2090
|
+
},
|
|
2091
|
+
},
|
|
2092
|
+
],
|
|
2093
|
+
},
|
|
2094
|
+
],
|
|
2095
|
+
},
|
|
2096
|
+
});
|
|
2097
|
+
expect(result.httpMeta.response.status).toBe(200);
|
|
2098
|
+
expect(result.updatePurchaseOrderResponse).toBeDefined();
|
|
2099
|
+
expect(result.updatePurchaseOrderResponse).toEqual({
|
|
2100
|
+
statusCode: 200,
|
|
2101
|
+
status: "OK",
|
|
2102
|
+
service: "quickbooks",
|
|
2103
|
+
resource: "PurchaseOrders",
|
|
2104
|
+
operation: "update",
|
|
2105
|
+
data: {
|
|
2106
|
+
id: "12345",
|
|
2107
|
+
},
|
|
2108
|
+
});
|
|
1440
2109
|
});
|
|
1441
2110
|
|
|
1442
2111
|
test("Purchaseorders Accounting Purchase Orders Delete", async () => {
|