@d19n/youfibre-odin-sdk 1.0.21 → 1.0.22

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.
Files changed (121) hide show
  1. package/dist/api-sdk-v1/BillingRequestApi.d.ts +7 -0
  2. package/dist/api-sdk-v1/BillingRequestApi.js +26 -0
  3. package/dist/api-sdk-v1/CaseApi.d.ts +7 -0
  4. package/dist/api-sdk-v1/CaseApi.js +26 -0
  5. package/dist/api-sdk-v1/ConsumptionRateApi.d.ts +7 -0
  6. package/dist/api-sdk-v1/ConsumptionRateApi.js +26 -0
  7. package/dist/api-sdk-v1/ConsumptionScheduleApi.d.ts +7 -0
  8. package/dist/api-sdk-v1/ConsumptionScheduleApi.js +26 -0
  9. package/dist/api-sdk-v1/ContactApi.d.ts +7 -0
  10. package/dist/api-sdk-v1/ContactApi.js +26 -0
  11. package/dist/api-sdk-v1/ContactIdentityApi.d.ts +7 -0
  12. package/dist/api-sdk-v1/ContactIdentityApi.js +26 -0
  13. package/dist/api-sdk-v1/InvoiceItemApi.d.ts +7 -0
  14. package/dist/api-sdk-v1/InvoiceItemApi.js +26 -0
  15. package/dist/api-sdk-v1/MilestoneApi.d.ts +7 -0
  16. package/dist/api-sdk-v1/MilestoneApi.js +26 -0
  17. package/dist/api-sdk-v1/NoteApi.d.ts +7 -0
  18. package/dist/api-sdk-v1/NoteApi.js +26 -0
  19. package/dist/api-sdk-v1/OfferApi.d.ts +7 -0
  20. package/dist/api-sdk-v1/OfferApi.js +26 -0
  21. package/dist/api-sdk-v1/OrderApi.d.ts +7 -0
  22. package/dist/api-sdk-v1/OrderApi.js +26 -0
  23. package/dist/api-sdk-v1/OrderItemApi.d.ts +7 -0
  24. package/dist/api-sdk-v1/OrderItemApi.js +26 -0
  25. package/dist/api-sdk-v1/OrganizationApi.d.ts +7 -0
  26. package/dist/api-sdk-v1/OrganizationApi.js +26 -0
  27. package/dist/api-sdk-v1/ProductApi.d.ts +9 -1
  28. package/dist/api-sdk-v1/ProductApi.js +31 -0
  29. package/dist/api-sdk-v1/ProductComponentApi.d.ts +7 -0
  30. package/dist/api-sdk-v1/ProductComponentApi.js +26 -0
  31. package/dist/api-sdk-v1/RestrictionApi.d.ts +7 -0
  32. package/dist/api-sdk-v1/RestrictionApi.js +26 -0
  33. package/dist/api-sdk-v1/ServiceApi.d.ts +7 -0
  34. package/dist/api-sdk-v1/ServiceApi.js +26 -0
  35. package/dist/api-sdk-v1/SplitOrderApi.d.ts +7 -0
  36. package/dist/api-sdk-v1/SplitOrderApi.js +26 -0
  37. package/dist/api-sdk-v1/TransactionApi.d.ts +7 -0
  38. package/dist/api-sdk-v1/TransactionApi.js +26 -0
  39. package/dist/api-sdk-v1/WorkOrderApi.d.ts +7 -0
  40. package/dist/api-sdk-v1/WorkOrderApi.js +26 -0
  41. package/dist/db-sdk-v1/BillingRequestDb.d.ts +7 -0
  42. package/dist/db-sdk-v1/BillingRequestDb.js +33 -0
  43. package/dist/db-sdk-v1/CaseDb.d.ts +7 -0
  44. package/dist/db-sdk-v1/CaseDb.js +33 -0
  45. package/dist/db-sdk-v1/ConsumptionRateDb.d.ts +7 -0
  46. package/dist/db-sdk-v1/ConsumptionRateDb.js +33 -0
  47. package/dist/db-sdk-v1/ConsumptionScheduleDb.d.ts +7 -0
  48. package/dist/db-sdk-v1/ConsumptionScheduleDb.js +33 -0
  49. package/dist/db-sdk-v1/ContactDb.d.ts +7 -0
  50. package/dist/db-sdk-v1/ContactDb.js +33 -0
  51. package/dist/db-sdk-v1/ContactIdentityDb.d.ts +7 -0
  52. package/dist/db-sdk-v1/ContactIdentityDb.js +33 -0
  53. package/dist/db-sdk-v1/InvoiceItemDb.d.ts +7 -0
  54. package/dist/db-sdk-v1/InvoiceItemDb.js +33 -0
  55. package/dist/db-sdk-v1/MilestoneDb.d.ts +7 -0
  56. package/dist/db-sdk-v1/MilestoneDb.js +33 -0
  57. package/dist/db-sdk-v1/NoteDb.d.ts +7 -0
  58. package/dist/db-sdk-v1/NoteDb.js +33 -0
  59. package/dist/db-sdk-v1/OfferDb.d.ts +7 -0
  60. package/dist/db-sdk-v1/OfferDb.js +33 -0
  61. package/dist/db-sdk-v1/OrderDb.d.ts +7 -0
  62. package/dist/db-sdk-v1/OrderDb.js +33 -0
  63. package/dist/db-sdk-v1/OrderItemDb.d.ts +7 -0
  64. package/dist/db-sdk-v1/OrderItemDb.js +33 -0
  65. package/dist/db-sdk-v1/OrganizationDb.d.ts +7 -0
  66. package/dist/db-sdk-v1/OrganizationDb.js +33 -0
  67. package/dist/db-sdk-v1/ProductComponentDb.d.ts +7 -0
  68. package/dist/db-sdk-v1/ProductComponentDb.js +33 -0
  69. package/dist/db-sdk-v1/ProductDb.d.ts +9 -1
  70. package/dist/db-sdk-v1/ProductDb.js +38 -0
  71. package/dist/db-sdk-v1/RestrictionDb.d.ts +7 -0
  72. package/dist/db-sdk-v1/RestrictionDb.js +33 -0
  73. package/dist/db-sdk-v1/ServiceDb.d.ts +7 -0
  74. package/dist/db-sdk-v1/ServiceDb.js +33 -0
  75. package/dist/db-sdk-v1/SplitOrderDb.d.ts +7 -0
  76. package/dist/db-sdk-v1/SplitOrderDb.js +33 -0
  77. package/dist/db-sdk-v1/TransactionDb.d.ts +7 -0
  78. package/dist/db-sdk-v1/TransactionDb.js +33 -0
  79. package/dist/db-sdk-v1/WorkOrderDb.d.ts +7 -0
  80. package/dist/db-sdk-v1/WorkOrderDb.js +33 -0
  81. package/package.json +2 -2
  82. package/src/api-sdk-v1/BillingRequestApi.ts +27 -0
  83. package/src/api-sdk-v1/CaseApi.ts +27 -0
  84. package/src/api-sdk-v1/ConsumptionRateApi.ts +27 -0
  85. package/src/api-sdk-v1/ConsumptionScheduleApi.ts +27 -0
  86. package/src/api-sdk-v1/ContactApi.ts +27 -0
  87. package/src/api-sdk-v1/ContactIdentityApi.ts +27 -0
  88. package/src/api-sdk-v1/InvoiceItemApi.ts +27 -0
  89. package/src/api-sdk-v1/MilestoneApi.ts +27 -0
  90. package/src/api-sdk-v1/NoteApi.ts +27 -0
  91. package/src/api-sdk-v1/OfferApi.ts +27 -0
  92. package/src/api-sdk-v1/OrderApi.ts +27 -0
  93. package/src/api-sdk-v1/OrderItemApi.ts +27 -0
  94. package/src/api-sdk-v1/OrganizationApi.ts +27 -0
  95. package/src/api-sdk-v1/ProductApi.ts +31 -0
  96. package/src/api-sdk-v1/ProductComponentApi.ts +27 -0
  97. package/src/api-sdk-v1/RestrictionApi.ts +27 -0
  98. package/src/api-sdk-v1/ServiceApi.ts +27 -0
  99. package/src/api-sdk-v1/SplitOrderApi.ts +27 -0
  100. package/src/api-sdk-v1/TransactionApi.ts +27 -0
  101. package/src/api-sdk-v1/WorkOrderApi.ts +27 -0
  102. package/src/db-sdk-v1/BillingRequestDb.ts +35 -0
  103. package/src/db-sdk-v1/CaseDb.ts +35 -0
  104. package/src/db-sdk-v1/ConsumptionRateDb.ts +35 -0
  105. package/src/db-sdk-v1/ConsumptionScheduleDb.ts +35 -0
  106. package/src/db-sdk-v1/ContactDb.ts +35 -0
  107. package/src/db-sdk-v1/ContactIdentityDb.ts +35 -0
  108. package/src/db-sdk-v1/InvoiceItemDb.ts +35 -0
  109. package/src/db-sdk-v1/MilestoneDb.ts +35 -0
  110. package/src/db-sdk-v1/NoteDb.ts +35 -0
  111. package/src/db-sdk-v1/OfferDb.ts +35 -0
  112. package/src/db-sdk-v1/OrderDb.ts +35 -0
  113. package/src/db-sdk-v1/OrderItemDb.ts +35 -0
  114. package/src/db-sdk-v1/OrganizationDb.ts +35 -0
  115. package/src/db-sdk-v1/ProductComponentDb.ts +35 -0
  116. package/src/db-sdk-v1/ProductDb.ts +39 -0
  117. package/src/db-sdk-v1/RestrictionDb.ts +35 -0
  118. package/src/db-sdk-v1/ServiceDb.ts +35 -0
  119. package/src/db-sdk-v1/SplitOrderDb.ts +35 -0
  120. package/src/db-sdk-v1/TransactionDb.ts +35 -0
  121. package/src/db-sdk-v1/WorkOrderDb.ts +35 -0
