@d19n/youfibre-odin-sdk 1.0.21 → 1.0.23

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 (130) 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/CustomerDeviceOntRemovalApi.d.ts +7 -0
  14. package/dist/api-sdk-v1/CustomerDeviceOntRemovalApi.js +26 -0
  15. package/dist/api-sdk-v1/FileApi.d.ts +0 -49
  16. package/dist/api-sdk-v1/FileApi.js +0 -182
  17. package/dist/api-sdk-v1/InvoiceItemApi.d.ts +7 -0
  18. package/dist/api-sdk-v1/InvoiceItemApi.js +26 -0
  19. package/dist/api-sdk-v1/MilestoneApi.d.ts +7 -0
  20. package/dist/api-sdk-v1/MilestoneApi.js +26 -0
  21. package/dist/api-sdk-v1/NoteApi.d.ts +7 -0
  22. package/dist/api-sdk-v1/NoteApi.js +26 -0
  23. package/dist/api-sdk-v1/OfferApi.d.ts +7 -0
  24. package/dist/api-sdk-v1/OfferApi.js +26 -0
  25. package/dist/api-sdk-v1/OrderApi.d.ts +7 -0
  26. package/dist/api-sdk-v1/OrderApi.js +26 -0
  27. package/dist/api-sdk-v1/OrderItemApi.d.ts +7 -0
  28. package/dist/api-sdk-v1/OrderItemApi.js +26 -0
  29. package/dist/api-sdk-v1/OrganizationApi.d.ts +7 -0
  30. package/dist/api-sdk-v1/OrganizationApi.js +26 -0
  31. package/dist/api-sdk-v1/ProductApi.d.ts +9 -1
  32. package/dist/api-sdk-v1/ProductApi.js +31 -0
  33. package/dist/api-sdk-v1/ProductComponentApi.d.ts +7 -0
  34. package/dist/api-sdk-v1/ProductComponentApi.js +26 -0
  35. package/dist/api-sdk-v1/RestrictionApi.d.ts +7 -0
  36. package/dist/api-sdk-v1/RestrictionApi.js +26 -0
  37. package/dist/api-sdk-v1/ServiceApi.d.ts +7 -0
  38. package/dist/api-sdk-v1/ServiceApi.js +26 -0
  39. package/dist/api-sdk-v1/SplitOrderApi.d.ts +7 -0
  40. package/dist/api-sdk-v1/SplitOrderApi.js +26 -0
  41. package/dist/api-sdk-v1/TransactionApi.d.ts +7 -0
  42. package/dist/api-sdk-v1/TransactionApi.js +26 -0
  43. package/dist/api-sdk-v1/WorkOrderApi.d.ts +14 -0
  44. package/dist/api-sdk-v1/WorkOrderApi.js +52 -0
  45. package/dist/db-sdk-v1/BillingRequestDb.d.ts +7 -0
  46. package/dist/db-sdk-v1/BillingRequestDb.js +33 -0
  47. package/dist/db-sdk-v1/CaseDb.d.ts +7 -0
  48. package/dist/db-sdk-v1/CaseDb.js +33 -0
  49. package/dist/db-sdk-v1/ConsumptionRateDb.d.ts +7 -0
  50. package/dist/db-sdk-v1/ConsumptionRateDb.js +33 -0
  51. package/dist/db-sdk-v1/ConsumptionScheduleDb.d.ts +7 -0
  52. package/dist/db-sdk-v1/ConsumptionScheduleDb.js +33 -0
  53. package/dist/db-sdk-v1/ContactDb.d.ts +7 -0
  54. package/dist/db-sdk-v1/ContactDb.js +33 -0
  55. package/dist/db-sdk-v1/ContactIdentityDb.d.ts +7 -0
  56. package/dist/db-sdk-v1/ContactIdentityDb.js +33 -0
  57. package/dist/db-sdk-v1/FileDb.d.ts +0 -49
  58. package/dist/db-sdk-v1/FileDb.js +0 -231
  59. package/dist/db-sdk-v1/InvoiceItemDb.d.ts +7 -0
  60. package/dist/db-sdk-v1/InvoiceItemDb.js +33 -0
  61. package/dist/db-sdk-v1/MilestoneDb.d.ts +7 -0
  62. package/dist/db-sdk-v1/MilestoneDb.js +33 -0
  63. package/dist/db-sdk-v1/NoteDb.d.ts +7 -0
  64. package/dist/db-sdk-v1/NoteDb.js +33 -0
  65. package/dist/db-sdk-v1/OfferDb.d.ts +7 -0
  66. package/dist/db-sdk-v1/OfferDb.js +33 -0
  67. package/dist/db-sdk-v1/OrderDb.d.ts +7 -0
  68. package/dist/db-sdk-v1/OrderDb.js +33 -0
  69. package/dist/db-sdk-v1/OrderItemDb.d.ts +7 -0
  70. package/dist/db-sdk-v1/OrderItemDb.js +33 -0
  71. package/dist/db-sdk-v1/OrganizationDb.d.ts +7 -0
  72. package/dist/db-sdk-v1/OrganizationDb.js +33 -0
  73. package/dist/db-sdk-v1/ProductComponentDb.d.ts +7 -0
  74. package/dist/db-sdk-v1/ProductComponentDb.js +33 -0
  75. package/dist/db-sdk-v1/ProductDb.d.ts +9 -1
  76. package/dist/db-sdk-v1/ProductDb.js +38 -0
  77. package/dist/db-sdk-v1/RestrictionDb.d.ts +7 -0
  78. package/dist/db-sdk-v1/RestrictionDb.js +33 -0
  79. package/dist/db-sdk-v1/ServiceDb.d.ts +7 -0
  80. package/dist/db-sdk-v1/ServiceDb.js +33 -0
  81. package/dist/db-sdk-v1/SplitOrderDb.d.ts +7 -0
  82. package/dist/db-sdk-v1/SplitOrderDb.js +33 -0
  83. package/dist/db-sdk-v1/TransactionDb.d.ts +7 -0
  84. package/dist/db-sdk-v1/TransactionDb.js +33 -0
  85. package/dist/db-sdk-v1/WorkOrderDb.d.ts +14 -0
  86. package/dist/db-sdk-v1/WorkOrderDb.js +66 -0
  87. package/package.json +2 -2
  88. package/src/api-sdk-v1/BillingRequestApi.ts +27 -0
  89. package/src/api-sdk-v1/CaseApi.ts +27 -0
  90. package/src/api-sdk-v1/ConsumptionRateApi.ts +27 -0
  91. package/src/api-sdk-v1/ConsumptionScheduleApi.ts +27 -0
  92. package/src/api-sdk-v1/ContactApi.ts +27 -0
  93. package/src/api-sdk-v1/ContactIdentityApi.ts +27 -0
  94. package/src/api-sdk-v1/CustomerDeviceOntRemovalApi.ts +27 -0
  95. package/src/api-sdk-v1/FileApi.ts +0 -189
  96. package/src/api-sdk-v1/InvoiceItemApi.ts +27 -0
  97. package/src/api-sdk-v1/MilestoneApi.ts +27 -0
  98. package/src/api-sdk-v1/NoteApi.ts +27 -0
  99. package/src/api-sdk-v1/OfferApi.ts +27 -0
  100. package/src/api-sdk-v1/OrderApi.ts +27 -0
  101. package/src/api-sdk-v1/OrderItemApi.ts +27 -0
  102. package/src/api-sdk-v1/OrganizationApi.ts +27 -0
  103. package/src/api-sdk-v1/ProductApi.ts +31 -0
  104. package/src/api-sdk-v1/ProductComponentApi.ts +27 -0
  105. package/src/api-sdk-v1/RestrictionApi.ts +27 -0
  106. package/src/api-sdk-v1/ServiceApi.ts +27 -0
  107. package/src/api-sdk-v1/SplitOrderApi.ts +27 -0
  108. package/src/api-sdk-v1/TransactionApi.ts +27 -0
  109. package/src/api-sdk-v1/WorkOrderApi.ts +54 -0
  110. package/src/db-sdk-v1/BillingRequestDb.ts +35 -0
  111. package/src/db-sdk-v1/CaseDb.ts +35 -0
  112. package/src/db-sdk-v1/ConsumptionRateDb.ts +35 -0
  113. package/src/db-sdk-v1/ConsumptionScheduleDb.ts +35 -0
  114. package/src/db-sdk-v1/ContactDb.ts +35 -0
  115. package/src/db-sdk-v1/ContactIdentityDb.ts +35 -0
  116. package/src/db-sdk-v1/FileDb.ts +0 -245
  117. package/src/db-sdk-v1/InvoiceItemDb.ts +35 -0
  118. package/src/db-sdk-v1/MilestoneDb.ts +35 -0
  119. package/src/db-sdk-v1/NoteDb.ts +35 -0
  120. package/src/db-sdk-v1/OfferDb.ts +35 -0
  121. package/src/db-sdk-v1/OrderDb.ts +35 -0
  122. package/src/db-sdk-v1/OrderItemDb.ts +35 -0
  123. package/src/db-sdk-v1/OrganizationDb.ts +35 -0
  124. package/src/db-sdk-v1/ProductComponentDb.ts +35 -0
  125. package/src/db-sdk-v1/ProductDb.ts +39 -0
  126. package/src/db-sdk-v1/RestrictionDb.ts +35 -0
  127. package/src/db-sdk-v1/ServiceDb.ts +35 -0
  128. package/src/db-sdk-v1/SplitOrderDb.ts +35 -0
  129. package/src/db-sdk-v1/TransactionDb.ts +35 -0
  130. package/src/db-sdk-v1/WorkOrderDb.ts +70 -0
