zudello-integration-sdk 1.0.17 → 1.0.18

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudello-integration-sdk",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "Zudello Integrations SDK",
5
5
  "main": "./src/index.js",
6
6
  "repository": {
@@ -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);
@@ -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
- 'use strict'
1
+ "use strict";
2
2
 
3
3
  class SubsidiaryModule {
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 ({ data, clearNulls = true, simplified = false, submit = false, updateStatus = false }) {
39
- const validateIsEmpty = this.module.validator.isEmpty({ data })
40
-
41
- if (!validateIsEmpty.valid) {
42
- return this.module.responseHandler.error(validateIsEmpty.errors)
43
- }
44
-
45
- this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`)
46
- this.module.logger.log('[PAGE DATA]:')
47
- this.module.logger.log(data)
48
-
49
- data = this.module.mapUpdateOrCreateData({
50
- data,
51
- staticFields: this.staticFields,
52
- submit,
53
- updateStatus
54
- })
55
-
56
- this.module.logger.log('[MAPPED PAGE DATA]:')
57
- this.module.logger.log(data)
58
-
59
- return await this.module.updateOrCreate({ data, clearNulls, simplified })
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
- 'use strict'
1
+ "use strict";
2
2
 
3
3
  class TaxRateModule {
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 ({ data, clearNulls = true, simplified = false, submit = false, updateStatus = false }) {
39
- const validateIsEmpty = this.module.validator.isEmpty({ data })
40
-
41
- if (!validateIsEmpty.valid) {
42
- return this.module.responseHandler.error(validateIsEmpty.errors)
43
- }
44
-
45
- this.module.logger.log(`[UPDATE OR CREATE]: ZudelloV3 [model - ${this.staticFields.model}]`)
46
- this.module.logger.log('[PAGE DATA]:')
47
- this.module.logger.log(data)
48
-
49
- data = this.module.mapUpdateOrCreateData({
50
- data,
51
- staticFields: this.staticFields,
52
- submit,
53
- updateStatus
54
- })
55
-
56
- this.module.logger.log('[MAPPED PAGE DATA]:')
57
- this.module.logger.log(data)
58
-
59
- return await this.module.updateOrCreate({ data, clearNulls, simplified })
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;