@@ -31,6 +31,13 @@ export declare class SplitOrderDb extends DbProvider {
31
31
  relatedAssociationId?: string;
32
32
  }[]): Promise<any>;
33
33
  unlinkSplitOrderOrders(splitOrderId: string, linkedOrderIds: string[]): Promise<any>;
34
+ getSplitOrders(splitOrderId: string): Promise<any>;
35
+ linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {
36
+ id: string;
37
+ relationType?: RelationTypeEnum;
38
+ relatedAssociationId?: string;
39
+ }[]): Promise<any>;
40
+ unlinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderIds: string[]): Promise<any>;
34
41
  linkOrderSplitOrders(splitOrderId: string, orderIds: {
35
42
  id: string;
36
43
  relationType?: RelationTypeEnum;
@@ -145,6 +145,39 @@ class SplitOrderDb extends db_provider_1.DbProvider {
145
145
  return yield this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
146
146
  });
147
147
  }
148
+ // Use this function when you want to return a single record
149
+ getSplitOrders(splitOrderId) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return yield this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
152
+ });
153
+ }
154
+ linkSplitOrderSplitOrders(splitOrderId, splitOrderIds) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ const associationDtos = [];
157
+ for (const param of splitOrderIds) {
158
+ associationDtos.push({
159
+ entity: 'OrderModule:SplitOrder',
160
+ recordId: param.id,
161
+ linkType: 'SplitOrder__SplitOrder',
162
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
163
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
164
+ });
165
+ }
166
+ return yield this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
167
+ });
168
+ }
169
+ unlinkSplitOrderSplitOrders(splitOrderId, linkedSplitOrderIds) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const associationDtos = [];
172
+ for (const pk of linkedSplitOrderIds) {
173
+ associationDtos.push({
174
+ primaryKey: splitOrderId,
175
+ linkedRecordPrimaryKey: pk,
176
+ });
177
+ }
178
+ return yield this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
179
+ });
180
+ }
148
181
  linkOrderSplitOrders(splitOrderId, orderIds) {
149
182
  return __awaiter(this, void 0, void 0, function* () {
150
183
  const associationDtos = [];
@@ -24,6 +24,13 @@ export declare class TransactionDb extends DbProvider {
24
24
  relatedAssociationId?: string;
25
25
  }[]): Promise<any>;
26
26
  unlinkTransactionPaymentMethods(transactionId: string, linkedPaymentMethodIds: string[]): Promise<any>;
27
+ getTransactions(transactionId: string): Promise<any>;
28
+ linkTransactionTransactions(transactionId: string, transactionIds: {
29
+ id: string;
30
+ relationType?: RelationTypeEnum;
31
+ relatedAssociationId?: string;
32
+ }[]): Promise<any>;
33
+ unlinkTransactionTransactions(transactionId: string, linkedTransactionIds: string[]): Promise<any>;
27
34
  getInvoices(transactionId: string): Promise<any>;
28
35
  linkInvoiceTransactions(transactionId: string, invoiceIds: {
29
36
  id: string;
@@ -113,6 +113,39 @@ class TransactionDb extends db_provider_1.DbProvider {
113
113
  });
114
114
  }
115
115
  // Use this function when you want to return a single record
116
+ getTransactions(transactionId) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ return yield this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
119
+ });
120
+ }
121
+ linkTransactionTransactions(transactionId, transactionIds) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const associationDtos = [];
124
+ for (const param of transactionIds) {
125
+ associationDtos.push({
126
+ entity: 'BillingModule:Transaction',
127
+ recordId: param.id,
128
+ linkType: 'Transaction__Transaction',
129
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
130
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
131
+ });
132
+ }
133
+ return yield this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
134
+ });
135
+ }
136
+ unlinkTransactionTransactions(transactionId, linkedTransactionIds) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ const associationDtos = [];
139
+ for (const pk of linkedTransactionIds) {
140
+ associationDtos.push({
141
+ primaryKey: transactionId,
142
+ linkedRecordPrimaryKey: pk,
143
+ });
144
+ }
145
+ return yield this._deleteLinks(this.moduleName, this.entityName, transactionId, associationDtos);
146
+ });
147
+ }
148
+ // Use this function when you want to return a single record
116
149
  getInvoices(transactionId) {
117
150
  return __awaiter(this, void 0, void 0, function* () {
118
151
  return yield this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -241,6 +241,13 @@ export declare class WorkOrderDb extends DbProvider {
241
241
  relatedAssociationId?: string;
242
242
  }[]): Promise<any>;
243
243
  unlinkWorkOrderOhInstallationAudits(workOrderId: string, linkedOhInstallationAuditIds: string[]): Promise<any>;
244
+ getWorkOrders(workOrderId: string): Promise<any>;
245
+ linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {
246
+ id: string;
247
+ relationType?: RelationTypeEnum;
248
+ relatedAssociationId?: string;
249
+ }[]): Promise<any>;
250
+ unlinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderIds: string[]): Promise<any>;
244
251
  getOhAuditOfInstallations(workOrderId: string): Promise<any>;