@@ -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 getWorkOrders(customerDeviceOntRemovalId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, customerDeviceOntRemovalId, 'WorkOrder');
107
+ }
108
+
109
+ public async linkWorkOrderCustomerDeviceOntRemovals(customerDeviceOntRemovalId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of workOrderIds){
113
+ associationDtos.push({
114
+ entity: 'FieldServiceModule:WorkOrder',
115
+ recordId: param.id,
116
+ linkType: 'WorkOrder_CustomerDeviceOntRemoval',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, customerDeviceOntRemovalId, associationDtos);
123
+ }
124
+
125
+ public async unLinkWorkOrderCustomerDeviceOntRemovals(customerDeviceOntRemovalId: string, linkedWorkOrderId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, customerDeviceOntRemovalId, linkedWorkOrderId);
128
+ }
129
+
130
+
104
131
  }
@@ -209,33 +209,6 @@
209
209
  }
210
210
 
211
211
 
212
- // Use this function when you want to return a single record
213
- public async getKnowledgeArticles(fileId: string) {
214
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'KnowledgeArticle');
215
- }
216
-
217
- public async linkKnowledgeArticleFiles(fileId: string, knowledgeArticleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
218
-
219
- const associationDtos = [];
220
- for(const param of knowledgeArticleIds){
221
- associationDtos.push({
222
- entity: 'SupportModule:KnowledgeArticle',
223
- recordId: param.id,
224
- linkType: 'KnowledgeArticle__File',
225
- relationType: param?.relationType,
226
- relatedAssociationId: param?.relatedAssociationId
227
- });
228
- }
229
-
230
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
231
- }
232
-
233
- public async unLinkKnowledgeArticleFiles(fileId: string, linkedKnowledgeArticleId: string) {
234
-
235
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedKnowledgeArticleId);
236
- }
237
-
238
-
239
212
  // Use this function when you want to return a single record
