zudello-integration-sdk 1.0.17 → 1.0.19
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/package.json +1 -1
- package/src/sdk/Intacct.js +97 -97
- package/src/sdk/Zudello.js +14 -0
- package/src/sdk/submodules/intacct/ArInvoice.js +91 -27
- package/src/sdk/submodules/zudello/AmortizationSchedule.js +69 -0
- package/src/sdk/submodules/zudello/Batch.js +69 -0
- package/src/sdk/submodules/zudello/Bin.js +69 -0
- package/src/sdk/submodules/zudello/ExpenseCategory.js +69 -0
- package/src/sdk/submodules/zudello/MileageRate.js +69 -0
- package/src/sdk/submodules/zudello/ProjectType.js +69 -0
- package/src/sdk/submodules/zudello/Subsidiary.js +65 -59
- package/src/sdk/submodules/zudello/TeamAddress.js +69 -0
- package/src/sdk/submodules/zudello/tax/Rate.js +65 -59
package/package.json
CHANGED
package/src/sdk/Intacct.js
CHANGED
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const BaseSDK = require(
|
|
4
|
-
const UniversalModule = require(
|
|
5
|
-
const AccountModule = require(
|
|
6
|
-
const AccountGroupModule = require(
|
|
7
|
-
const AccountingPeriodModule = require(
|
|
8
|
-
const ApTermModule = require(
|
|
9
|
-
const BudgetModule = require(
|
|
10
|
-
const ClassModule = require(
|
|
11
|
-
const CostTypeModule = require(
|
|
12
|
-
const CustomerTypeModule = require(
|
|
13
|
-
const CustomerGroupModule = require(
|
|
14
|
-
const CustomerModule = require(
|
|
15
|
-
const DepartmentModule = require(
|
|
16
|
-
const EmployeeModule = require(
|
|
17
|
-
const EntityModule = require(
|
|
18
|
-
const ItemModule = require(
|
|
19
|
-
const ItemGroupModule = require(
|
|
20
|
-
const LocationModule = require(
|
|
21
|
-
const ProductLineModule = require(
|
|
22
|
-
const ProjectModule = require(
|
|
23
|
-
const ProjectGroupModule = require(
|
|
24
|
-
const TaskModule = require(
|
|
25
|
-
const TaxDetailModule = require(
|
|
26
|
-
const TaxSolutionModule = require(
|
|
27
|
-
const TaxGroupsModule = require(
|
|
28
|
-
const UomModule = require(
|
|
29
|
-
const VendorModule = require(
|
|
30
|
-
const VendorTypesModule = require(
|
|
31
|
-
const VendorGroupModule = require(
|
|
32
|
-
const WarehouseModule = require(
|
|
33
|
-
const ApBillModule = require(
|
|
34
|
-
const ApAdjustmentModule = require(
|
|
35
|
-
const PoDocumentModule = require(
|
|
36
|
-
const ArTermModule = require(
|
|
37
|
-
const ArInvoiceModule = require(
|
|
38
|
-
const ArAdjustmentModule = require(
|
|
39
|
-
const FileModule = require(
|
|
40
|
-
const ZoneModule = require(
|
|
3
|
+
const BaseSDK = require("./Base");
|
|
4
|
+
const UniversalModule = require("./submodules/intacct/Universal");
|
|
5
|
+
const AccountModule = require("./submodules/intacct/Account");
|
|
6
|
+
const AccountGroupModule = require("./submodules/intacct/AccountGroup");
|
|
7
|
+
const AccountingPeriodModule = require("./submodules/intacct/AccountingPeriod");
|
|
8
|
+
const ApTermModule = require("./submodules/intacct/ApTerm");
|
|
9
|
+
const BudgetModule = require("./submodules/intacct/Budget");
|
|
10
|
+
const ClassModule = require("./submodules/intacct/Class");
|
|
11
|
+
const CostTypeModule = require("./submodules/intacct/CostType");
|
|
12
|
+
const CustomerTypeModule = require("./submodules/intacct/CustomerType");
|
|
13
|
+
const CustomerGroupModule = require("./submodules/intacct/CustomerGroup");
|
|
14
|
+
const CustomerModule = require("./submodules/intacct/Customer");
|
|
15
|
+
const DepartmentModule = require("./submodules/intacct/Department");
|
|
16
|
+
const EmployeeModule = require("./submodules/intacct/Employee");
|
|
17
|
+
const EntityModule = require("./submodules/intacct/Entity");
|
|
18
|
+
const ItemModule = require("./submodules/intacct/Item");
|
|
19
|
+
const ItemGroupModule = require("./submodules/intacct/ItemGroup");
|
|
20
|
+
const LocationModule = require("./submodules/intacct/Location");
|
|
21
|
+
const ProductLineModule = require("./submodules/intacct/ProductLine");
|
|
22
|
+
const ProjectModule = require("./submodules/intacct/Project");
|
|
23
|
+
const ProjectGroupModule = require("./submodules/intacct/ProjectGroup");
|
|
24
|
+
const TaskModule = require("./submodules/intacct/Task");
|
|
25
|
+
const TaxDetailModule = require("./submodules/intacct/TaxDetail");
|
|
26
|
+
const TaxSolutionModule = require("./submodules/intacct/TaxSolution");
|
|
27
|
+
const TaxGroupsModule = require("./submodules/intacct/TaxGroups");
|
|
28
|
+
const UomModule = require("./submodules/intacct/Uom");
|
|
29
|
+
const VendorModule = require("./submodules/intacct/Vendor");
|
|
30
|
+
const VendorTypesModule = require("./submodules/intacct/VendorTypes");
|
|
31
|
+
const VendorGroupModule = require("./submodules/intacct/VendorGroup");
|
|
32
|
+
const WarehouseModule = require("./submodules/intacct/Warehouse");
|
|
33
|
+
const ApBillModule = require("./submodules/intacct/ApBill");
|
|
34
|
+
const ApAdjustmentModule = require("./submodules/intacct/ApAdjustment");
|
|
35
|
+
const PoDocumentModule = require("./submodules/intacct/PoDocument");
|
|
36
|
+
const ArTermModule = require("./submodules/intacct/ArTerm");
|
|
37
|
+
const ArInvoiceModule = require("./submodules/intacct/ArInvoice");
|
|
38
|
+
const ArAdjustmentModule = require("./submodules/intacct/ArAdjustment");
|
|
39
|
+
const FileModule = require("./submodules/intacct/File");
|
|
40
|
+
const ZoneModule = require("./submodules/intacct/Zone");
|
|
41
41
|
|
|
42
42
|
class IntacctSDK extends BaseSDK {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Constructor.
|
|
45
|
+
* @param {class} auth Auth class object with authorized api instance.
|
|
46
|
+
* @param {string} connectionUUID The UUID of the Connection we're working on.
|
|
47
|
+
*/
|
|
48
|
+
constructor(auth, connectionUUID, organizationUUID, apiURL, apiVersion, loggerClass = null) {
|
|
49
|
+
super({
|
|
50
|
+
auth,
|
|
51
|
+
connectionUUID,
|
|
52
|
+
organizationUUID,
|
|
53
|
+
apiURL,
|
|
54
|
+
apiVersion,
|
|
55
|
+
appUUIDKey: "intacct",
|
|
56
|
+
integrationName: "Intacct",
|
|
57
|
+
loggerClass,
|
|
58
|
+
});
|
|
59
59
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
60
|
+
/**
|
|
61
|
+
* Create submodule instances.
|
|
62
|
+
*/
|
|
63
|
+
this.universal = new UniversalModule(this);
|
|
64
|
+
this.item = new ItemModule(this);
|
|
65
|
+
this.itemGroup = new ItemGroupModule(this);
|
|
66
|
+
this.department = new DepartmentModule(this);
|
|
67
|
+
this.account = new AccountModule(this);
|
|
68
|
+
this.accountGroup = new AccountGroupModule(this);
|
|
69
|
+
this.accountingPeriod = new AccountingPeriodModule(this);
|
|
70
|
+
this.project = new ProjectModule(this);
|
|
71
|
+
this.projectGroup = new ProjectGroupModule(this);
|
|
72
|
+
this.task = new TaskModule(this);
|
|
73
|
+
this.taxGroups = new TaxGroupsModule(this);
|
|
74
|
+
this.taxDetails = new TaxDetailModule(this);
|
|
75
|
+
this.taxSolution = new TaxSolutionModule(this);
|
|
76
|
+
this.productLine = new ProductLineModule(this);
|
|
77
|
+
this.budget = new BudgetModule(this);
|
|
78
|
+
this.employee = new EmployeeModule(this);
|
|
79
|
+
this.apTerm = new ApTermModule(this);
|
|
80
|
+
this.warehouse = new WarehouseModule(this);
|
|
81
|
+
this.customer = new CustomerModule(this);
|
|
82
|
+
this.customerType = new CustomerTypeModule(this);
|
|
83
|
+
this.customerGroup = new CustomerGroupModule(this);
|
|
84
|
+
this.costType = new CostTypeModule(this);
|
|
85
|
+
this.vendorTypes = new VendorTypesModule(this);
|
|
86
|
+
this.vendorGroup = new VendorGroupModule(this);
|
|
87
|
+
this.vendor = new VendorModule(this);
|
|
88
|
+
this.location = new LocationModule(this);
|
|
89
|
+
this.entity = new EntityModule(this);
|
|
90
|
+
this.class = new ClassModule(this);
|
|
91
|
+
this.uom = new UomModule(this);
|
|
92
|
+
this.apBill = new ApBillModule(this);
|
|
93
|
+
this.apAdjustment = new ApAdjustmentModule(this);
|
|
94
|
+
this.poDocument = new PoDocumentModule(this);
|
|
95
|
+
this.arTerm = new ArTermModule(this);
|
|
96
|
+
this.arInvoice = new ArInvoiceModule(this);
|
|
97
|
+
this.arAdjustment = new ArAdjustmentModule(this);
|
|
98
|
+
this.zone = new ZoneModule(this);
|
|
99
|
+
this.file = new FileModule(this);
|
|
100
|
+
}
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
module.exports = IntacctSDK
|
|
103
|
+
module.exports = IntacctSDK;
|
package/src/sdk/Zudello.js
CHANGED
|
@@ -6,6 +6,9 @@ const BaseSDK = require("./Base");
|
|
|
6
6
|
const AccountModule = require("./submodules/zudello/Account");
|
|
7
7
|
const AccountGroupModule = require("./submodules/zudello/AccountGroup");
|
|
8
8
|
const AccountingPeriodModule = require("./submodules/zudello/AccountingPeriod");
|
|
9
|
+
const AmortizationScheduleModule = require("./submodules/zudello/AmortizationSchedule");
|
|
10
|
+
const BatchModule = require("./submodules/zudello/Batch");
|
|
11
|
+
const BinModule = require("./submodules/zudello/Bin");
|
|
9
12
|
const CostCentreModule = require("./submodules/zudello/CostCentre");
|
|
10
13
|
const CostTypeModule = require("./submodules/zudello/CostType");
|
|
11
14
|
const CustomerModule = require("./submodules/zudello/Customer");
|
|
@@ -14,8 +17,10 @@ const CustomerGroupModule = require("./submodules/zudello/CustomerGroup");
|
|
|
14
17
|
const CurrencyModule = require("./submodules/zudello/Currency");
|
|
15
18
|
const DepartmentModule = require("./submodules/zudello/Department");
|
|
16
19
|
const EmployeeModule = require("./submodules/zudello/Employee");
|
|
20
|
+
const ExpenseCategoryModule = require("./submodules/zudello/ExpenseCategory");
|
|
17
21
|
const SubsidiaryModule = require("./submodules/zudello/Subsidiary");
|
|
18
22
|
const LocationModule = require("./submodules/zudello/Location");
|
|
23
|
+
const MileageRateModule = require("./submodules/zudello/MileageRate");
|
|
19
24
|
const TaxRateModule = require("./submodules/zudello/tax/Rate");
|
|
20
25
|
const TaxSolutionModule = require("./submodules/zudello/tax/Solution");
|
|
21
26
|
const ItemModule = require("./submodules/zudello/Item");
|
|
@@ -27,8 +32,10 @@ const PaymentMethodModule = require("./submodules/zudello/PaymentMethod");
|
|
|
27
32
|
const ProjectModule = require("./submodules/zudello/Project");
|
|
28
33
|
const ProjectGroupModule = require("./submodules/zudello/ProjectGroup");
|
|
29
34
|
const ProjectTaskModule = require("./submodules/zudello/ProjectTask");
|
|
35
|
+
const ProjectTypeModule = require("./submodules/zudello/ProjectType");
|
|
30
36
|
const SupplierCategoryModule = require("./submodules/zudello/SupplierCategory");
|
|
31
37
|
const SupplierGroupModule = require("./submodules/zudello/SupplierGroup");
|
|
38
|
+
const TeamAddressModule = require("./submodules/zudello/TeamAddress");
|
|
32
39
|
const UomModule = require("./submodules/zudello/Uom");
|
|
33
40
|
const WarehouseModule = require("./submodules/zudello/Warehouse");
|
|
34
41
|
const ZoneModule = require("./submodules/zudello/Zone");
|
|
@@ -66,6 +73,9 @@ class ZudelloSDK extends BaseSDK {
|
|
|
66
73
|
this.account = new AccountModule(this);
|
|
67
74
|
this.accountGroup = new AccountGroupModule(this);
|
|
68
75
|
this.accountingPeriod = new AccountingPeriodModule(this);
|
|
76
|
+
this.amortizationSchedule = new AmortizationScheduleModule(this);
|
|
77
|
+
this.batch = new BatchModule(this);
|
|
78
|
+
this.bin = new BinModule(this);
|
|
69
79
|
this.costCentre = new CostCentreModule(this);
|
|
70
80
|
this.costType = new CostTypeModule(this);
|
|
71
81
|
this.customer = new CustomerModule(this);
|
|
@@ -74,8 +84,10 @@ class ZudelloSDK extends BaseSDK {
|
|
|
74
84
|
this.currency = new CurrencyModule(this);
|
|
75
85
|
this.department = new DepartmentModule(this);
|
|
76
86
|
this.employee = new EmployeeModule(this);
|
|
87
|
+
this.expenseCategory = new ExpenseCategoryModule(this);
|
|
77
88
|
this.subsidiary = new SubsidiaryModule(this);
|
|
78
89
|
this.location = new LocationModule(this);
|
|
90
|
+
this.mileageRate = new MileageRateModule(this);
|
|
79
91
|
this.item = new ItemModule(this);
|
|
80
92
|
this.itemCategory = new ItemCategoryModule(this);
|
|
81
93
|
this.itemGroup = new ItemGroupModule(this);
|
|
@@ -85,8 +97,10 @@ class ZudelloSDK extends BaseSDK {
|
|
|
85
97
|
this.project = new ProjectModule(this);
|
|
86
98
|
this.projectGroup = new ProjectGroupModule(this);
|
|
87
99
|
this.projectTask = new ProjectTaskModule(this);
|
|
100
|
+
this.projectType = new ProjectTypeModule(this);
|
|
88
101
|
this.supplierCategory = new SupplierCategoryModule(this);
|
|
89
102
|
this.supplierGroup = new SupplierGroupModule(this);
|
|
103
|
+
this.teamAddress = new TeamAddressModule(this);
|
|
90
104
|
this.warehouse = new WarehouseModule(this);
|
|
91
105
|
this.uom = new UomModule(this);
|
|
92
106
|
this.zone = new ZoneModule(this);
|
|
@@ -1,35 +1,99 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
|
-
const ArInvoiceItemModule = require(
|
|
3
|
+
const ArInvoiceItemModule = require("./arInvoice/Item");
|
|
4
4
|
|
|
5
5
|
class ArInvoiceModule {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Constructor.
|
|
8
|
+
* @param {class} parentModule Object of Intacct class.
|
|
9
|
+
*/
|
|
10
|
+
constructor(parentModule) {
|
|
11
|
+
this.module = parentModule;
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
this.item = new ArInvoiceItemModule(parentModule);
|
|
14
|
+
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Creates AR Bill.
|
|
18
|
+
* @returns {object} Create AR Bill Response.
|
|
19
|
+
*/
|
|
20
|
+
async create({ ...fields }) {
|
|
21
|
+
return await this.module.makeRequest(
|
|
22
|
+
"POST",
|
|
23
|
+
`${this.module.apiURL}/zintegrations/action/d42bb82b-0995-4c23-9ff2-56058beebfed`,
|
|
24
|
+
{
|
|
25
|
+
mappable_parameters: {
|
|
26
|
+
debug: {
|
|
27
|
+
value: false,
|
|
28
|
+
},
|
|
29
|
+
...fields,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
_debug: true,
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
}
|
|
23
37
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Reuse Universal Listing with type ARINVOICE.
|
|
40
|
+
* @returns {object} List Response.
|
|
41
|
+
*/
|
|
42
|
+
async list({
|
|
43
|
+
include = [],
|
|
44
|
+
exclude = [],
|
|
45
|
+
filters,
|
|
46
|
+
orderBy = null,
|
|
47
|
+
entity = null,
|
|
48
|
+
showPrivate = false,
|
|
49
|
+
pageSize = 1000,
|
|
50
|
+
offset = 0,
|
|
51
|
+
returnFormat = "json",
|
|
52
|
+
}) {
|
|
53
|
+
return await this.module.universal.list({
|
|
54
|
+
type: "ARINVOICE",
|
|
55
|
+
include,
|
|
56
|
+
exclude,
|
|
57
|
+
filters,
|
|
58
|
+
orderBy,
|
|
59
|
+
entity,
|
|
60
|
+
showPrivate,
|
|
61
|
+
pageSize,
|
|
62
|
+
offset,
|
|
63
|
+
returnFormat,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Reuse Universal Auto Pagination Listing with type ARINVOICE.
|
|
69
|
+
* @returns {object} Auto Pagination responses.
|
|
70
|
+
*/
|
|
71
|
+
async *autoPaginationList({
|
|
72
|
+
include = [],
|
|
73
|
+
exclude = [],
|
|
74
|
+
filters,
|
|
75
|
+
orderBy = null,
|
|
76
|
+
entity = null,
|
|
77
|
+
showPrivate = false,
|
|
78
|
+
pageSize = 1000,
|
|
79
|
+
offset = 0,
|
|
80
|
+
returnFormat = "json",
|
|
81
|
+
}) {
|
|
82
|
+
for await (const response of this.module.universal.autoPaginationList({
|
|
83
|
+
type: "ARINVOICE",
|
|
84
|
+
include,
|
|
85
|
+
exclude,
|
|
86
|
+
filters,
|
|
87
|
+
orderBy,
|
|
88
|
+
entity,
|
|
89
|
+
showPrivate,
|
|
90
|
+
pageSize,
|
|
91
|
+
offset,
|
|
92
|
+
returnFormat,
|
|
93
|
+
})) {
|
|
94
|
+
yield response;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
33
97
|
}
|
|
34
98
|
|
|
35
|
-
module.exports = ArInvoiceModule
|
|
99
|
+
module.exports = ArInvoiceModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class AmortizationScheduleModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "AmortizationSchedule",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "AMORTIZATION_SCHEDULE",
|
|
15
|
+
documentType: "AMORTIZATION_SCHEDULE",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = AmortizationScheduleModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class BatchModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "Batch",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "BATCH",
|
|
15
|
+
documentType: "BATCH",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = BatchModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class BinModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "Bin",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "BIN",
|
|
15
|
+
documentType: "BIN",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = BinModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class ExpenseCategoryModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "ExpenseCategory",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "EXPENSE_CATEGORY",
|
|
15
|
+
documentType: "EXPENSE_CATEGORY",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = ExpenseCategoryModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class MileageRateModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "MileageRate",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "MILEAGE_RATE",
|
|
15
|
+
documentType: "MILEAGE_RATE",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = MileageRateModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class ProjectTypeModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "ProjectType",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "PROJECT_TYPE",
|
|
15
|
+
documentType: "PROJECT_TYPE",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = ProjectTypeModule;
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
class SubsidiaryModule {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "Subsidiary",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "SUBSIDIARY",
|
|
15
|
+
documentType: "SUBSIDIARY",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
module.exports = SubsidiaryModule
|
|
69
|
+
module.exports = SubsidiaryModule;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
class TeamAddressModule {
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "TeamAddress",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "TEAM_ADDRESS",
|
|
15
|
+
documentType: "TEAM_ADDRESS",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = TeamAddressModule;
|
|
@@ -1,63 +1,69 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
class TaxRateModule {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Constructor.
|
|
6
|
+
* @param {class} parentModule Object of ZudelloV3 class.
|
|
7
|
+
*/
|
|
8
|
+
constructor(parentModule) {
|
|
9
|
+
this.module = parentModule;
|
|
10
|
+
|
|
11
|
+
this.staticFields = {
|
|
12
|
+
model: "TaxRate",
|
|
13
|
+
module: "DIMENSIONS",
|
|
14
|
+
submodule: "TAX_RATE",
|
|
15
|
+
documentType: "TAX_RATE",
|
|
16
|
+
enrich: false,
|
|
17
|
+
extractedEvent: false,
|
|
18
|
+
update: true,
|
|
19
|
+
create: true,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async fetch({ uuid, fetchDetails = true, simplified = true }) {
|
|
24
|
+
const validateIsEmpty = this.module.validator.isEmpty({ uuid });
|
|
25
|
+
|
|
26
|
+
if (!validateIsEmpty.valid) {
|
|
27
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return await this.module.fetch({
|
|
31
|
+
model: this.staticFields.model,
|
|
32
|
+
uuid,
|
|
33
|
+
fetchDetails,
|
|
34
|
+
simplified,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async updateOrCreate({
|
|
39
|
+
data,
|
|
40
|
+
clearNulls = true,
|
|
41
|
+
simplified = false,
|
|
42
|
+
submit = false,
|
|
43
|
+
updateStatus = false,
|
|
44
|
+
}) {
|
|
45
|
+
const validateIsEmpty = this.module.validator.isEmpty({ data });
|
|
46
|
+
|
|
47
|
+
if (!validateIsEmpty.valid) {
|
|
48
|
+
return this.module.responseHandler.error(validateIsEmpty.errors);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`);
|
|
52
|
+
this.module.logger.log("[PAGE DATA]:");
|
|
53
|
+
this.module.logger.log(data);
|
|
54
|
+
|
|
55
|
+
data = this.module.mapUpdateOrCreateData({
|
|
56
|
+
data,
|
|
57
|
+
staticFields: this.staticFields,
|
|
58
|
+
submit,
|
|
59
|
+
updateStatus,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
this.module.logger.log("[MAPPED PAGE DATA]:");
|
|
63
|
+
this.module.logger.log(data);
|
|
64
|
+
|
|
65
|
+
return await this.module.updateOrCreate({ data, clearNulls, simplified });
|
|
66
|
+
}
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
module.exports = TaxRateModule
|
|
69
|
+
module.exports = TaxRateModule;
|