@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
@@ -134,6 +134,41 @@
134
134
  }
135
135
 
136
136
 
137
+ // Use this function when you want to return a single record
138
+ public async getMilestones(milestoneId: string) {
139
+ return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Milestone');
140
+ }
141
+
142
+ public async linkMilestoneMilestones(milestoneId: string, milestoneIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
+
144
+ const associationDtos = [];
145
+ for(const param of milestoneIds){
146
+ associationDtos.push({
147
+ entity: 'ProjectModule:Milestone',
148
+ recordId: param.id,
149
+ linkType: 'Milestone__Milestone',
150
+ relationType: param?.relationType,
151
+ relatedAssociationId: param?.relatedAssociationId
152
+ });
153
+ }
154
+
155
+ return await this._createLinks(this.moduleName, this.entityName, milestoneId, associationDtos);
156
+ }
157
+
158
+ public async unlinkMilestoneMilestones(milestoneId: string, linkedMilestoneIds: string[]) {
159
+
160
+ const associationDtos = [];
161
+ for(const pk of linkedMilestoneIds){
162
+ associationDtos.push({
163
+ primaryKey: milestoneId,
164
+ linkedRecordPrimaryKey: pk,
165
+ });
166
+ }
167
+
168
+ return await this._deleteLinks(this.moduleName, this.entityName, milestoneId, associationDtos);
169
+ }
170
+
171
+
137
172
  // Use this function when you want to return a single record
138
173
  public async getNotes(milestoneId: string) {
139
174
  return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Note');
@@ -1709,6 +1709,41 @@
1709
1709
  }
1710
1710
 
1711
1711
 
1712
+ // Use this function when you want to return a single record
1713
+ public async getNotes(noteId: string) {
1714
+ return await this._getLinks(this.moduleName, this.entityName, noteId, 'Note');
1715
+ }
1716
+
1717
+ public async linkNoteNotes(noteId: string, noteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1718
+
1719
+ const associationDtos = [];
1720
+ for(const param of noteIds){
1721
+ associationDtos.push({
1722
+ entity: 'SupportModule:Note',
1723
+ recordId: param.id,
1724
+ linkType: 'Note__Note',
1725
+ relationType: param?.relationType,
1726
+ relatedAssociationId: param?.relatedAssociationId
1727
+ });
1728
+ }
1729
+
1730
+ return await this._createLinks(this.moduleName, this.entityName, noteId, associationDtos);
1731
+ }
1732
+
1733
+ public async unlinkNoteNotes(noteId: string, linkedNoteIds: string[]) {
1734
+
1735
+ const associationDtos = [];
1736
+ for(const pk of linkedNoteIds){
1737
+ associationDtos.push({
1738
+ primaryKey: noteId,
1739
+ linkedRecordPrimaryKey: pk,
1740
+ });
1741
+ }
1742
+
1743
+ return await this._deleteLinks(this.moduleName, this.entityName, noteId, associationDtos);
1744
+ }
1745
+
1746
+
1712
1747
  public async linkNoteFiles(noteId: string, fileIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1713
1748
 
1714
1749
  const associationDtos = [];
@@ -169,6 +169,41 @@
169
169
  }
170
170
 
171
171
 
172
+ // Use this function when you want to return a single record
173
+ public async getOffers(offerId: string) {
174
+ return await this._getLinks(this.moduleName, this.entityName, offerId, 'Offer');
175
+ }
176
+
177
+ public async linkOfferOffers(offerId: string, offerIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
178
+
179
+ const associationDtos = [];
180
+ for(const param of offerIds){
181
+ associationDtos.push({
182
+ entity: 'ProductModule:Offer',
183
+ recordId: param.id,
184
+ linkType: 'Offer__Offer',
185
+ relationType: param?.relationType,
186
+ relatedAssociationId: param?.relatedAssociationId
187
+ });
188
+ }
189
+
190
+ return await this._createLinks(this.moduleName, this.entityName, offerId, associationDtos);
191
+ }
192
+
193
+ public async unlinkOfferOffers(offerId: string, linkedOfferIds: string[]) {
194
+
195
+ const associationDtos = [];
196
+ for(const pk of linkedOfferIds){
197
+ associationDtos.push({
198
+ primaryKey: offerId,
199
+ linkedRecordPrimaryKey: pk,
200
+ });
201
+ }
202
+
203
+ return await this._deleteLinks(this.moduleName, this.entityName, offerId, associationDtos);
204
+ }
205
+
206
+
172
207
  // Use this function when you want to return a single record