240
213
  public async getCases(fileId: string) {
241
214
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'Case');
@@ -803,60 +776,6 @@
803
776
  }
804
777
 
805
778
 
806
- // Use this function when you want to return a single record
807
- public async getNetomniaFtth2StageInstallAudits(fileId: string) {
808
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtth2StageInstallAudit');
809
- }
810
-
811
- public async linkNetomniaFtth2StageInstallAuditFiles(fileId: string, netomniaFtth2StageInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
812
-
813
- const associationDtos = [];
814
- for(const param of netomniaFtth2StageInstallAuditIds){
815
- associationDtos.push({
816
- entity: 'FieldServiceModule:NetomniaFtth2StageInstallAudit',
817
- recordId: param.id,
818
- linkType: 'NetomniaFtth2StageInstallAudit__File',
819
- relationType: param?.relationType,
820
- relatedAssociationId: param?.relatedAssociationId
821
- });
822
- }
823
-
824
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
825
- }
826
-
827
- public async unLinkNetomniaFtth2StageInstallAuditFiles(fileId: string, linkedNetomniaFtth2StageInstallAuditId: string) {
828
-
829
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedNetomniaFtth2StageInstallAuditId);
830
- }
831
-
832
-
833
- // Use this function when you want to return a single record
834
- public async getYfStockCounts(fileId: string) {
835
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfStockCount');
836
- }
837
-
838
- public async linkYfStockCountFiles(fileId: string, yfStockCountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
839
-
840
- const associationDtos = [];
841
- for(const param of yfStockCountIds){
842
- associationDtos.push({
843
- entity: 'FieldServiceModule:YfStockCount',
844
- recordId: param.id,
845
- linkType: 'YfStockCount__File',
846
- relationType: param?.relationType,
847
- relatedAssociationId: param?.relatedAssociationId
848
- });
849
- }
850
-
851
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
852
- }
853
-
854
- public async unLinkYfStockCountFiles(fileId: string, linkedYfStockCountId: string) {
855
-
856
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedYfStockCountId);
857
- }
858
-
859
-
860
779
  // Use this function when you want to return a single record