245
252
  linkWorkOrderOhAuditOfInstallations(workOrderId: string, ohAuditOfInstallationIds: {
246
253
  id: string;
@@ -1136,6 +1136,39 @@ class WorkOrderDb extends db_provider_1.DbProvider {
1136
1136
  });
1137
1137
  }
1138
1138
  // Use this function when you want to return a single record
1139
+ getWorkOrders(workOrderId) {
1140
+ return __awaiter(this, void 0, void 0, function* () {
1141
+ return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
1142
+ });
1143
+ }
1144
+ linkWorkOrderWorkOrders(workOrderId, workOrderIds) {
1145
+ return __awaiter(this, void 0, void 0, function* () {
1146
+ const associationDtos = [];
1147
+ for (const param of workOrderIds) {
1148
+ associationDtos.push({
1149
+ entity: 'FieldServiceModule:WorkOrder',
1150
+ recordId: param.id,
1151
+ linkType: 'WorkOrder__WorkOrder',
1152
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
1153
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
1154
+ });
1155
+ }
1156
+ return yield this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1157
+ });
1158
+ }
1159
+ unlinkWorkOrderWorkOrders(workOrderId, linkedWorkOrderIds) {
1160
+ return __awaiter(this, void 0, void 0, function* () {
1161
+ const associationDtos = [];
1162
+ for (const pk of linkedWorkOrderIds) {
1163
+ associationDtos.push({
1164
+ primaryKey: workOrderId,
1165
+ linkedRecordPrimaryKey: pk,
1166
+ });
1167
+ }
1168
+ return yield this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1169
+ });
1170
+ }
1171
+ // Use this function when you want to return a single record
1139
1172
  getOhAuditOfInstallations(workOrderId) {
1140
1173
  return __awaiter(this, void 0, void 0, function* () {
1141
1174
  return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",
@@ -11,7 +11,7 @@
11
11
  "typescript": "^5.4.5"
12
12
  },
13
13
  "dependencies": {
14
- "@d19n/odin-sdk-generator": "^1.0.57",
14
+ "@d19n/odin-sdk-generator": "^1.0.59",
15
15
  "@d19n/odin-types": "^1.0.10"
16
16
  },
17
17
  "scripts": {
@@ -101,6 +101,33 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getBillingRequests(billingRequestId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'BillingRequest');
107
+ }
108
+
109
+ public async linkBillingRequestBillingRequests(billingRequestId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of billingRequestIds){
113
+ associationDtos.push({
114
+ entity: 'BillingModule:BillingRequest',
115
+ recordId: param.id,
116
+ linkType: 'BillingRequest__BillingRequest',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
123
+ }
124
+
125
+ public async unLinkBillingRequestBillingRequests(billingRequestId: string, linkedBillingRequestId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, billingRequestId, linkedBillingRequestId);
128
+ }
129
+
130
+
104
131
  // Use this function when you want to return a single record
105
132
  public async getFiles(billingRequestId: string) {
106
133
  return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'File');
@@ -74,6 +74,33 @@
74
74
  }
75
75
 
76
76
 
77
+ // Use this function when you want to return a single record
78
+ public async getCases(caseId: string) {
79
+ return await this._getLinks(this.moduleName, this.entityName, caseId, 'Case');
80
+ }
81
+
82
+ public async linkCaseCases(caseId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
83
+
84
+ const associationDtos = [];
85
+ for(const param of caseIds){
86
+ associationDtos.push({
87
+ entity: 'SupportModule:Case',
88
+ recordId: param.id,
89
+ linkType: 'Case__Case',
90
+ relationType: param?.relationType,
91
+ relatedAssociationId: param?.relatedAssociationId
92
+ });
93
+ }
94
+
95
+ return await this._createLinks(this.moduleName, this.entityName, caseId, associationDtos);
96
+ }
97
+
98
+ public async unLinkCaseCases(caseId: string, linkedCaseId: string) {
99
+
100
+ return await this._deleteLinks(this.moduleName, this.entityName, caseId, linkedCaseId);
101
+ }
102
+
103
+
77
104
  // Use this function when you want to return a single record
78
105
  public async getFiles(caseId: string) {
79
106
  return await this._getLinks(this.moduleName, this.entityName, caseId, 'File');
@@ -101,4 +101,31 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getConsumptionRates(consumptionRateId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, consumptionRateId, 'ConsumptionRate');
107
+ }
108
+
109
+ public async linkConsumptionRateConsumptionRates(consumptionRateId: string, consumptionRateIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of consumptionRateIds){
113
+ associationDtos.push({
114
+ entity: 'ProductModule:ConsumptionRate',
115
+ recordId: param.id,
116
+ linkType: 'ConsumptionRate__ConsumptionRate',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
123
+ }
124
+
125
+ public async unLinkConsumptionRateConsumptionRates(consumptionRateId: string, linkedConsumptionRateId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, consumptionRateId, linkedConsumptionRateId);
128
+ }
129
+
130
+
104
131
  }
@@ -128,4 +128,31 @@
128
128
  }
129
129
 
130
130
 
131
+ // Use this function when you want to return a single record
132
+ public async getConsumptionSchedules(consumptionScheduleId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, consumptionScheduleId, 'ConsumptionSchedule');
134
+ }
135
+
136
+ public async linkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, consumptionScheduleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of consumptionScheduleIds){
140
+ associationDtos.push({
141
+ entity: 'ProductModule:ConsumptionSchedule',
142
+ recordId: param.id,
143
+ linkType: 'ConsumptionSchedule__ConsumptionSchedule',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
150
+ }
151
+
152
+ public async unLinkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, linkedConsumptionScheduleId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, consumptionScheduleId, linkedConsumptionScheduleId);
155
+ }
156
+
157
+
131
158
  }
