@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,6 +101,33 @@
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
+
104
131
  // Use this function when you want to return a single record
105
132
  public async getInvoices(transactionId: string) {
106
133
  return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -587,6 +587,33 @@
587
587
  }
588
588
 
589
589
 
590
+ // Use this function when you want to return a single record
591
+ public async getCustomerDeviceOntRemovals(workOrderId: string) {
592
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'CustomerDeviceOntRemoval');
593
+ }
594
+
595
+ public async linkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, customerDeviceOntRemovalIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
596
+
597
+ const associationDtos = [];
598
+ for(const param of customerDeviceOntRemovalIds){
599
+ associationDtos.push({
600
+ entity: 'ServiceModule:CustomerDeviceOntRemoval',
601
+ recordId: param.id,
602
+ linkType: 'WorkOrder_CustomerDeviceOntRemoval',
603
+ relationType: param?.relationType,
604
+ relatedAssociationId: param?.relatedAssociationId
605
+ });
606
+ }
607
+
608
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
609
+ }
610
+
611
+ public async unLinkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, linkedCustomerDeviceOntRemovalId: string) {
612
+
613
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedCustomerDeviceOntRemovalId);
614
+ }
615
+
616
+
590
617
  // Use this function when you want to return a single record
591
618
  public async getYfEquipmentCollections(workOrderId: string) {
592
619
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'YfEquipmentCollection');
@@ -938,6 +965,33 @@
938
965
  }
939
966
 
940
967
 
968
+ // Use this function when you want to return a single record
969
+ public async getWorkOrders(workOrderId: string) {
970
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
971
+ }
972
+
973
+ public async linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
974
+
975
+ const associationDtos = [];
976
+ for(const param of workOrderIds){
977
+ associationDtos.push({
978
+ entity: 'FieldServiceModule:WorkOrder',
979
+ recordId: param.id,
980
+ linkType: 'WorkOrder__WorkOrder',
981
+ relationType: param?.relationType,
982
+ relatedAssociationId: param?.relatedAssociationId
983
+ });
984
+ }
985
+
986
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
987
+ }
988
+
989
+ public async unLinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderId: string) {
990
+
991
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedWorkOrderId);
992
+ }
993
+
994
+
941
995
  // Use this function when you want to return a single record
942
996
  public async getOhAuditOfInstallations(workOrderId: string) {
943
997
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');
@@ -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 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
+
102
137
  // Use this function when you want to return a single record
103
138
  public async getFiles(billingRequestId: string) {
104
139
  return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'File');
@@ -64,6 +64,41 @@
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
+
67
102
  // Use this function when you want to return a single record
68
103
  public async getFiles(caseId: string) {
69
104
  return await this._getLinks(this.moduleName, this.entityName, caseId, 'File');
@@ -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 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
+
102
137
  }
@@ -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 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
+
137
172
  }
@@ -519,6 +519,41 @@
519
519
  }
520
520
 
521
521
 
522
+ // Use this function when you want to return a single record
523
+ public async getContacts(contactId: string) {
524
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Contact');
525
+ }
526
+
527
+ public async linkContactContacts(contactId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
528
+
529
+ const associationDtos = [];
530
+ for(const param of contactIds){
531
+ associationDtos.push({
532
+ entity: 'CrmModule:Contact',
533
+ recordId: param.id,
534
+ linkType: 'Contact__Contact',
535
+ relationType: param?.relationType,
536
+ relatedAssociationId: param?.relatedAssociationId
537
+ });
538
+ }
539
+
540
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
541
+ }
542
+
543
+ public async unlinkContactContacts(contactId: string, linkedContactIds: string[]) {
544
+
545
+ const associationDtos = [];
546
+ for(const pk of linkedContactIds){
547
+ associationDtos.push({
548
+ primaryKey: contactId,
549
+ linkedRecordPrimaryKey: pk,
550
+ });
551
+ }
552
+
553
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
554
+ }
555
+
556
+
522
557
  // Use this function when you want to return a single record
