@apideck/unify 0.26.0 → 0.28.0
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/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/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/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/{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/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 +2 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -1
- package/models/components/index.js.map +1 -1
- package/models/components/ledgeraccount.d.ts +9 -9
- package/models/components/ledgeraccount.d.ts.map +1 -1
- package/models/components/ledgeraccount.js +19 -15
- package/models/components/ledgeraccount.js.map +1 -1
- package/models/components/ledgeraccountsfilter.d.ts +61 -0
- package/models/components/ledgeraccountsfilter.d.ts.map +1 -1
- package/models/components/ledgeraccountsfilter.js +33 -1
- package/models/components/ledgeraccountsfilter.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/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 +1 -1
- package/src/__tests__/activities.test.ts +360 -9
- 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__/billpayments.test.ts +367 -9
- 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 +538 -9
- package/src/__tests__/connections.test.ts +409 -5
- package/src/__tests__/connectionsettings.test.ts +410 -5
- package/src/__tests__/contacts.test.ts +466 -9
- package/src/__tests__/creditnotes.test.ts +758 -87
- package/src/__tests__/customers.test.ts +513 -9
- 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 +332 -9
- 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 +673 -67
- package/src/__tests__/journalentries.test.ts +490 -8
- package/src/__tests__/leads.test.ts +446 -9
- package/src/__tests__/ledgeraccounts.test.ts +237 -8
- 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 +312 -9
- package/src/__tests__/pipelines.test.ts +194 -9
- package/src/__tests__/purchaseorders.test.ts +773 -104
- package/src/__tests__/sharedlinks.test.ts +183 -9
- package/src/__tests__/subsidiaries.test.ts +183 -9
- package/src/__tests__/suppliers.test.ts +505 -9
- package/src/__tests__/taxrates.test.ts +232 -9
- 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/crmCompaniesCreate.ts +1 -1
- package/src/funcs/crmCompaniesUpdate.ts +1 -1
- package/src/lib/config.ts +4 -4
- package/src/models/components/bankaccount.ts +7 -0
- package/src/models/components/bankaccount1.ts +207 -0
- package/src/models/components/{company.ts → company1.ts} +131 -128
- package/src/models/components/companyinfo.ts +9 -0
- package/src/models/components/getcompaniesresponse.ts +9 -9
- package/src/models/components/getcompanyresponse.ts +9 -9
- package/src/models/components/index.ts +2 -1
- package/src/models/components/ledgeraccount.ts +25 -19
- package/src/models/components/ledgeraccountsfilter.ts +49 -0
- 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/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";
|
|
@@ -1013,14 +1013,729 @@ test("Purchaseorders Accounting Purchase Orders All", async () => {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
});
|
|
1015
1015
|
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1016
|
+
test("Purchaseorders Accounting Purchase Orders Add", async () => {
|
|
1017
|
+
const testHttpClient = createTestHTTPClient("accounting.purchaseOrdersAdd");
|
|
1018
|
+
|
|
1019
|
+
const apideck = new Apideck({
|
|
1020
|
+
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
1021
|
+
httpClient: testHttpClient,
|
|
1022
|
+
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1023
|
+
});
|
|
1024
|
+
|
|
1025
|
+
const result = await apideck.accounting.purchaseOrders.create({
|
|
1026
|
+
consumerId: "test-consumer",
|
|
1027
|
+
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
1028
|
+
serviceId: "salesforce",
|
|
1029
|
+
purchaseOrder: {
|
|
1030
|
+
poNumber: "90000117",
|
|
1031
|
+
reference: "123456",
|
|
1032
|
+
supplier: {
|
|
1033
|
+
id: "12345",
|
|
1034
|
+
displayName: "Windsurf Shop",
|
|
1035
|
+
address: {
|
|
1036
|
+
id: "123",
|
|
1037
|
+
type: "primary",
|
|
1038
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1039
|
+
name: "HQ US",
|
|
1040
|
+
line1: "Main street",
|
|
1041
|
+
line2: "apt #",
|
|
1042
|
+
line3: "Suite #",
|
|
1043
|
+
line4: "delivery instructions",
|
|
1044
|
+
streetNumber: "25",
|
|
1045
|
+
city: "San Francisco",
|
|
1046
|
+
state: "CA",
|
|
1047
|
+
postalCode: "94104",
|
|
1048
|
+
country: "US",
|
|
1049
|
+
latitude: "40.759211",
|
|
1050
|
+
longitude: "-73.984638",
|
|
1051
|
+
county: "Santa Clara",
|
|
1052
|
+
contactName: "Elon Musk",
|
|
1053
|
+
salutation: "Mr",
|
|
1054
|
+
phoneNumber: "111-111-1111",
|
|
1055
|
+
fax: "122-111-1111",
|
|
1056
|
+
email: "elon@musk.com",
|
|
1057
|
+
website: "https://elonmusk.com",
|
|
1058
|
+
notes: "Address notes or delivery instructions.",
|
|
1059
|
+
rowVersion: "1-12345",
|
|
1060
|
+
},
|
|
1061
|
+
},
|
|
1062
|
+
companyId: "12345",
|
|
1063
|
+
status: "open",
|
|
1064
|
+
issuedDate: new RFCDate("2020-09-30"),
|
|
1065
|
+
deliveryDate: new RFCDate("2020-09-30"),
|
|
1066
|
+
expectedArrivalDate: new RFCDate("2020-09-30"),
|
|
1067
|
+
currency: "USD",
|
|
1068
|
+
currencyRate: 0.69,
|
|
1069
|
+
subTotal: 27500,
|
|
1070
|
+
totalTax: 2500,
|
|
1071
|
+
total: 27500,
|
|
1072
|
+
taxInclusive: true,
|
|
1073
|
+
lineItems: [
|
|
1074
|
+
{
|
|
1075
|
+
id: "12345",
|
|
1076
|
+
rowId: "12345",
|
|
1077
|
+
code: "120-C",
|
|
1078
|
+
lineNumber: 1,
|
|
1079
|
+
description:
|
|
1080
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1081
|
+
type: "sales_item",
|
|
1082
|
+
taxAmount: 27500,
|
|
1083
|
+
totalAmount: 27500,
|
|
1084
|
+
quantity: 1,
|
|
1085
|
+
unitPrice: 27500.5,
|
|
1086
|
+
unitOfMeasure: "pc.",
|
|
1087
|
+
discountPercentage: 0.01,
|
|
1088
|
+
discountAmount: 19.99,
|
|
1089
|
+
locationId: "12345",
|
|
1090
|
+
departmentId: "12345",
|
|
1091
|
+
item: {
|
|
1092
|
+
id: "12344",
|
|
1093
|
+
code: "120-C",
|
|
1094
|
+
name: "Model Y",
|
|
1095
|
+
},
|
|
1096
|
+
taxRate: {
|
|
1097
|
+
id: "123456",
|
|
1098
|
+
rate: 10,
|
|
1099
|
+
},
|
|
1100
|
+
trackingCategories: [
|
|
1101
|
+
{
|
|
1102
|
+
id: "123456",
|
|
1103
|
+
name: "New York",
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
id: "123456",
|
|
1107
|
+
name: "New York",
|
|
1108
|
+
},
|
|
1109
|
+
],
|
|
1110
|
+
ledgerAccount: {
|
|
1111
|
+
id: "123456",
|
|
1112
|
+
nominalCode: "N091",
|
|
1113
|
+
code: "453",
|
|
1114
|
+
},
|
|
1115
|
+
customFields: [
|
|
1116
|
+
{
|
|
1117
|
+
id: "2389328923893298",
|
|
1118
|
+
name: "employee_level",
|
|
1119
|
+
description: "Employee Level",
|
|
1120
|
+
value: "Uses Salesforce and Marketo",
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
id: "2389328923893298",
|
|
1124
|
+
name: "employee_level",
|
|
1125
|
+
description: "Employee Level",
|
|
1126
|
+
value: "Uses Salesforce and Marketo",
|
|
1127
|
+
},
|
|
1128
|
+
],
|
|
1129
|
+
rowVersion: "1-12345",
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
id: "12345",
|
|
1133
|
+
rowId: "12345",
|
|
1134
|
+
code: "120-C",
|
|
1135
|
+
lineNumber: 1,
|
|
1136
|
+
description:
|
|
1137
|
+
"Model Y is a fully electric, mid-size SUV, with seating for up to seven, dual motor AWD and unparalleled protection.",
|
|
1138
|
+
type: "sales_item",
|
|
1139
|
+
taxAmount: 27500,
|
|
1140
|
+
totalAmount: 27500,
|
|
1141
|
+
quantity: 1,
|
|
1142
|
+
unitPrice: 27500.5,
|
|
1143
|
+
unitOfMeasure: "pc.",
|
|
1144
|
+
discountPercentage: 0.01,
|
|
1145
|
+
discountAmount: 19.99,
|
|
1146
|
+
locationId: "12345",
|
|
1147
|
+
departmentId: "12345",
|
|
1148
|
+
item: {
|
|
1149
|
+
id: "12344",
|
|
1150
|
+
code: "120-C",
|
|
1151
|
+
name: "Model Y",
|
|
1152
|
+
},
|
|
1153
|
+
taxRate: {
|
|
1154
|
+
id: "123456",
|
|
1155
|
+
rate: 10,
|
|
1156
|
+
},
|
|
1157
|
+
trackingCategories: [
|
|
1158
|
+
{
|
|
1159
|
+
id: "123456",
|
|
1160
|
+
name: "New York",
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
id: "123456",
|
|
1164
|
+
name: "New York",
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
id: "123456",
|
|
1168
|
+
name: "New York",
|
|
1169
|
+
},
|
|
1170
|
+
],
|
|
1171
|
+
ledgerAccount: {
|
|
1172
|
+
id: "123456",
|
|
1173
|
+
nominalCode: "N091",
|
|
1174
|
+
code: "453",
|
|
1175
|
+
},
|
|
1176
|
+
customFields: [
|
|
1177
|
+
{
|
|
1178
|
+
id: "2389328923893298",
|
|
1179
|
+
name: "employee_level",
|
|
1180
|
+
description: "Employee Level",
|
|
1181
|
+
value: "Uses Salesforce and Marketo",
|
|
1182
|
+
},
|
|
1183
|
+
{
|
|
1184
|
+
id: "2389328923893298",
|
|
1185
|
+
name: "employee_level",
|
|
1186
|
+
description: "Employee Level",
|
|
1187
|
+
value: 10,
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
id: "2389328923893298",
|
|
1191
|
+
name: "employee_level",
|
|
1192
|
+
description: "Employee Level",
|
|
1193
|
+
value: "Uses Salesforce and Marketo",
|
|
1194
|
+
},
|
|
1195
|
+
],
|
|
1196
|
+
rowVersion: "1-12345",
|
|
1197
|
+
},
|
|
1198
|
+
],
|
|
1199
|
+
shippingAddress: {
|
|
1200
|
+
id: "123",
|
|
1201
|
+
type: "primary",
|
|
1202
|
+
string: "25 Spring Street, Blackburn, VIC 3130",
|
|
1203
|
+
name: "HQ US",
|
|
1204
|
+
line1: "Main street",
|
|
1205
|
+
line2: "apt #",
|
|
1206
|
+
line3: "Suite #",
|
|
1207
|
+
line4: "delivery instructions",
|
|
1208
|
+
streetNumber: "25",
|
|
1209
|
+
city: "San Francisco",
|
|
1210
|
+
state: "CA",
|
|
1211
|
+
postalCode: "94104",
|
|
1212
|
+
country: "US",
|
|
1213
|
+
latitude: "40.759211",
|
|
1214
|
+
longitude: "-73.984638",
|
|
1215
|
+
county: "Santa Clara",
|
|
1216
|
+
contactName: "Elon Musk",
|
|
1217
|
+
salutation: "Mr",
|
|
1218
|
+
phoneNumber: "111-111-1111",
|
|
1219
|
+
fax: "122-111-1111",
|
|
1220
|
+
email: "elon@musk.com",
|
|
1221
|
+
website: "https://elonmusk.com",
|
|
1222
|
+
notes: "Address notes or delivery instructions.",
|
|
1223
|
+
rowVersion: "1-12345",
|
|
1224
|
+
},
|
|
1225
|
+
ledgerAccount: {
|
|
1226
|
+
id: "123456",
|
|
1227
|
+
nominalCode: "N091",
|
|
1228
|
+
code: "453",
|
|
1229
|
+
},
|
|
1230
|
+
templateId: "123456",
|
|
1231
|
+
discountPercentage: 5.5,
|
|
1232
|
+
bankAccount: {
|
|
1233
|
+
bankName: "Monzo",
|
|
1234
|
+
accountNumber: "123465",
|
|
1235
|
+
accountName: "SPACEX LLC",
|
|
1236
|
+
accountType: "credit_card",
|
|
1237
|
+
iban: "CH2989144532982975332",
|
|
1238
|
+
bic: "AUDSCHGGXXX",
|
|
1239
|
+
routingNumber: "012345678",
|
|
1240
|
+
bsbNumber: "062-001",
|
|
1241
|
+
branchIdentifier: "001",
|
|
1242
|
+
bankCode: "BNH",
|
|
1243
|
+
currency: "USD",
|
|
1244
|
+
},
|
|
1245
|
+
accountingByRow: false,
|
|
1246
|
+
dueDate: new RFCDate("2020-10-30"),
|
|
1247
|
+
paymentMethod: "cash",
|
|
1248
|
+
taxCode: "1234",
|
|
1249
|
+
channel: "email",
|
|
1250
|
+
memo: "Thank you for the partnership and have a great day!",
|
|
1251
|
+
trackingCategories: [
|
|
1252
|
+
{
|
|
1253
|
+
id: "123456",
|
|
1254
|
+
name: "New York",
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
id: "123456",
|
|
1258
|
+
name: "New York",
|
|
1259
|
+
},
|
|
1260
|
+
{
|
|
1261
|
+
id: "123456",
|
|
1262
|
+
name: "New York",
|
|
1263
|
+
},
|
|
1264
|
+
],
|
|
1265
|
+
customFields: [
|
|
1266
|
+
{
|
|
1267
|
+
id: "2389328923893298",
|
|
1268
|
+
name: "employee_level",
|
|
1269
|
+
description: "Employee Level",
|
|
1270
|
+
value: {},
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
id: "2389328923893298",
|
|
1274
|
+
name: "employee_level",
|
|
1275
|
+
description: "Employee Level",
|
|
1276
|
+
value: [
|
|
1277
|
+
"<value>",
|
|
1278
|
+
"<value>",
|
|
1279
|
+
"<value>",
|
|
1280
|
+
],
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
id: "2389328923893298",
|
|
1284
|
+
name: "employee_level",
|
|
1285
|
+
description: "Employee Level",
|
|
1286
|
+
value: true,
|
|
1287
|
+
},
|
|
1288
|
+
],
|
|
1289
|
+
rowVersion: "1-12345",
|
|
1290
|
+
passThrough: [
|
|
1291
|
+
{
|
|
1292
|
+
serviceId: "<id>",
|
|
1293
|
+
extendPaths: [
|
|
1294
|
+
{
|
|
1295
|
+
path: "$.nested.property",
|
|
1296
|
+
value: {
|
|
1297
|
+
"TaxClassificationRef": {
|
|
1298
|
+
"value": "EUC-99990201-V1-00020000",
|
|
1299
|
+
},
|
|
1300
|
+
},
|
|
1301
|
+
},
|
|
1302
|
+
],
|
|
1303
|
+
},
|
|
1304
|
+
],
|
|
1305
|
+
},
|
|
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
|
+
});
|
|
1319
|
+
});
|
|
1320
|
+
|
|
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
|
+
{},
|
|
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
|
+
});
|
|
1020
1733
|
});
|
|
1021
1734
|
|
|
1022
|
-
test("Purchaseorders Accounting Purchase Orders
|
|
1023
|
-
const testHttpClient = createTestHTTPClient(
|
|
1735
|
+
test("Purchaseorders Accounting Purchase Orders Update", async () => {
|
|
1736
|
+
const testHttpClient = createTestHTTPClient(
|
|
1737
|
+
"accounting.purchaseOrdersUpdate",
|
|
1738
|
+
);
|
|
1024
1739
|
|
|
1025
1740
|
const apideck = new Apideck({
|
|
1026
1741
|
serverURL: process.env["TEST_SERVER_URL"] ?? "http://localhost:18080",
|
|
@@ -1028,30 +1743,17 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1028
1743
|
apiKey: process.env["APIDECK_API_KEY"] ?? "value",
|
|
1029
1744
|
});
|
|
1030
1745
|
|
|
1031
|
-
const result = await apideck.accounting.purchaseOrders.
|
|
1746
|
+
const result = await apideck.accounting.purchaseOrders.update({
|
|
1032
1747
|
id: "<id>",
|
|
1033
1748
|
consumerId: "test-consumer",
|
|
1034
1749
|
appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
|
|
1035
1750
|
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",
|
|
1751
|
+
purchaseOrder: {
|
|
1048
1752
|
poNumber: "90000117",
|
|
1049
1753
|
reference: "123456",
|
|
1050
1754
|
supplier: {
|
|
1051
1755
|
id: "12345",
|
|
1052
|
-
displayId: "SUPP00101",
|
|
1053
1756
|
displayName: "Windsurf Shop",
|
|
1054
|
-
companyName: "The boring company",
|
|
1055
1757
|
address: {
|
|
1056
1758
|
id: "123",
|
|
1057
1759
|
type: "primary",
|
|
@@ -1115,8 +1817,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1115
1817
|
},
|
|
1116
1818
|
taxRate: {
|
|
1117
1819
|
id: "123456",
|
|
1118
|
-
code: "N-T",
|
|
1119
|
-
name: "GST on Purchases",
|
|
1120
1820
|
rate: 10,
|
|
1121
1821
|
},
|
|
1122
1822
|
trackingCategories: [
|
|
@@ -1131,7 +1831,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1131
1831
|
],
|
|
1132
1832
|
ledgerAccount: {
|
|
1133
1833
|
id: "123456",
|
|
1134
|
-
name: "Bank account",
|
|
1135
1834
|
nominalCode: "N091",
|
|
1136
1835
|
code: "453",
|
|
1137
1836
|
},
|
|
@@ -1140,22 +1839,19 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1140
1839
|
id: "2389328923893298",
|
|
1141
1840
|
name: "employee_level",
|
|
1142
1841
|
description: "Employee Level",
|
|
1143
|
-
value:
|
|
1842
|
+
value: [
|
|
1843
|
+
{},
|
|
1844
|
+
{},
|
|
1845
|
+
],
|
|
1144
1846
|
},
|
|
1145
1847
|
{
|
|
1146
1848
|
id: "2389328923893298",
|
|
1147
1849
|
name: "employee_level",
|
|
1148
1850
|
description: "Employee Level",
|
|
1149
|
-
value:
|
|
1150
|
-
{},
|
|
1151
|
-
],
|
|
1851
|
+
value: true,
|
|
1152
1852
|
},
|
|
1153
1853
|
],
|
|
1154
1854
|
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
1855
|
},
|
|
1160
1856
|
{
|
|
1161
1857
|
id: "12345",
|
|
@@ -1181,8 +1877,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1181
1877
|
},
|
|
1182
1878
|
taxRate: {
|
|
1183
1879
|
id: "123456",
|
|
1184
|
-
code: "N-T",
|
|
1185
|
-
name: "GST on Purchases",
|
|
1186
1880
|
rate: 10,
|
|
1187
1881
|
},
|
|
1188
1882
|
trackingCategories: [
|
|
@@ -1194,10 +1888,13 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1194
1888
|
id: "123456",
|
|
1195
1889
|
name: "New York",
|
|
1196
1890
|
},
|
|
1891
|
+
{
|
|
1892
|
+
id: "123456",
|
|
1893
|
+
name: "New York",
|
|
1894
|
+
},
|
|
1197
1895
|
],
|
|
1198
1896
|
ledgerAccount: {
|
|
1199
1897
|
id: "123456",
|
|
1200
|
-
name: "Bank account",
|
|
1201
1898
|
nominalCode: "N091",
|
|
1202
1899
|
code: "453",
|
|
1203
1900
|
},
|
|
@@ -1206,14 +1903,12 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1206
1903
|
id: "2389328923893298",
|
|
1207
1904
|
name: "employee_level",
|
|
1208
1905
|
description: "Employee Level",
|
|
1209
|
-
value:
|
|
1906
|
+
value: [
|
|
1907
|
+
{},
|
|
1908
|
+
],
|
|
1210
1909
|
},
|
|
1211
1910
|
],
|
|
1212
1911
|
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
1912
|
},
|
|
1218
1913
|
{
|
|
1219
1914
|
id: "12345",
|
|
@@ -1239,8 +1934,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1239
1934
|
},
|
|
1240
1935
|
taxRate: {
|
|
1241
1936
|
id: "123456",
|
|
1242
|
-
code: "N-T",
|
|
1243
|
-
name: "GST on Purchases",
|
|
1244
1937
|
rate: 10,
|
|
1245
1938
|
},
|
|
1246
1939
|
trackingCategories: [
|
|
@@ -1248,18 +1941,9 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1248
1941
|
id: "123456",
|
|
1249
1942
|
name: "New York",
|
|
1250
1943
|
},
|
|
1251
|
-
{
|
|
1252
|
-
id: "123456",
|
|
1253
|
-
name: "New York",
|
|
1254
|
-
},
|
|
1255
|
-
{
|
|
1256
|
-
id: "123456",
|
|
1257
|
-
name: "New York",
|
|
1258
|
-
},
|
|
1259
1944
|
],
|
|
1260
1945
|
ledgerAccount: {
|
|
1261
1946
|
id: "123456",
|
|
1262
|
-
name: "Bank account",
|
|
1263
1947
|
nominalCode: "N091",
|
|
1264
1948
|
code: "453",
|
|
1265
1949
|
},
|
|
@@ -1268,20 +1952,10 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1268
1952
|
id: "2389328923893298",
|
|
1269
1953
|
name: "employee_level",
|
|
1270
1954
|
description: "Employee Level",
|
|
1271
|
-
value:
|
|
1272
|
-
},
|
|
1273
|
-
{
|
|
1274
|
-
id: "2389328923893298",
|
|
1275
|
-
name: "employee_level",
|
|
1276
|
-
description: "Employee Level",
|
|
1277
|
-
value: 10,
|
|
1955
|
+
value: "Uses Salesforce and Marketo",
|
|
1278
1956
|
},
|
|
1279
1957
|
],
|
|
1280
1958
|
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
1959
|
},
|
|
1286
1960
|
],
|
|
1287
1961
|
shippingAddress: {
|
|
@@ -1312,7 +1986,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1312
1986
|
},
|
|
1313
1987
|
ledgerAccount: {
|
|
1314
1988
|
id: "123456",
|
|
1315
|
-
name: "Bank account",
|
|
1316
1989
|
nominalCode: "N091",
|
|
1317
1990
|
code: "453",
|
|
1318
1991
|
},
|
|
@@ -1342,20 +2015,39 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1342
2015
|
id: "123456",
|
|
1343
2016
|
name: "New York",
|
|
1344
2017
|
},
|
|
2018
|
+
{
|
|
2019
|
+
id: "123456",
|
|
2020
|
+
name: "New York",
|
|
2021
|
+
},
|
|
2022
|
+
{
|
|
2023
|
+
id: "123456",
|
|
2024
|
+
name: "New York",
|
|
2025
|
+
},
|
|
1345
2026
|
],
|
|
1346
2027
|
customFields: [
|
|
1347
2028
|
{
|
|
1348
2029
|
id: "2389328923893298",
|
|
1349
2030
|
name: "employee_level",
|
|
1350
2031
|
description: "Employee Level",
|
|
1351
|
-
value:
|
|
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
|
+
"<value>",
|
|
2046
|
+
"<value>",
|
|
2047
|
+
],
|
|
1352
2048
|
},
|
|
1353
2049
|
],
|
|
1354
2050
|
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
2051
|
passThrough: [
|
|
1360
2052
|
{
|
|
1361
2053
|
serviceId: "<id>",
|
|
@@ -1368,14 +2060,6 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1368
2060
|
},
|
|
1369
2061
|
},
|
|
1370
2062
|
},
|
|
1371
|
-
{
|
|
1372
|
-
path: "$.nested.property",
|
|
1373
|
-
value: {
|
|
1374
|
-
"TaxClassificationRef": {
|
|
1375
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1376
|
-
},
|
|
1377
|
-
},
|
|
1378
|
-
},
|
|
1379
2063
|
],
|
|
1380
2064
|
},
|
|
1381
2065
|
{
|
|
@@ -1407,36 +2091,21 @@ test("Purchaseorders Accounting Purchase Orders One", async () => {
|
|
|
1407
2091
|
},
|
|
1408
2092
|
],
|
|
1409
2093
|
},
|
|
1410
|
-
{
|
|
1411
|
-
serviceId: "<id>",
|
|
1412
|
-
extendPaths: [
|
|
1413
|
-
{
|
|
1414
|
-
path: "$.nested.property",
|
|
1415
|
-
value: {
|
|
1416
|
-
"TaxClassificationRef": {
|
|
1417
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1418
|
-
},
|
|
1419
|
-
},
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
path: "$.nested.property",
|
|
1423
|
-
value: {
|
|
1424
|
-
"TaxClassificationRef": {
|
|
1425
|
-
"value": "EUC-99990201-V1-00020000",
|
|
1426
|
-
},
|
|
1427
|
-
},
|
|
1428
|
-
},
|
|
1429
|
-
],
|
|
1430
|
-
},
|
|
1431
2094
|
],
|
|
1432
2095
|
},
|
|
1433
2096
|
});
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
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 () => {
|