@d19n/youfibre-odin-sdk 1.0.19 → 1.0.21

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 (146) hide show
  1. package/dist/api-sdk-v1/BillingRequestApi.d.ts +0 -7
  2. package/dist/api-sdk-v1/BillingRequestApi.js +0 -26
  3. package/dist/api-sdk-v1/CaseApi.d.ts +0 -7
  4. package/dist/api-sdk-v1/CaseApi.js +0 -26
  5. package/dist/api-sdk-v1/ConsumptionRateApi.d.ts +0 -7
  6. package/dist/api-sdk-v1/ConsumptionRateApi.js +0 -26
  7. package/dist/api-sdk-v1/ConsumptionScheduleApi.d.ts +0 -7
  8. package/dist/api-sdk-v1/ConsumptionScheduleApi.js +0 -26
  9. package/dist/api-sdk-v1/ContactApi.d.ts +87 -3
  10. package/dist/api-sdk-v1/ContactApi.js +319 -7
  11. package/dist/api-sdk-v1/ContactIdentityApi.d.ts +0 -7
  12. package/dist/api-sdk-v1/ContactIdentityApi.js +0 -26
  13. package/dist/api-sdk-v1/FileApi.d.ts +338 -3
  14. package/dist/api-sdk-v1/FileApi.js +1249 -7
  15. package/dist/api-sdk-v1/InvoiceItemApi.d.ts +0 -7
  16. package/dist/api-sdk-v1/InvoiceItemApi.js +0 -26
  17. package/dist/api-sdk-v1/LeadApi.d.ts +24 -3
  18. package/dist/api-sdk-v1/LeadApi.js +85 -7
  19. package/dist/api-sdk-v1/MilestoneApi.d.ts +0 -7
  20. package/dist/api-sdk-v1/MilestoneApi.js +0 -26
  21. package/dist/api-sdk-v1/NoteApi.d.ts +3 -4
  22. package/dist/api-sdk-v1/NoteApi.js +7 -13
  23. package/dist/api-sdk-v1/OfferApi.d.ts +0 -7
  24. package/dist/api-sdk-v1/OfferApi.js +0 -26
  25. package/dist/api-sdk-v1/OrderApi.d.ts +7 -8
  26. package/dist/api-sdk-v1/OrderApi.js +21 -27
  27. package/dist/api-sdk-v1/OrderItemApi.d.ts +0 -7
  28. package/dist/api-sdk-v1/OrderItemApi.js +0 -26
  29. package/dist/api-sdk-v1/OrganizationApi.d.ts +0 -7
  30. package/dist/api-sdk-v1/OrganizationApi.js +0 -26
  31. package/dist/api-sdk-v1/ProductApi.d.ts +1 -9
  32. package/dist/api-sdk-v1/ProductApi.js +0 -31
  33. package/dist/api-sdk-v1/ProductComponentApi.d.ts +0 -7
  34. package/dist/api-sdk-v1/ProductComponentApi.js +0 -26
  35. package/dist/api-sdk-v1/RestrictionApi.d.ts +0 -7
  36. package/dist/api-sdk-v1/RestrictionApi.js +0 -26
  37. package/dist/api-sdk-v1/ServiceApi.d.ts +0 -7
  38. package/dist/api-sdk-v1/ServiceApi.js +0 -26
  39. package/dist/api-sdk-v1/ServiceAppointmentConfigApi.d.ts +12 -0
  40. package/dist/api-sdk-v1/ServiceAppointmentConfigApi.js +40 -0
  41. package/dist/api-sdk-v1/SplitOrderApi.d.ts +2 -3
  42. package/dist/api-sdk-v1/SplitOrderApi.js +6 -12
  43. package/dist/api-sdk-v1/TransactionApi.d.ts +0 -7
  44. package/dist/api-sdk-v1/TransactionApi.js +0 -26
  45. package/dist/api-sdk-v1/UserApi.d.ts +18 -0
  46. package/dist/api-sdk-v1/UserApi.js +60 -0
  47. package/dist/api-sdk-v1/WorkOrderApi.d.ts +44 -3
  48. package/dist/api-sdk-v1/WorkOrderApi.js +157 -7
  49. package/dist/db-sdk-v1/BillingRequestDb.d.ts +0 -7
  50. package/dist/db-sdk-v1/BillingRequestDb.js +0 -33
  51. package/dist/db-sdk-v1/CaseDb.d.ts +0 -7
  52. package/dist/db-sdk-v1/CaseDb.js +0 -33
  53. package/dist/db-sdk-v1/ConsumptionRateDb.d.ts +0 -7
  54. package/dist/db-sdk-v1/ConsumptionRateDb.js +0 -33
  55. package/dist/db-sdk-v1/ConsumptionScheduleDb.d.ts +0 -7
  56. package/dist/db-sdk-v1/ConsumptionScheduleDb.js +0 -33
  57. package/dist/db-sdk-v1/ContactDb.d.ts +87 -3
  58. package/dist/db-sdk-v1/ContactDb.js +403 -7
  59. package/dist/db-sdk-v1/ContactIdentityDb.d.ts +0 -7
  60. package/dist/db-sdk-v1/ContactIdentityDb.js +0 -33
  61. package/dist/db-sdk-v1/FileDb.d.ts +338 -3
  62. package/dist/db-sdk-v1/FileDb.js +1585 -7
  63. package/dist/db-sdk-v1/InvoiceItemDb.d.ts +0 -7
  64. package/dist/db-sdk-v1/InvoiceItemDb.js +0 -33
  65. package/dist/db-sdk-v1/LeadDb.d.ts +24 -3
  66. package/dist/db-sdk-v1/LeadDb.js +106 -7
  67. package/dist/db-sdk-v1/MilestoneDb.d.ts +0 -7
  68. package/dist/db-sdk-v1/MilestoneDb.js +0 -33
  69. package/dist/db-sdk-v1/NoteDb.d.ts +3 -4
  70. package/dist/db-sdk-v1/NoteDb.js +7 -13
  71. package/dist/db-sdk-v1/OfferDb.d.ts +0 -7
  72. package/dist/db-sdk-v1/OfferDb.js +0 -33
  73. package/dist/db-sdk-v1/OrderDb.d.ts +7 -8
  74. package/dist/db-sdk-v1/OrderDb.js +28 -34
  75. package/dist/db-sdk-v1/OrderItemDb.d.ts +0 -7
  76. package/dist/db-sdk-v1/OrderItemDb.js +0 -33
  77. package/dist/db-sdk-v1/OrganizationDb.d.ts +0 -7
  78. package/dist/db-sdk-v1/OrganizationDb.js +0 -33
  79. package/dist/db-sdk-v1/ProductComponentDb.d.ts +0 -7
  80. package/dist/db-sdk-v1/ProductComponentDb.js +0 -33
  81. package/dist/db-sdk-v1/ProductDb.d.ts +1 -9
  82. package/dist/db-sdk-v1/ProductDb.js +0 -38
  83. package/dist/db-sdk-v1/RestrictionDb.d.ts +0 -7
  84. package/dist/db-sdk-v1/RestrictionDb.js +0 -33
  85. package/dist/db-sdk-v1/ServiceAppointmentConfigDb.d.ts +12 -0
  86. package/dist/db-sdk-v1/ServiceAppointmentConfigDb.js +54 -0
  87. package/dist/db-sdk-v1/ServiceDb.d.ts +0 -7
  88. package/dist/db-sdk-v1/ServiceDb.js +0 -33
  89. package/dist/db-sdk-v1/SplitOrderDb.d.ts +2 -3
  90. package/dist/db-sdk-v1/SplitOrderDb.js +6 -12
  91. package/dist/db-sdk-v1/TransactionDb.d.ts +0 -7
  92. package/dist/db-sdk-v1/TransactionDb.js +0 -33
  93. package/dist/db-sdk-v1/UserDb.d.ts +18 -0
  94. package/dist/db-sdk-v1/UserDb.js +81 -0
  95. package/dist/db-sdk-v1/WorkOrderDb.d.ts +44 -3
  96. package/dist/db-sdk-v1/WorkOrderDb.js +199 -7
  97. package/package.json +2 -2
  98. package/src/api-sdk-v1/BillingRequestApi.ts +0 -27
  99. package/src/api-sdk-v1/CaseApi.ts +0 -27
  100. package/src/api-sdk-v1/ConsumptionRateApi.ts +0 -27
  101. package/src/api-sdk-v1/ConsumptionScheduleApi.ts +0 -27
  102. package/src/api-sdk-v1/ContactApi.ts +343 -19
  103. package/src/api-sdk-v1/ContactIdentityApi.ts +0 -27
  104. package/src/api-sdk-v1/FileApi.ts +1310 -19
  105. package/src/api-sdk-v1/InvoiceItemApi.ts +0 -27
  106. package/src/api-sdk-v1/LeadApi.ts +100 -19
  107. package/src/api-sdk-v1/MilestoneApi.ts +0 -27
  108. package/src/api-sdk-v1/NoteApi.ts +7 -12
  109. package/src/api-sdk-v1/OfferApi.ts +0 -27
  110. package/src/api-sdk-v1/OrderApi.ts +23 -28
  111. package/src/api-sdk-v1/OrderItemApi.ts +0 -27
  112. package/src/api-sdk-v1/OrganizationApi.ts +0 -27
  113. package/src/api-sdk-v1/ProductApi.ts +0 -31
  114. package/src/api-sdk-v1/ProductComponentApi.ts +0 -27
  115. package/src/api-sdk-v1/RestrictionApi.ts +0 -27
  116. package/src/api-sdk-v1/ServiceApi.ts +0 -27
  117. package/src/api-sdk-v1/ServiceAppointmentConfigApi.ts +44 -0
  118. package/src/api-sdk-v1/SplitOrderApi.ts +17 -22
  119. package/src/api-sdk-v1/TransactionApi.ts +0 -27
  120. package/src/api-sdk-v1/UserApi.ts +66 -0
  121. package/src/api-sdk-v1/WorkOrderApi.ts +178 -21
  122. package/src/db-sdk-v1/BillingRequestDb.ts +0 -35
  123. package/src/db-sdk-v1/CaseDb.ts +0 -35
  124. package/src/db-sdk-v1/ConsumptionRateDb.ts +0 -35
  125. package/src/db-sdk-v1/ConsumptionScheduleDb.ts +0 -35
  126. package/src/db-sdk-v1/ContactDb.ts +443 -23
  127. package/src/db-sdk-v1/ContactIdentityDb.ts +0 -35
  128. package/src/db-sdk-v1/FileDb.ts +1698 -23
  129. package/src/db-sdk-v1/InvoiceItemDb.ts +0 -35
  130. package/src/db-sdk-v1/LeadDb.ts +128 -23
  131. package/src/db-sdk-v1/MilestoneDb.ts +0 -35
  132. package/src/db-sdk-v1/NoteDb.ts +7 -12
  133. package/src/db-sdk-v1/OfferDb.ts +0 -35
  134. package/src/db-sdk-v1/OrderDb.ts +31 -36
  135. package/src/db-sdk-v1/OrderItemDb.ts +0 -35
  136. package/src/db-sdk-v1/OrganizationDb.ts +0 -35
  137. package/src/db-sdk-v1/ProductComponentDb.ts +0 -35
  138. package/src/db-sdk-v1/ProductDb.ts +0 -39
  139. package/src/db-sdk-v1/RestrictionDb.ts +0 -35
  140. package/src/db-sdk-v1/ServiceAppointmentConfigDb.ts +60 -0
  141. package/src/db-sdk-v1/ServiceDb.ts +0 -35
  142. package/src/db-sdk-v1/SplitOrderDb.ts +20 -25
  143. package/src/db-sdk-v1/TransactionDb.ts +0 -35
  144. package/src/db-sdk-v1/UserDb.ts +90 -0
  145. package/src/db-sdk-v1/WorkOrderDb.ts +229 -24
  146. package/src/generators/runner.ts +2 -3