@@ -425,6 +425,33 @@
425
425
  }
426
426
 
427
427
 
428
+ // Use this function when you want to return a single record
429
+ public async getContacts(contactId: string) {
430
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Contact');
431
+ }
432
+
433
+ public async linkContactContacts(contactId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
434
+
435
+ const associationDtos = [];
436
+ for(const param of contactIds){
437
+ associationDtos.push({
438
+ entity: 'CrmModule:Contact',
439
+ recordId: param.id,
440
+ linkType: 'Contact__Contact',
441
+ relationType: param?.relationType,
442
+ relatedAssociationId: param?.relatedAssociationId
443
+ });
444
+ }
445
+
446
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
447
+ }
448
+
449
+ public async unLinkContactContacts(contactId: string, linkedContactId: string) {
450
+
451
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, linkedContactId);
452
+ }
453
+
454
+
428
455
  // Use this function when you want to return a single record
429
456
  public async getOneTouchSwitchs(contactId: string) {
430
457
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'OneTouchSwitch');
@@ -101,6 +101,33 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getContactIdentitys(contactIdentityId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'ContactIdentity');
107
+ }
108
+
109
+ public async linkContactIdentityContactIdentitys(contactIdentityId: string, contactIdentityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of contactIdentityIds){
113
+ associationDtos.push({
114
+ entity: 'CrmModule:ContactIdentity',
115
+ recordId: param.id,
116
+ linkType: 'ContactIdentity__ContactIdentity',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
123
+ }
124
+
125
+ public async unLinkContactIdentityContactIdentitys(contactIdentityId: string, linkedContactIdentityId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, contactIdentityId, linkedContactIdentityId);
128
+ }
129
+
130
+
104
131
  // Use this function when you want to return a single record
105
132
  public async getContacts(contactIdentityId: string) {
106
133
  return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'Contact');
@@ -101,4 +101,31 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getInvoiceItems(invoiceItemId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, invoiceItemId, 'InvoiceItem');
107
+ }
108
+
109
+ public async linkInvoiceItemInvoiceItems(invoiceItemId: string, invoiceItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of invoiceItemIds){
113
+ associationDtos.push({
114
+ entity: 'BillingModule:InvoiceItem',
115
+ recordId: param.id,
116
+ linkType: 'InvoiceItem__InvoiceItem',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, invoiceItemId, associationDtos);
123
+ }
124
+
125
+ public async unLinkInvoiceItemInvoiceItems(invoiceItemId: string, linkedInvoiceItemId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, invoiceItemId, linkedInvoiceItemId);
128
+ }
129
+
130
+
104
131
  }