523
558
  public async getOneTouchSwitchs(contactId: string) {
524
559
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'OneTouchSwitch');
@@ -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 getContactIdentitys(contactIdentityId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'ContactIdentity');
105
+ }
106
+
107
+ public async linkContactIdentityContactIdentitys(contactIdentityId: string, contactIdentityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of contactIdentityIds){
111
+ associationDtos.push({
112
+ entity: 'CrmModule:ContactIdentity',
113
+ recordId: param.id,
114
+ linkType: 'ContactIdentity__ContactIdentity',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
118
+ }
119
+
120
+ return await this._createLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
121
+ }
122
+
123
+ public async unlinkContactIdentityContactIdentitys(contactIdentityId: string, linkedContactIdentityIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedContactIdentityIds){
127
+ associationDtos.push({
128
+ primaryKey: contactIdentityId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
131
+ }
132
+
133
+ return await this._deleteLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
134
+ }
135
+
136
+
102
137
  // Use this function when you want to return a single record
103
138
  public async getContacts(contactIdentityId: string) {
104
139
  return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'Contact');
@@ -239,41 +239,6 @@
239
239
  }
240
240
 
241
241
 
242
- // Use this function when you want to return a single record
243
- public async getKnowledgeArticles(fileId: string) {
244
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'KnowledgeArticle');
245
- }
246
-
247
- public async linkKnowledgeArticleFiles(fileId: string, knowledgeArticleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
248
-
249
- const associationDtos = [];
250
- for(const param of knowledgeArticleIds){
251
- associationDtos.push({
252
- entity: 'SupportModule:KnowledgeArticle',
253
- recordId: param.id,
254
- linkType: 'KnowledgeArticle__File',
255
- relationType: param?.relationType,
256
- relatedAssociationId: param?.relatedAssociationId
257
- });
258
- }
259
-
260
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
261
- }
262
-
263
- public async unlinkKnowledgeArticleFiles(fileId: string, linkedKnowledgeArticleIds: string[]) {
264
-
265
- const associationDtos = [];
266
- for(const pk of linkedKnowledgeArticleIds){
267
- associationDtos.push({
268
- primaryKey: fileId,
269
- linkedRecordPrimaryKey: pk,
270
- });
271
- }
272
-
273
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
274
- }
275
-
276
-
277
242
  // Use this function when you want to return a single record
278
243
  public async getCases(fileId: string) {
279
244
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'Case');
@@ -1009,76 +974,6 @@
1009
974
  }
1010
975
 
1011
976
 
1012
- // Use this function when you want to return a single record
1013
- public async getNetomniaFtth2StageInstallAudits(fileId: string) {
1014
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtth2StageInstallAudit');
1015
- }
1016
-
1017
- public async linkNetomniaFtth2StageInstallAuditFiles(fileId: string, netomniaFtth2StageInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1018
-
1019
- const associationDtos = [];
1020
- for(const param of netomniaFtth2StageInstallAuditIds){
1021
- associationDtos.push({
1022
- entity: 'FieldServiceModule:NetomniaFtth2StageInstallAudit',
1023
- recordId: param.id,
1024
- linkType: 'NetomniaFtth2StageInstallAudit__File',
1025
- relationType: param?.relationType,
1026
- relatedAssociationId: param?.relatedAssociationId
1027
- });
1028
- }
1029
-
1030
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1031
- }
1032
-
1033
- public async unlinkNetomniaFtth2StageInstallAuditFiles(fileId: string, linkedNetomniaFtth2StageInstallAuditIds: string[]) {
1034
-
1035
- const associationDtos = [];
1036
- for(const pk of linkedNetomniaFtth2StageInstallAuditIds){
1037
- associationDtos.push({
1038
- primaryKey: fileId,
1039
- linkedRecordPrimaryKey: pk,
1040
- });
1041
- }
1042
-
1043
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1044
- }
1045
-
1046
-
1047
- // Use this function when you want to return a single record
1048
- public async getYfStockCounts(fileId: string) {
1049
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfStockCount');
1050
- }
1051
-
1052
- public async linkYfStockCountFiles(fileId: string, yfStockCountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1053
-
1054
- const associationDtos = [];
1055
- for(const param of yfStockCountIds){
1056
- associationDtos.push({
1057
- entity: 'FieldServiceModule:YfStockCount',
1058
- recordId: param.id,
1059
- linkType: 'YfStockCount__File',
1060
- relationType: param?.relationType,
1061
- relatedAssociationId: param?.relatedAssociationId
1062
- });
1063
- }
1064
-
1065
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1066
- }
1067
-
1068
- public async unlinkYfStockCountFiles(fileId: string, linkedYfStockCountIds: string[]) {
1069
-
1070
- const associationDtos = [];
1071
- for(const pk of linkedYfStockCountIds){
1072
- associationDtos.push({
1073
- primaryKey: fileId,
1074
- linkedRecordPrimaryKey: pk,
1075
- });
1076
- }
1077
-
1078
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1079
- }
1080
-
1081
-
1082
977
  // Use this function when you want to return a single record