@@ -101,33 +101,6 @@
101
101
  }
102
102
 
103
103
 
104
- // Use this function when you want to return a single record
105
- public async getTransactions(transactionId: string) {
106
- return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
107
- }
108
-
109
- public async linkTransactionTransactions(transactionId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
-
111
- const associationDtos = [];
112
- for(const param of transactionIds){
113
- associationDtos.push({
114
- entity: 'BillingModule:Transaction',
115
- recordId: param.id,
116
- linkType: 'Transaction__Transaction',
117
- relationType: param?.relationType,
118
- relatedAssociationId: param?.relatedAssociationId
119
- });
120
- }
121
-
122
- return await this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
123
- }
124
-
125
- public async unLinkTransactionTransactions(transactionId: string, linkedTransactionId: string) {
126
-
127
- return await this._deleteLinks(this.moduleName, this.entityName, transactionId, linkedTransactionId);
128
- }
129
-
130
-
131
104
  // Use this function when you want to return a single record
132
105
  public async getInvoices(transactionId: string) {
133
106
  return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -371,4 +371,70 @@
371
371
  }
372
372
 
373
373
 
374
+ public async linkWorkOrderOwners(userId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
375
+
376
+ const associationDtos = [];
377
+ for(const param of workOrderIds){
378
+ associationDtos.push({
379
+ entity: 'FieldServiceModule:WorkOrder',
380
+ recordId: param.id,
381
+ linkType: 'WorkOrderOwner',
382
+ relationType: param?.relationType,
383
+ relatedAssociationId: param?.relatedAssociationId
384
+ });
385
+ }
386
+
387
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
388
+ }
389
+
390
+ public async unLinkWorkOrderOwners(userId: string, linkedWorkOrderId: string) {
391
+
392
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, linkedWorkOrderId);
393
+ }
394
+
395
+
396
+ public async linkManagers(userId: string, serviceAppointmentConfigIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
397
+
398
+ const associationDtos = [];
399
+ for(const param of serviceAppointmentConfigIds){
400
+ associationDtos.push({
401
+ entity: 'FieldServiceModule:ServiceAppointmentConfig',
402
+ recordId: param.id,
403
+ linkType: 'Manager',
404
+ relationType: param?.relationType,
405
+ relatedAssociationId: param?.relatedAssociationId
406
+ });
407
+ }
408
+
409
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
410
+ }
411
+
412
+ public async unLinkManagers(userId: string, linkedServiceAppointmentConfigId: string) {
413
+
414
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, linkedServiceAppointmentConfigId);
415
+ }
416
+
417
+
418
+ public async linkSupervisors(userId: string, serviceAppointmentConfigIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
419
+
420
+ const associationDtos = [];
421
+ for(const param of serviceAppointmentConfigIds){
422
+ associationDtos.push({
423
+ entity: 'FieldServiceModule:ServiceAppointmentConfig',
424
+ recordId: param.id,
425
+ linkType: 'Supervisor',
426
+ relationType: param?.relationType,
427
+ relatedAssociationId: param?.relatedAssociationId
428
+ });
429
+ }
430
+
431
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
432
+ }
433
+
434
+ public async unLinkSupervisors(userId: string, linkedServiceAppointmentConfigId: string) {
435
+
436
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, linkedServiceAppointmentConfigId);
437
+ }
438
+
439
+
374
440
  }