@@ -128,6 +128,33 @@
128
128
  }
129
129
 
130
130
 
131
+ // Use this function when you want to return a single record
132
+ public async getMilestones(milestoneId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Milestone');
134
+ }
135
+
136
+ public async linkMilestoneMilestones(milestoneId: string, milestoneIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of milestoneIds){
140
+ associationDtos.push({
141
+ entity: 'ProjectModule:Milestone',
142
+ recordId: param.id,
143
+ linkType: 'Milestone__Milestone',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, milestoneId, associationDtos);
150
+ }
151
+
152
+ public async unLinkMilestoneMilestones(milestoneId: string, linkedMilestoneId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, milestoneId, linkedMilestoneId);
155
+ }
156
+
157
+
131
158
  // Use this function when you want to return a single record
132
159
  public async getNotes(milestoneId: string) {
133
160
  return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Note');
@@ -1343,6 +1343,33 @@
1343
1343
  }
1344
1344
 
1345
1345
 
1346
+ // Use this function when you want to return a single record
1347
+ public async getNotes(noteId: string) {
1348
+ return await this._getLinks(this.moduleName, this.entityName, noteId, 'Note');
1349
+ }
1350
+
1351
+ public async linkNoteNotes(noteId: string, noteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1352
+
1353
+ const associationDtos = [];
1354
+ for(const param of noteIds){
1355
+ associationDtos.push({
1356
+ entity: 'SupportModule:Note',
1357
+ recordId: param.id,
1358
+ linkType: 'Note__Note',
1359
+ relationType: param?.relationType,
1360
+ relatedAssociationId: param?.relatedAssociationId
1361
+ });
1362
+ }
1363
+
1364
+ return await this._createLinks(this.moduleName, this.entityName, noteId, associationDtos);
1365
+ }
1366
+
1367
+ public async unLinkNoteNotes(noteId: string, linkedNoteId: string) {
1368
+
1369
+ return await this._deleteLinks(this.moduleName, this.entityName, noteId, linkedNoteId);
1370
+ }
1371
+
1372
+
1346
1373
  public async linkNoteFiles(noteId: string, fileIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1347
1374
 
1348
1375
  const associationDtos = [];
@@ -155,6 +155,33 @@
155
155
  }