1083
978
  public async getYfEquipmentCollections(fileId: string) {
1084
979
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfEquipmentCollection');
@@ -1529,111 +1424,6 @@
1529
1424
  }
1530
1425
 
1531
1426
 
1532
- // Use this function when you want to return a single record
1533
- public async getUgRetroAudits(fileId: string) {
1534
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgRetroAudit');
1535
- }
1536
-
1537
- public async linkUgRetroAuditFiles(fileId: string, ugRetroAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1538
-
1539
- const associationDtos = [];
1540
- for(const param of ugRetroAuditIds){
1541
- associationDtos.push({
1542
- entity: 'FieldServiceModule:UgRetroAudit',
1543
- recordId: param.id,
1544
- linkType: 'UgRetroAudit__File',
1545
- relationType: param?.relationType,
1546
- relatedAssociationId: param?.relatedAssociationId
1547
- });
1548
- }
1549
-
1550
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1551
- }
1552
-
1553
- public async unlinkUgRetroAuditFiles(fileId: string, linkedUgRetroAuditIds: string[]) {
1554
-
1555
- const associationDtos = [];
1556
- for(const pk of linkedUgRetroAuditIds){
1557
- associationDtos.push({
1558
- primaryKey: fileId,
1559
- linkedRecordPrimaryKey: pk,
1560
- });
1561
- }
1562
-
1563
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1564
- }
1565
-
1566
-
1567
- // Use this function when you want to return a single record
1568
- public async getOhRetroAudits(fileId: string) {
1569
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhRetroAudit');
1570
- }
1571
-
1572
- public async linkOhRetroAuditFiles(fileId: string, ohRetroAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1573
-
1574
- const associationDtos = [];
1575
- for(const param of ohRetroAuditIds){
1576
- associationDtos.push({
1577
- entity: 'FieldServiceModule:OhRetroAudit',
1578
- recordId: param.id,
1579
- linkType: 'OhRetroAudit__File',
1580
- relationType: param?.relationType,
1581
- relatedAssociationId: param?.relatedAssociationId
1582
- });
1583
- }
1584
-
1585
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1586
- }
1587
-
1588
- public async unlinkOhRetroAuditFiles(fileId: string, linkedOhRetroAuditIds: string[]) {
1589
-
1590
- const associationDtos = [];
1591
- for(const pk of linkedOhRetroAuditIds){
1592
- associationDtos.push({
1593
- primaryKey: fileId,
1594
- linkedRecordPrimaryKey: pk,
1595
- });
1596
- }
1597
-
1598
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1599
- }
1600
-
1601
-
1602
- // Use this function when you want to return a single record
1603
- public async getRemediationOutcomeForms(fileId: string) {
1604
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'RemediationOutcomeForm');
1605
- }
1606
-
1607
- public async linkRemediationOutcomeFormFiles(fileId: string, remediationOutcomeFormIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1608
-
1609
- const associationDtos = [];
1610
- for(const param of remediationOutcomeFormIds){
1611
- associationDtos.push({
1612
- entity: 'FieldServiceModule:RemediationOutcomeForm',
1613
- recordId: param.id,
1614
- linkType: 'RemediationOutcomeForm_File',
1615
- relationType: param?.relationType,
1616
- relatedAssociationId: param?.relatedAssociationId
1617
- });
1618
- }
1619
-
1620
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1621
- }
1622
-
1623
- public async unlinkRemediationOutcomeFormFiles(fileId: string, linkedRemediationOutcomeFormIds: string[]) {
1624
-
1625
- const associationDtos = [];
1626
- for(const pk of linkedRemediationOutcomeFormIds){
1627
- associationDtos.push({
1628
- primaryKey: fileId,
1629
- linkedRecordPrimaryKey: pk,
1630
- });
1631
- }
1632
-
1633
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1634
- }
1635
-
1636
-
1637
1427
  // Use this function when you want to return a single record