@@ -236,31 +236,31 @@
236
236
  }
237
237
 
238
238
 
239
- // Use this function when you want to return a single record
240
- public async getWorkOrders(workOrderId: string) {
241
- return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
242
- }
239
+ // Use this function when you want to return a single record
240
+ public async getAccounts(workOrderId: string) {
241
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Account');
242
+ }
243
243
 
244
- public async linkAccountWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
245
-
246
- const associationDtos = [];
247
- for(const param of workOrderIds){
248
- associationDtos.push({
249
- entity: 'FieldServiceModule:WorkOrder',
250
- recordId: param.id,
251
- linkType: 'Account__WorkOrder',
252
- relationType: param?.relationType,
253
- relatedAssociationId: param?.relatedAssociationId
254
- });
255
- }
244
+ public async linkAccountWorkOrders(workOrderId: string, accountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
256
245
 
257
- return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
246
+ const associationDtos = [];
247
+ for(const param of accountIds){
248
+ associationDtos.push({
249
+ entity: 'CrmModule:Account',
250
+ recordId: param.id,
251
+ linkType: 'Account__WorkOrder',
252
+ relationType: param?.relationType,
253
+ relatedAssociationId: param?.relatedAssociationId
254
+ });
258
255
  }
259
256
 
260
- public async unLinkAccountWorkOrders(workOrderId: string, linkedWorkOrderId: string) {
261
-
262
- return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedWorkOrderId);
263
- }
257
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
258
+ }
259
+
260
+ public async unLinkAccountWorkOrders(workOrderId: string, linkedAccountId: string) {
261
+
262
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedAccountId);
263
+ }
264
264
 