156
156
 
157
157
 
158
+ // Use this function when you want to return a single record
159
+ public async getOffers(offerId: string) {
160
+ return await this._getLinks(this.moduleName, this.entityName, offerId, 'Offer');
161
+ }
162
+
163
+ public async linkOfferOffers(offerId: string, offerIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
164
+
165
+ const associationDtos = [];
166
+ for(const param of offerIds){
167
+ associationDtos.push({
168
+ entity: 'ProductModule:Offer',
169
+ recordId: param.id,
170
+ linkType: 'Offer__Offer',
171
+ relationType: param?.relationType,
172
+ relatedAssociationId: param?.relatedAssociationId
173
+ });
174
+ }
175
+
176
+ return await this._createLinks(this.moduleName, this.entityName, offerId, associationDtos);
177
+ }
178
+
179
+ public async unLinkOfferOffers(offerId: string, linkedOfferId: string) {
180
+
181
+ return await this._deleteLinks(this.moduleName, this.entityName, offerId, linkedOfferId);
182
+ }
183
+
184
+
158
185
  // Use this function when you want to return a single record
159
186
  public async getDiscounts(offerId: string) {
160
187
  return await this._getLinks(this.moduleName, this.entityName, offerId, 'Discount');
@@ -456,6 +456,33 @@
456
456
  }