173
208
  public async getDiscounts(offerId: string) {
174
209
  return await this._getLinks(this.moduleName, this.entityName, offerId, 'Discount');
@@ -558,6 +558,41 @@
558
558
  }
559
559
 
560
560
 
561
+ // Use this function when you want to return a single record
562
+ public async getOrders(orderId: string) {
563
+ return await this._getLinks(this.moduleName, this.entityName, orderId, 'Order');
564
+ }
565
+
566
+ public async linkOrderOrders(orderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
567
+
568
+ const associationDtos = [];
569
+ for(const param of orderIds){
570
+ associationDtos.push({
571
+ entity: 'OrderModule:Order',
572
+ recordId: param.id,
573
+ linkType: 'Order__Order',
574
+ relationType: param?.relationType,
575
+ relatedAssociationId: param?.relatedAssociationId
576
+ });
577
+ }
578
+
579
+ return await this._createLinks(this.moduleName, this.entityName, orderId, associationDtos);
580
+ }
581
+
582
+ public async unlinkOrderOrders(orderId: string, linkedOrderIds: string[]) {
583
+
584
+ const associationDtos = [];
585
+ for(const pk of linkedOrderIds){
586
+ associationDtos.push({
587
+ primaryKey: orderId,
588
+ linkedRecordPrimaryKey: pk,
589
+ });
590
+ }
591
+
592
+ return await this._deleteLinks(this.moduleName, this.entityName, orderId, associationDtos);
593
+ }
594
+
595
+
561
596
  // Use this function when you want to return a single record
562
597
  public async getPicRequests(orderId: string) {
563
598
  return await this._getLinks(this.moduleName, this.entityName, orderId, 'PICRequest');
@@ -484,6 +484,41 @@
484
484
  }
485
485
 
486
486
 
487
+ // Use this function when you want to return a single record
488
+ public async getOrderItems(orderItemId: string) {
489
+ return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'OrderItem');
490
+ }
491
+
492
+ public async linkOrderItemOrderItems(orderItemId: string, orderItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
493
+
494
+ const associationDtos = [];
495
+ for(const param of orderItemIds){
496
+ associationDtos.push({
497
+ entity: 'OrderModule:OrderItem',
498
+ recordId: param.id,
499
+ linkType: 'OrderItem__OrderItem',
500
+ relationType: param?.relationType,
501
+ relatedAssociationId: param?.relatedAssociationId
502
+ });
503
+ }
504
+
505
+ return await this._createLinks(this.moduleName, this.entityName, orderItemId, associationDtos);
506
+ }
507
+
508
+ public async unlinkOrderItemOrderItems(orderItemId: string, linkedOrderItemIds: string[]) {
509
+
510
+ const associationDtos = [];
511
+ for(const pk of linkedOrderItemIds){
512
+ associationDtos.push({
513
+ primaryKey: orderItemId,
514
+ linkedRecordPrimaryKey: pk,
515
+ });
516
+ }
517
+
518
+ return await this._deleteLinks(this.moduleName, this.entityName, orderItemId, associationDtos);
519
+ }
520
+
521
+
487
522
  // Use this function when you want to return a single record
488
523
  public async getVoiceConfigurations(orderItemId: string) {
489
524
  return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'VoiceConfiguration');
@@ -169,4 +169,39 @@
169
169
  }