265
265
 
266
266
  // Use this function when you want to return a single record
@@ -452,6 +452,33 @@
452
452
  }
453
453
 
454
454
 
455
+ // Use this function when you want to return a single record
456
+ public async getPaymentMethodRefunds(workOrderId: string) {
457
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'PaymentMethodRefund');
458
+ }
459
+
460
+ public async linkPaymentMethodRefundWorkOrders(workOrderId: string, paymentMethodRefundIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
461
+
462
+ const associationDtos = [];
463
+ for(const param of paymentMethodRefundIds){
464
+ associationDtos.push({
465
+ entity: 'BillingModule:PaymentMethodRefund',
466
+ recordId: param.id,
467
+ linkType: 'PaymentMethodRefund__WorkOrder',
468
+ relationType: param?.relationType,
469
+ relatedAssociationId: param?.relatedAssociationId
470
+ });
471
+ }
472
+
473
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
474
+ }
475
+
476
+ public async unLinkPaymentMethodRefundWorkOrders(workOrderId: string, linkedPaymentMethodRefundId: string) {
477
+
478
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedPaymentMethodRefundId);
479
+ }
480
+
481
+
455
482
  // Use this function when you want to return a single record
456
483
  public async getLeads(workOrderId: string) {
457
484
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Lead');
@@ -587,6 +614,33 @@
587
614
  }