1638
1428
  public async getUgInProgressAudits(fileId: string) {
1639
1429
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInProgressAudit');
@@ -1704,41 +1494,6 @@
1704
1494
  }
1705
1495
 
1706
1496
 
1707
- // Use this function when you want to return a single record
1708
- public async getBlockageA55s(fileId: string) {
1709
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'BlockageA55');
1710
- }
1711
-
1712
- public async linkOverlayA55Files(fileId: string, blockageA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1713
-
1714
- const associationDtos = [];
1715
- for(const param of blockageA55Ids){
1716
- associationDtos.push({
1717
- entity: 'FieldServiceModule:BlockageA55',
1718
- recordId: param.id,
1719
- linkType: 'OverlayA55_File',
1720
- relationType: param?.relationType,
1721
- relatedAssociationId: param?.relatedAssociationId
1722
- });
1723
- }
1724
-
1725
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1726
- }
1727
-
1728
- public async unlinkOverlayA55Files(fileId: string, linkedBlockageA55Ids: string[]) {
1729
-
1730
- const associationDtos = [];
1731
- for(const pk of linkedBlockageA55Ids){
1732
- associationDtos.push({
1733
- primaryKey: fileId,
1734
- linkedRecordPrimaryKey: pk,
1735
- });
1736
- }
1737
-
1738
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1739
- }
1740
-
1741
-
1742
1497
  // Use this function when you want to return a single record
1743
1498
  public async getOverlayRealA55s(fileId: string) {
1744
1499
  return await this._getLinks(this.moduleName, this.entityName, fileId, 'OverlayRealA55');
@@ -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 getInvoiceItems(invoiceItemId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, invoiceItemId, 'InvoiceItem');
105
+ }
106
+
107
+ public async linkInvoiceItemInvoiceItems(invoiceItemId: string, invoiceItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of invoiceItemIds){
111
+ associationDtos.push({
112
+ entity: 'BillingModule:InvoiceItem',
113
+ recordId: param.id,
114
+ linkType: 'InvoiceItem__InvoiceItem',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
118
+ }
119
+
120
+ return await this._createLinks(this.moduleName, this.entityName, invoiceItemId, associationDtos);
121
+ }
122
+
123
+ public async unlinkInvoiceItemInvoiceItems(invoiceItemId: string, linkedInvoiceItemIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedInvoiceItemIds){
127
+ associationDtos.push({
128
+ primaryKey: invoiceItemId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
131
+ }
132
+
133
+ return await this._deleteLinks(this.moduleName, this.entityName, invoiceItemId, associationDtos);
134
+ }
135
+
136
+
102
137
  }