861
780
  public async getYfEquipmentCollections(fileId: string) {
862
781
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfEquipmentCollection');
@@ -1203,87 +1122,6 @@
1203
1122
  }
1204
1123
 
1205
1124
 
1206
- // Use this function when you want to return a single record
1207
- public async getUgRetroAudits(fileId: string) {
1208
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgRetroAudit');
1209
- }
1210
-
1211
- public async linkUgRetroAuditFiles(fileId: string, ugRetroAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1212
-
1213
- const associationDtos = [];
1214
- for(const param of ugRetroAuditIds){
1215
- associationDtos.push({
1216
- entity: 'FieldServiceModule:UgRetroAudit',
1217
- recordId: param.id,
1218
- linkType: 'UgRetroAudit__File',
1219
- relationType: param?.relationType,
1220
- relatedAssociationId: param?.relatedAssociationId
1221
- });
1222
- }
1223
-
1224
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1225
- }
1226
-
1227
- public async unLinkUgRetroAuditFiles(fileId: string, linkedUgRetroAuditId: string) {
1228
-
1229
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedUgRetroAuditId);
1230
- }
1231
-
1232
-
1233
- // Use this function when you want to return a single record
1234
- public async getOhRetroAudits(fileId: string) {
1235
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhRetroAudit');
1236
- }
1237
-
1238
- public async linkOhRetroAuditFiles(fileId: string, ohRetroAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1239
-
1240
- const associationDtos = [];
1241
- for(const param of ohRetroAuditIds){
1242
- associationDtos.push({
1243
- entity: 'FieldServiceModule:OhRetroAudit',
1244
- recordId: param.id,
1245
- linkType: 'OhRetroAudit__File',
1246
- relationType: param?.relationType,
1247
- relatedAssociationId: param?.relatedAssociationId
1248
- });
1249
- }
1250
-
1251
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1252
- }
1253
-
1254
- public async unLinkOhRetroAuditFiles(fileId: string, linkedOhRetroAuditId: string) {
1255
-
1256
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOhRetroAuditId);
1257
- }
1258
-
1259
-
1260
- // Use this function when you want to return a single record
1261
- public async getRemediationOutcomeForms(fileId: string) {
1262
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'RemediationOutcomeForm');
1263
- }
1264
-
1265
- public async linkRemediationOutcomeFormFiles(fileId: string, remediationOutcomeFormIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1266
-
1267
- const associationDtos = [];
1268
- for(const param of remediationOutcomeFormIds){
1269
- associationDtos.push({
1270
- entity: 'FieldServiceModule:RemediationOutcomeForm',
1271
- recordId: param.id,
1272
- linkType: 'RemediationOutcomeForm_File',
1273
- relationType: param?.relationType,
1274
- relatedAssociationId: param?.relatedAssociationId
1275
- });
1276
- }
1277
-
1278
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1279
- }
1280
-
1281
- public async unLinkRemediationOutcomeFormFiles(fileId: string, linkedRemediationOutcomeFormId: string) {
1282
-
1283
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedRemediationOutcomeFormId);
1284
- }
1285
-
1286
-
1287
1125
  // Use this function when you want to return a single record