588
615
 
589
616
 
617
+ // Use this function when you want to return a single record
618
+ public async getOrders(workOrderId: string) {
619
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Order');
620
+ }
621
+
622
+ public async linkOrderWorkOrders(workOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
623
+
624
+ const associationDtos = [];
625
+ for(const param of orderIds){
626
+ associationDtos.push({
627
+ entity: 'OrderModule:Order',
628
+ recordId: param.id,
629
+ linkType: 'Order__WorkOrder',
630
+ relationType: param?.relationType,
631
+ relatedAssociationId: param?.relatedAssociationId
632
+ });
633
+ }
634
+
635
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
636
+ }
637
+
638
+ public async unLinkOrderWorkOrders(workOrderId: string, linkedOrderId: string) {
639
+
640
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedOrderId);
641
+ }
642
+
643
+
590
644
  // Use this function when you want to return a single record
591
645
  public async getServiceAppointmentConfigs(workOrderId: string) {
592
646
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'ServiceAppointmentConfig');
@@ -668,6 +722,87 @@
668
722
  }
669
723
 
670
724
 
725
+ // Use this function when you want to return a single record
726
+ public async getOrderRemediationTasks(workOrderId: string) {
727
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OrderRemediationTask');
728
+ }
729
+
730
+ public async linkOrderRemediationTaskWorkOrders(workOrderId: string, orderRemediationTaskIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
731
+
732
+ const associationDtos = [];
733
+ for(const param of orderRemediationTaskIds){
734
+ associationDtos.push({
735
+ entity: 'OrderModule:OrderRemediationTask',
736
+ recordId: param.id,
737
+ linkType: 'OrderRemediationTask__WorkOrder',
738
+ relationType: param?.relationType,
739
+ relatedAssociationId: param?.relatedAssociationId
740
+ });
741
+ }
742
+
743
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
744
+ }
745
+
746
+ public async unLinkOrderRemediationTaskWorkOrders(workOrderId: string, linkedOrderRemediationTaskId: string) {
747
+
748
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedOrderRemediationTaskId);
749
+ }
750
+
751
+
752
+ // Use this function when you want to return a single record
753
+ public async getCases(workOrderId: string) {
754
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Case');
755
+ }
756
+
757
+ public async linkCaseWorkOrders(workOrderId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
758
+
759
+ const associationDtos = [];
760
+ for(const param of caseIds){
761
+ associationDtos.push({
762
+ entity: 'SupportModule:Case',
763
+ recordId: param.id,
764
+ linkType: 'Case__WorkOrder',
765
+ relationType: param?.relationType,
766
+ relatedAssociationId: param?.relatedAssociationId
767
+ });
768
+ }
769
+
770
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
771
+ }
772
+
773
+ public async unLinkCaseWorkOrders(workOrderId: string, linkedCaseId: string) {
774
+
775
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedCaseId);
776
+ }
777
+
778
+
779
+ // Use this function when you want to return a single record
780
+ public async getCalls(workOrderId: string) {
781
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Call');
782
+ }
783
+
784
+ public async linkCallWorkOrders(workOrderId: string, callIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
785
+
786
+ const associationDtos = [];
787
+ for(const param of callIds){
788
+ associationDtos.push({
789
+ entity: 'NotificationModule:Call',
790
+ recordId: param.id,
791
+ linkType: 'Call__WorkOrder',
792
+ relationType: param?.relationType,
793
+ relatedAssociationId: param?.relatedAssociationId
794
+ });
795
+ }
796
+
797
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
798
+ }
799
+
800
+ public async unLinkCallWorkOrders(workOrderId: string, linkedCallId: string) {
801
+
802
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedCallId);
803
+ }
804
+
805
+
671
806
  // Use this function when you want to return a single record