170
170
 
171
171
 
172
+ // Use this function when you want to return a single record
173
+ public async getOrganizations(organizationId: string) {
174
+ return await this._getLinks(this.moduleName, this.entityName, organizationId, 'Organization');
175
+ }
176
+
177
+ public async linkOrganizationOrganizations(organizationId: string, organizationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
178
+
179
+ const associationDtos = [];
180
+ for(const param of organizationIds){
181
+ associationDtos.push({
182
+ entity: 'CrmModule:Organization',
183
+ recordId: param.id,
184
+ linkType: 'Organization__Organization',
185
+ relationType: param?.relationType,
186
+ relatedAssociationId: param?.relatedAssociationId
187
+ });
188
+ }
189
+
190
+ return await this._createLinks(this.moduleName, this.entityName, organizationId, associationDtos);
191
+ }
192
+
193
+ public async unlinkOrganizationOrganizations(organizationId: string, linkedOrganizationIds: string[]) {
194
+
195
+ const associationDtos = [];
196
+ for(const pk of linkedOrganizationIds){
197
+ associationDtos.push({
198
+ primaryKey: organizationId,
199
+ linkedRecordPrimaryKey: pk,
200
+ });
201
+ }
202
+
203
+ return await this._deleteLinks(this.moduleName, this.entityName, organizationId, associationDtos);
204
+ }
205
+
206
+
172
207
  }
@@ -134,4 +134,39 @@
134
134
  }
135
135
 
136
136
 
137
+ // Use this function when you want to return a single record
138
+ public async getProductComponents(productComponentId: string) {
139
+ return await this._getLinks(this.moduleName, this.entityName, productComponentId, 'ProductComponent');
140
+ }
141
+
142
+ public async linkProductComponentProductComponents(productComponentId: string, productComponentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
+
144
+ const associationDtos = [];
145
+ for(const param of productComponentIds){
146
+ associationDtos.push({
147
+ entity: 'ProductModule:ProductComponent',
148
+ recordId: param.id,
149
+ linkType: 'ProductComponent__ProductComponent',
150
+ relationType: param?.relationType,
151
+ relatedAssociationId: param?.relatedAssociationId
152
+ });
153
+ }
154
+
155
+ return await this._createLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
156
+ }
157
+
158
+ public async unlinkProductComponentProductComponents(productComponentId: string, linkedProductComponentIds: string[]) {
159
+
160
+ const associationDtos = [];
161
+ for(const pk of linkedProductComponentIds){
162
+ associationDtos.push({
163
+ primaryKey: productComponentId,
164
+ linkedRecordPrimaryKey: pk,
165
+ });
166
+ }
167
+
168
+ return await this._deleteLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
169
+ }
170
+
171
+
137
172
  }
@@ -379,4 +379,43 @@
379
379
  }
380
380
 
381
381
 
382
+ // Use this function when you want to return a single record
383
+ public async getProducts(productId: string) {
384
+ return await this._getLinks(this.moduleName, this.entityName, productId, 'Product');
385
+ }
386
+
387
+ public async linkProductProducts(productId: string, productIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
388
+
389
+ const associationDtos = [];
390
+ for(const param of productIds){
391
+ associationDtos.push({
392
+ entity: 'ProductModule:Product',
393
+ recordId: param.id,
394
+ linkType: 'Product__Product',
395
+ relationType: param?.relationType,
396
+ relatedAssociationId: param?.relatedAssociationId
397
+ });
398
+ }
399
+
400
+ return await this._createLinks(this.moduleName, this.entityName, productId, associationDtos);
401
+ }
402
+
403
+ public async unlinkProductProducts(productId: string, linkedProductIds: string[]) {
404
+
405
+ const associationDtos = [];
406
+ for(const pk of linkedProductIds){
407
+ associationDtos.push({
408
+ primaryKey: productId,
409
+ linkedRecordPrimaryKey: pk,
410
+ });
411
+ }
412
+
413
+ return await this._deleteLinks(this.moduleName, this.entityName, productId, associationDtos);
414
+ }
415
+
416
+
417
+ public async updateProductProductLinkProperties(productId: string, dbRecordAssociationId: string, updateDto: OdinLinkedRecordUpdateDto) {
418
+
419
+ return await this._updateLinkProperties('ProductModule', 'Product', productId, dbRecordAssociationId, updateDto);
420
+ }
382
421
  }