457
457
 
458
458
 
459
+ // Use this function when you want to return a single record
460
+ public async getOrders(orderId: string) {
461
+ return await this._getLinks(this.moduleName, this.entityName, orderId, 'Order');
462
+ }
463
+
464
+ public async linkOrderOrders(orderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
465
+
466
+ const associationDtos = [];
467
+ for(const param of orderIds){
468
+ associationDtos.push({
469
+ entity: 'OrderModule:Order',
470
+ recordId: param.id,
471
+ linkType: 'Order__Order',
472
+ relationType: param?.relationType,
473
+ relatedAssociationId: param?.relatedAssociationId
474
+ });
475
+ }
476
+
477
+ return await this._createLinks(this.moduleName, this.entityName, orderId, associationDtos);
478
+ }
479
+
480
+ public async unLinkOrderOrders(orderId: string, linkedOrderId: string) {
481
+
482
+ return await this._deleteLinks(this.moduleName, this.entityName, orderId, linkedOrderId);
483
+ }
484
+
485
+
459
486
  // Use this function when you want to return a single record
460
487
  public async getPicRequests(orderId: string) {
461
488
  return await this._getLinks(this.moduleName, this.entityName, orderId, 'PICRequest');
@@ -398,6 +398,33 @@
398
398
  }
399
399
 