672
807
  public async getPermissionToFails(workOrderId: string) {
673
808
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'PermissionToFail');
@@ -857,6 +992,28 @@
857
992
  }
858
993
 
859
994
 
995
+ public async linkWorkOrderOwners(workOrderId: string, userIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
996
+
997
+ const associationDtos = [];
998
+ for(const param of userIds){
999
+ associationDtos.push({
1000
+ entity: 'IdentityModule:User',
1001
+ recordId: param.id,
1002
+ linkType: 'WorkOrderOwner',
1003
+ relationType: param?.relationType,
1004
+ relatedAssociationId: param?.relatedAssociationId
1005
+ });
1006
+ }
1007
+
1008
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1009
+ }
1010
+
1011
+ public async unLinkWorkOrderOwners(workOrderId: string, linkedUserId: string) {
1012
+
1013
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedUserId);
1014
+ }
1015
+
1016
+
860
1017
  // Use this function when you want to return a single record
861
1018
  public async getNetomniaFtthServiceVisitSheets(workOrderId: string) {
862
1019
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'NetomniaFtthServiceVisitSheet');
@@ -99,41 +99,6 @@
99
99
  }
100
100
 
101
101
 
102
- // Use this function when you want to return a single record
103
- public async getBillingRequests(billingRequestId: string) {
104
- return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'BillingRequest');
105
- }
106
-
107
- public async linkBillingRequestBillingRequests(billingRequestId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
-
109
- const associationDtos = [];
110
- for(const param of billingRequestIds){
111
- associationDtos.push({
112
- entity: 'BillingModule:BillingRequest',
113
- recordId: param.id,
114
- linkType: 'BillingRequest__BillingRequest',
115
- relationType: param?.relationType,
116
- relatedAssociationId: param?.relatedAssociationId
117
- });
118
- }
119
-
120
- return await this._createLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
121
- }
122
-
123
- public async unlinkBillingRequestBillingRequests(billingRequestId: string, linkedBillingRequestIds: string[]) {
124
-
125
- const associationDtos = [];
126
- for(const pk of linkedBillingRequestIds){
127
- associationDtos.push({
128
- primaryKey: billingRequestId,
129
- linkedRecordPrimaryKey: pk,
130
- });
131
- }
132
-
133
- return await this._deleteLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
134
- }
135
-
136
-
137
102
  // Use this function when you want to return a single record
138
103
  public async getFiles(billingRequestId: string) {
139
104
  return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'File');