@@ -134,4 +134,39 @@
134
134
  }
135
135
 
136
136
 
137
+ // Use this function when you want to return a single record
138
+ public async getRestrictions(restrictionId: string) {
139
+ return await this._getLinks(this.moduleName, this.entityName, restrictionId, 'Restriction');
140
+ }
141
+
142
+ public async linkRestrictionRestrictions(restrictionId: string, restrictionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
+
144
+ const associationDtos = [];
145
+ for(const param of restrictionIds){
146
+ associationDtos.push({
147
+ entity: 'ProductModule:Restriction',
148
+ recordId: param.id,
149
+ linkType: 'Restriction__Restriction',
150
+ relationType: param?.relationType,
151
+ relatedAssociationId: param?.relatedAssociationId
152
+ });
153
+ }
154
+
155
+ return await this._createLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
156
+ }
157
+
158
+ public async unlinkRestrictionRestrictions(restrictionId: string, linkedRestrictionIds: string[]) {
159
+
160
+ const associationDtos = [];
161
+ for(const pk of linkedRestrictionIds){
162
+ associationDtos.push({
163
+ primaryKey: restrictionId,
164
+ linkedRecordPrimaryKey: pk,
165
+ });
166
+ }
167
+
168
+ return await this._deleteLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
169
+ }
170
+
171
+
137
172
  }
@@ -99,4 +99,39 @@
99
99
  }
100
100
 
101
101
 
102
+ // Use this function when you want to return a single record
103
+ public async getServices(serviceId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, serviceId, 'Service');
105
+ }
106
+
107
+ public async linkServiceServices(serviceId: string, serviceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of serviceIds){
111
+ associationDtos.push({
112
+ entity: 'ServiceModule:Service',
113
+ recordId: param.id,
114
+ linkType: 'Service__Service',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
118
+ }
119
+
120
+ return await this._createLinks(this.moduleName, this.entityName, serviceId, associationDtos);
121
+ }
122
+
123
+ public async unlinkServiceServices(serviceId: string, linkedServiceIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedServiceIds){
127
+ associationDtos.push({
128
+ primaryKey: serviceId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
131
+ }
132
+
133
+ return await this._deleteLinks(this.moduleName, this.entityName, serviceId, associationDtos);
134
+ }
135
+
136
+
102
137
  }
@@ -134,6 +134,41 @@
134
134
  }
135
135
 
136
136
 
137
+ // Use this function when you want to return a single record
138
+ public async getSplitOrders(splitOrderId: string) {
139
+ return await this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
140
+ }
141
+
142
+ public async linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
+
144
+ const associationDtos = [];
145
+ for(const param of splitOrderIds){
146
+ associationDtos.push({
147
+ entity: 'OrderModule:SplitOrder',
148
+ recordId: param.id,
149
+ linkType: 'SplitOrder__SplitOrder',
150
+ relationType: param?.relationType,
151
+ relatedAssociationId: param?.relatedAssociationId
152
+ });
153
+ }
154
+
155
+ return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
156
+ }
157
+
158
+ public async unlinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderIds: string[]) {
159
+
160
+ const associationDtos = [];
161
+ for(const pk of linkedSplitOrderIds){
162
+ associationDtos.push({
163
+ primaryKey: splitOrderId,
164
+ linkedRecordPrimaryKey: pk,
165
+ });
166
+ }
167
+
168
+ return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
169
+ }
170
+
171
+
137
172
  public async linkOrderSplitOrders(splitOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
138
173
 
139
174
  const associationDtos = [];
@@ -99,6 +99,41 @@
99
99
  }