1288
1126
  public async getUgInProgressAudits(fileId: string) {
1289
1127
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInProgressAudit');
@@ -1338,33 +1176,6 @@
1338
1176
  }
1339
1177
 
1340
1178
 
1341
- // Use this function when you want to return a single record
1342
- public async getBlockageA55s(fileId: string) {
1343
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'BlockageA55');
1344
- }
1345
-
1346
- public async linkOverlayA55Files(fileId: string, blockageA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1347
-
1348
- const associationDtos = [];
1349
- for(const param of blockageA55Ids){
1350
- associationDtos.push({
1351
- entity: 'FieldServiceModule:BlockageA55',
1352
- recordId: param.id,
1353
- linkType: 'OverlayA55_File',
1354
- relationType: param?.relationType,
1355
- relatedAssociationId: param?.relatedAssociationId
1356
- });
1357
- }
1358
-
1359
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1360
- }
1361
-
1362
- public async unLinkOverlayA55Files(fileId: string, linkedBlockageA55Id: string) {
1363
-
1364
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedBlockageA55Id);
1365
- }
1366
-
1367
-
1368
1179
  // Use this function when you want to return a single record
1369
1180
  public async getOverlayRealA55s(fileId: string) {
1370
1181
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'OverlayRealA55');
@@ -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
  }
@@ -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 getProductComponents(productComponentId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, productComponentId, 'ProductComponent');
134
+ }
135
+
136
+ public async linkProductComponentProductComponents(productComponentId: string, productComponentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of productComponentIds){
140
+ associationDtos.push({
141
+ entity: 'ProductModule:ProductComponent',
142
+ recordId: param.id,
143
+ linkType: 'ProductComponent__ProductComponent',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
150
+ }
151
+
152
+ public async unLinkProductComponentProductComponents(productComponentId: string, linkedProductComponentId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, productComponentId, linkedProductComponentId);
155
+ }
156
+
157
+
131
158
  }
@@ -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 getRestrictions(restrictionId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, restrictionId, 'Restriction');
134
+ }
135
+
136
+ public async linkRestrictionRestrictions(restrictionId: string, restrictionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of restrictionIds){
140
+ associationDtos.push({
141
+ entity: 'ProductModule:Restriction',
142
+ recordId: param.id,
143
+ linkType: 'Restriction__Restriction',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
150
+ }
151
+
152
+ public async unLinkRestrictionRestrictions(restrictionId: string, linkedRestrictionId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, restrictionId, linkedRestrictionId);
155
+ }
156
+
157
+
131
158
  }
@@ -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 getServices(serviceId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, serviceId, 'Service');
107
+ }
108
+
109
+ public async linkServiceServices(serviceId: string, serviceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of serviceIds){
113
+ associationDtos.push({
114
+ entity: 'ServiceModule:Service',
115
+ recordId: param.id,
116
+ linkType: 'Service__Service',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, serviceId, associationDtos);
123
+ }
124
+
125
+ public async unLinkServiceServices(serviceId: string, linkedServiceId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, serviceId, linkedServiceId);
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 getSplitOrders(splitOrderId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
134
+ }
135
+
136
+ public async linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of splitOrderIds){
140
+ associationDtos.push({
141
+ entity: 'OrderModule:SplitOrder',
142
+ recordId: param.id,
143
+ linkType: 'SplitOrder__SplitOrder',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
150
+ }
151
+
152
+ public async unLinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, linkedSplitOrderId);
155
+ }
156
+
157
+
131
158
  public async linkOrderSplitOrders(splitOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
132
159
 
133
160
  const associationDtos = [];