400
400
 
401
+ // Use this function when you want to return a single record
402
+ public async getOrderItems(orderItemId: string) {
403
+ return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'OrderItem');
404
+ }
405
+
406
+ public async linkOrderItemOrderItems(orderItemId: string, orderItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
407
+
408
+ const associationDtos = [];
409
+ for(const param of orderItemIds){
410
+ associationDtos.push({
411
+ entity: 'OrderModule:OrderItem',
412
+ recordId: param.id,
413
+ linkType: 'OrderItem__OrderItem',
414
+ relationType: param?.relationType,
415
+ relatedAssociationId: param?.relatedAssociationId
416
+ });
417
+ }
418
+
419
+ return await this._createLinks(this.moduleName, this.entityName, orderItemId, associationDtos);
420
+ }
421
+
422
+ public async unLinkOrderItemOrderItems(orderItemId: string, linkedOrderItemId: string) {
423
+
424
+ return await this._deleteLinks(this.moduleName, this.entityName, orderItemId, linkedOrderItemId);
425
+ }
426
+
427
+
401
428
  // Use this function when you want to return a single record
402
429
  public async getVoiceConfigurations(orderItemId: string) {
403
430
  return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'VoiceConfiguration');
@@ -155,4 +155,31 @@
155
155
  }
156
156
 
157
157
 
158
+ // Use this function when you want to return a single record
159
+ public async getOrganizations(organizationId: string) {
160
+ return await this._getLinks(this.moduleName, this.entityName, organizationId, 'Organization');
161
+ }
162
+
163
+ public async linkOrganizationOrganizations(organizationId: string, organizationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
164
+
165
+ const associationDtos = [];
166
+ for(const param of organizationIds){
167
+ associationDtos.push({
168
+ entity: 'CrmModule:Organization',
169
+ recordId: param.id,
170
+ linkType: 'Organization__Organization',
171
+ relationType: param?.relationType,
172
+ relatedAssociationId: param?.relatedAssociationId
173
+ });
174
+ }
175
+
176
+ return await this._createLinks(this.moduleName, this.entityName, organizationId, associationDtos);
177
+ }
178
+
179
+ public async unLinkOrganizationOrganizations(organizationId: string, linkedOrganizationId: string) {
180
+
181
+ return await this._deleteLinks(this.moduleName, this.entityName, organizationId, linkedOrganizationId);
182
+ }
183
+
184
+
158
185
  }
@@ -317,4 +317,35 @@
317
317
  }
318
318
 
319
319
 
320
+ // Use this function when you want to return a single record
321
+ public async getProducts(productId: string) {
322
+ return await this._getLinks(this.moduleName, this.entityName, productId, 'Product');
323
+ }
324
+
325
+ public async linkProductProducts(productId: string, productIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
326
+
327
+ const associationDtos = [];
328
+ for(const param of productIds){
329
+ associationDtos.push({
330
+ entity: 'ProductModule:Product',
331
+ recordId: param.id,
332
+ linkType: 'Product__Product',
333
+ relationType: param?.relationType,
334
+ relatedAssociationId: param?.relatedAssociationId
335
+ });
336
+ }
337
+
338
+ return await this._createLinks(this.moduleName, this.entityName, productId, associationDtos);
339
+ }
340
+
341
+ public async unLinkProductProducts(productId: string, linkedProductId: string) {
342
+
343
+ return await this._deleteLinks(this.moduleName, this.entityName, productId, linkedProductId);
344
+ }
345
+
346
+
347
+ public async addProductProductLinkProperties(productId: string, dbRecordAssociationId: string, updateDto: OdinLinkedRecordUpdateDto) {
348
+
349
+ return await this._updateLinkProperties('ProductModule', 'Product', productId, dbRecordAssociationId, updateDto);
350
+ }
320
351
  }