100
100
 
101
101
 
102
+ // Use this function when you want to return a single record
103
+ public async getTransactions(transactionId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
105
+ }
106
+
107
+ public async linkTransactionTransactions(transactionId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of transactionIds){
111
+ associationDtos.push({
112
+ entity: 'BillingModule:Transaction',
113
+ recordId: param.id,
114
+ linkType: 'Transaction__Transaction',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
118
+ }
119
+
120
+ return await this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
121
+ }
122
+
123
+ public async unlinkTransactionTransactions(transactionId: string, linkedTransactionIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedTransactionIds){
127
+ associationDtos.push({
128
+ primaryKey: transactionId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
131
+ }
132
+
133
+ return await this._deleteLinks(this.moduleName, this.entityName, transactionId, associationDtos);
134
+ }
135
+
136
+
102
137
  // Use this function when you want to return a single record
103
138
  public async getInvoices(transactionId: string) {
104
139
  return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -729,6 +729,41 @@
729
729
  }
730
730
 
731
731
 
732
+ // Use this function when you want to return a single record
733
+ public async getCustomerDeviceOntRemovals(workOrderId: string) {
734
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'CustomerDeviceOntRemoval');
735
+ }
736
+
737
+ public async linkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, customerDeviceOntRemovalIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
738
+
739
+ const associationDtos = [];
740
+ for(const param of customerDeviceOntRemovalIds){
741
+ associationDtos.push({
742
+ entity: 'ServiceModule:CustomerDeviceOntRemoval',
743
+ recordId: param.id,
744
+ linkType: 'WorkOrder_CustomerDeviceOntRemoval',
745
+ relationType: param?.relationType,
746
+ relatedAssociationId: param?.relatedAssociationId
747
+ });
748
+ }
749
+
750
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
751
+ }
752
+
753
+ public async unlinkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, linkedCustomerDeviceOntRemovalIds: string[]) {
754
+
755
+ const associationDtos = [];
756
+ for(const pk of linkedCustomerDeviceOntRemovalIds){
757
+ associationDtos.push({
758
+ primaryKey: workOrderId,
759
+ linkedRecordPrimaryKey: pk,
760
+ });
761
+ }
762
+
763
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
764
+ }
765
+
766
+
732
767
  // Use this function when you want to return a single record
733
768
  public async getYfEquipmentCollections(workOrderId: string) {
734
769
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'YfEquipmentCollection');
@@ -1184,6 +1219,41 @@
1184
1219
  }
1185
1220
 
1186
1221
 
1222
+ // Use this function when you want to return a single record
1223
+ public async getWorkOrders(workOrderId: string) {
1224
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
1225
+ }
1226
+
1227
+ public async linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1228
+
1229
+ const associationDtos = [];
1230
+ for(const param of workOrderIds){
1231
+ associationDtos.push({
1232
+ entity: 'FieldServiceModule:WorkOrder',
1233
+ recordId: param.id,
1234
+ linkType: 'WorkOrder__WorkOrder',
1235
+ relationType: param?.relationType,
1236
+ relatedAssociationId: param?.relatedAssociationId
1237
+ });
1238
+ }
1239
+
1240
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1241
+ }
1242
+
1243
+ public async unlinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderIds: string[]) {
1244
+
1245
+ const associationDtos = [];
1246
+ for(const pk of linkedWorkOrderIds){
1247
+ associationDtos.push({
1248
+ primaryKey: workOrderId,
1249
+ linkedRecordPrimaryKey: pk,
1250
+ });
1251
+ }
1252
+
1253
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1254
+ }
1255
+
1256
+
1187
1257
  // Use this function when you want to return a single record
1188
1258
  public async getOhAuditOfInstallations(workOrderId: string) {
1189
1259
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');