@@ -64,41 +64,6 @@
64
64
  }
65
65
 
66
66
 
67
- // Use this function when you want to return a single record
68
- public async getCases(caseId: string) {
69
- return await this._getLinks(this.moduleName, this.entityName, caseId, 'Case');
70
- }
71
-
72
- public async linkCaseCases(caseId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
73
-
74
- const associationDtos = [];
75
- for(const param of caseIds){
76
- associationDtos.push({
77
- entity: 'SupportModule:Case',
78
- recordId: param.id,
79
- linkType: 'Case__Case',
80
- relationType: param?.relationType,
81
- relatedAssociationId: param?.relatedAssociationId
82
- });
83
- }
84
-
85
- return await this._createLinks(this.moduleName, this.entityName, caseId, associationDtos);
86
- }
87
-
88
- public async unlinkCaseCases(caseId: string, linkedCaseIds: string[]) {
89
-
90
- const associationDtos = [];
91
- for(const pk of linkedCaseIds){
92
- associationDtos.push({
93
- primaryKey: caseId,
94
- linkedRecordPrimaryKey: pk,
95
- });
96
- }
97
-
98
- return await this._deleteLinks(this.moduleName, this.entityName, caseId, associationDtos);
99
- }
100
-
101
-
102
67
  // Use this function when you want to return a single record
103
68
  public async getFiles(caseId: string) {
104
69
  return await this._getLinks(this.moduleName, this.entityName, caseId, 'File');
@@ -99,39 +99,4 @@
99
99
  }
100
100
 
101
101
 
102
- // Use this function when you want to return a single record
103
- public async getConsumptionRates(consumptionRateId: string) {
104
- return await this._getLinks(this.moduleName, this.entityName, consumptionRateId, 'ConsumptionRate');
105
- }
106
-
107
- public async linkConsumptionRateConsumptionRates(consumptionRateId: string, consumptionRateIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
-
109
- const associationDtos = [];
110
- for(const param of consumptionRateIds){
111
- associationDtos.push({
112
- entity: 'ProductModule:ConsumptionRate',
113
- recordId: param.id,
114
- linkType: 'ConsumptionRate__ConsumptionRate',
115
- relationType: param?.relationType,
116
- relatedAssociationId: param?.relatedAssociationId
117
- });
118
- }
119
-
120
- return await this._createLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
121
- }
122
-
123
- public async unlinkConsumptionRateConsumptionRates(consumptionRateId: string, linkedConsumptionRateIds: string[]) {
124
-
125
- const associationDtos = [];
126
- for(const pk of linkedConsumptionRateIds){
127
- associationDtos.push({
128
- primaryKey: consumptionRateId,
129
- linkedRecordPrimaryKey: pk,
130
- });
131
- }
132
-
133
- return await this._deleteLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
134
- }
135
-
136
-
137
102
  }
@@ -134,39 +134,4 @@
134
134
  }
135
135
 
136
136
 
137
- // Use this function when you want to return a single record
138
- public async getConsumptionSchedules(consumptionScheduleId: string) {
139
- return await this._getLinks(this.moduleName, this.entityName, consumptionScheduleId, 'ConsumptionSchedule');
140
- }
141
-
142
- public async linkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, consumptionScheduleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
-
144
- const associationDtos = [];
145
- for(const param of consumptionScheduleIds){
146
- associationDtos.push({
147
- entity: 'ProductModule:ConsumptionSchedule',
148
- recordId: param.id,
149
- linkType: 'ConsumptionSchedule__ConsumptionSchedule',
150
- relationType: param?.relationType,
151
- relatedAssociationId: param?.relatedAssociationId
152
- });
153
- }
154
-
155
- return await this._createLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
156
- }
157
-
158
- public async unlinkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, linkedConsumptionScheduleIds: string[]) {
159
-
160
- const associationDtos = [];
161
- for(const pk of linkedConsumptionScheduleIds){
162
- associationDtos.push({
163
- primaryKey: consumptionScheduleId,
164
- linkedRecordPrimaryKey: pk,
165
- });
166
- }
167
-
168
- return await this._deleteLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
169
- }
170
-
171
-
172
137
  }