@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
@@ -74,32 +74,59 @@
74
74
  }
75
75
 
76
76
 
77
- // Use this function when you want to return a single record
78
- public async getFiles(fileId: string) {
79
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'File');
80
- }
77
+ // Use this function when you want to return a single record
78
+ public async getAppointments(fileId: string) {
79
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Appointment');
80
+ }
81
81
 
82
- public async linkAppointmentFiles(fileId: string, fileIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
82
+ public async linkAppointmentFiles(fileId: string, appointmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
83
83
 
84
- const associationDtos = [];
85
- for(const param of fileIds){
86
- associationDtos.push({
87
- entity: 'SchemaModule:File',
88
- recordId: param.id,
89
- linkType: 'Appointment__File',
90
- relationType: param?.relationType,
91
- relatedAssociationId: param?.relatedAssociationId
92
- });
93
- }
84
+ const associationDtos = [];
85
+ for(const param of appointmentIds){
86
+ associationDtos.push({
87
+ entity: 'CrmModule:Appointment',
88
+ recordId: param.id,
89
+ linkType: 'Appointment__File',
90
+ relationType: param?.relationType,
91
+ relatedAssociationId: param?.relatedAssociationId
92
+ });
93
+ }
94
94
 
95
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
95
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
96
+ }
97
+
98
+ public async unLinkAppointmentFiles(fileId: string, linkedAppointmentId: string) {
99
+
100
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedAppointmentId);
101
+ }
102
+
103
+
104
+ // Use this function when you want to return a single record
105
+ public async getUgExternalAudits(fileId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgExternalAudit');
96
107
  }
108
+
109
+ public async linkUgExternalAuditFiles(fileId: string, ugExternalAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
97
110
 
98
- public async unLinkAppointmentFiles(fileId: string, linkedFileId: string) {
99
-
100
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedFileId);
111
+ const associationDtos = [];
112
+ for(const param of ugExternalAuditIds){
113
+ associationDtos.push({
114
+ entity: 'FieldServiceModule:UgExternalAudit',
115
+ recordId: param.id,
116
+ linkType: 'UgExternalAudit_File',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
101
120
  }
102
121
 
122
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
123
+ }
124
+
125
+ public async unLinkUgExternalAuditFiles(fileId: string, linkedUgExternalAuditId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedUgExternalAuditId);
128
+ }
129
+
103
130
 
104
131
  // Use this function when you want to return a single record
105
132
  public async getNotes(fileId: string) {
@@ -128,4 +155,1268 @@
128
155
  }
129
156
 
130
157
 
158
+ // Use this function when you want to return a single record
159
+ public async getWorkOrders(fileId: string) {
160
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'WorkOrder');
161
+ }
162
+
163
+ public async linkWorkOrderFiles(fileId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
164
+
165
+ const associationDtos = [];
166
+ for(const param of workOrderIds){
167
+ associationDtos.push({
168
+ entity: 'FieldServiceModule:WorkOrder',
169
+ recordId: param.id,
170
+ linkType: 'WorkOrder__File',
171
+ relationType: param?.relationType,
172
+ relatedAssociationId: param?.relatedAssociationId
173
+ });
174
+ }
175
+
176
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
177
+ }
178
+
179
+ public async unLinkWorkOrderFiles(fileId: string, linkedWorkOrderId: string) {
180
+
181
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedWorkOrderId);
182
+ }
183
+
184
+
185
+ // Use this function when you want to return a single record
186
+ public async getInternalInstallAudits(fileId: string) {
187
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'InternalInstallAudit');
188
+ }
189
+
190
+ public async linkInternalInstallAuditFiles(fileId: string, internalInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
191
+
192
+ const associationDtos = [];
193
+ for(const param of internalInstallAuditIds){
194
+ associationDtos.push({
195
+ entity: 'FieldServiceModule:InternalInstallAudit',
196
+ recordId: param.id,
197
+ linkType: 'InternalInstallAudit_File',
198
+ relationType: param?.relationType,
199
+ relatedAssociationId: param?.relatedAssociationId
200
+ });
201
+ }
202
+
203
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
204
+ }
205
+
206
+ public async unLinkInternalInstallAuditFiles(fileId: string, linkedInternalInstallAuditId: string) {
207
+
208
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedInternalInstallAuditId);
209
+ }
210
+
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
+ // Use this function when you want to return a single record
240
+ public async getCases(fileId: string) {
241
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Case');
242
+ }
243
+
244
+ public async linkCaseFiles(fileId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
245
+
246
+ const associationDtos = [];
247
+ for(const param of caseIds){
248
+ associationDtos.push({
249
+ entity: 'SupportModule:Case',
250
+ recordId: param.id,
251
+ linkType: 'Case__File',
252
+ relationType: param?.relationType,
253
+ relatedAssociationId: param?.relatedAssociationId
254
+ });
255
+ }
256
+
257
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
258
+ }
259
+
260
+ public async unLinkCaseFiles(fileId: string, linkedCaseId: string) {
261
+
262
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedCaseId);
263
+ }
264
+
265
+
266
+ // Use this function when you want to return a single record
267
+ public async getLeads(fileId: string) {
268
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Lead');
269
+ }
270
+
271
+ public async linkLeadFiles(fileId: string, leadIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
272
+
273
+ const associationDtos = [];
274
+ for(const param of leadIds){
275
+ associationDtos.push({
276
+ entity: 'CrmModule:Lead',
277
+ recordId: param.id,
278
+ linkType: 'Lead__File',
279
+ relationType: param?.relationType,
280
+ relatedAssociationId: param?.relatedAssociationId
281
+ });
282
+ }
283
+
284
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
285
+ }
286
+
287
+ public async unLinkLeadFiles(fileId: string, linkedLeadId: string) {
288
+
289
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedLeadId);
290
+ }
291
+
292
+
293
+ // Use this function when you want to return a single record
294
+ public async getContacts(fileId: string) {
295
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Contact');
296
+ }
297
+
298
+ public async linkContactFiles(fileId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
299
+
300
+ const associationDtos = [];
301
+ for(const param of contactIds){
302
+ associationDtos.push({
303
+ entity: 'CrmModule:Contact',
304
+ recordId: param.id,
305
+ linkType: 'Contact__File',
306
+ relationType: param?.relationType,
307
+ relatedAssociationId: param?.relatedAssociationId
308
+ });
309
+ }
310
+
311
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
312
+ }
313
+
314
+ public async unLinkContactFiles(fileId: string, linkedContactId: string) {
315
+
316
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedContactId);
317
+ }
318
+
319
+
320
+ // Use this function when you want to return a single record
321
+ public async getOrders(fileId: string) {
322
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Order');
323
+ }
324
+
325
+ public async linkOrderFiles(fileId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
326
+
327
+ const associationDtos = [];
328
+ for(const param of orderIds){
329
+ associationDtos.push({
330
+ entity: 'OrderModule:Order',
331
+ recordId: param.id,
332
+ linkType: 'Order__File',
333
+ relationType: param?.relationType,
334
+ relatedAssociationId: param?.relatedAssociationId
335
+ });
336
+ }
337
+
338
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
339
+ }
340
+
341
+ public async unLinkOrderFiles(fileId: string, linkedOrderId: string) {
342
+
343
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOrderId);
344
+ }
345
+
346
+
347
+ // Use this function when you want to return a single record
348
+ public async getBillingRequests(fileId: string) {
349
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BillingRequest');
350
+ }
351
+
352
+ public async linkBillingRequestFiles(fileId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
353
+
354
+ const associationDtos = [];
355
+ for(const param of billingRequestIds){
356
+ associationDtos.push({
357
+ entity: 'BillingModule:BillingRequest',
358
+ recordId: param.id,
359
+ linkType: 'BillingRequest__File',
360
+ relationType: param?.relationType,
361
+ relatedAssociationId: param?.relatedAssociationId
362
+ });
363
+ }
364
+
365
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
366
+ }
367
+
368
+ public async unLinkBillingRequestFiles(fileId: string, linkedBillingRequestId: string) {
369
+
370
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedBillingRequestId);
371
+ }
372
+
373
+
374
+ // Use this function when you want to return a single record
375
+ public async getTransactions(fileId: string) {
376
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Transaction');
377
+ }
378
+
379
+ public async linkTransactionFiles(fileId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
380
+
381
+ const associationDtos = [];
382
+ for(const param of transactionIds){
383
+ associationDtos.push({
384
+ entity: 'BillingModule:Transaction',
385
+ recordId: param.id,
386
+ linkType: 'Transaction__File',
387
+ relationType: param?.relationType,
388
+ relatedAssociationId: param?.relatedAssociationId
389
+ });
390
+ }
391
+
392
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
393
+ }
394
+
395
+ public async unLinkTransactionFiles(fileId: string, linkedTransactionId: string) {
396
+
397
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedTransactionId);
398
+ }
399
+
400
+
401
+ // Use this function when you want to return a single record
402
+ public async getPaymentMethods(fileId: string) {
403
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'PaymentMethod');
404
+ }
405
+
406
+ public async linkPaymentMethodFiles(fileId: string, paymentMethodIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
407
+
408
+ const associationDtos = [];
409
+ for(const param of paymentMethodIds){
410
+ associationDtos.push({
411
+ entity: 'BillingModule:PaymentMethod',
412
+ recordId: param.id,
413
+ linkType: 'PaymentMethod__File',
414
+ relationType: param?.relationType,
415
+ relatedAssociationId: param?.relatedAssociationId
416
+ });
417
+ }
418
+
419
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
420
+ }
421
+
422
+ public async unLinkPaymentMethodFiles(fileId: string, linkedPaymentMethodId: string) {
423
+
424
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedPaymentMethodId);
425
+ }
426
+
427
+
428
+ // Use this function when you want to return a single record
429
+ public async getCustomerDeviceOnts(fileId: string) {
430
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CustomerDeviceOnt');
431
+ }
432
+
433
+ public async linkCustomerDeviceOntFiles(fileId: string, customerDeviceOntIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
434
+
435
+ const associationDtos = [];
436
+ for(const param of customerDeviceOntIds){
437
+ associationDtos.push({
438
+ entity: 'ServiceModule:CustomerDeviceOnt',
439
+ recordId: param.id,
440
+ linkType: 'CustomerDeviceOnt__File',
441
+ relationType: param?.relationType,
442
+ relatedAssociationId: param?.relatedAssociationId
443
+ });
444
+ }
445
+
446
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
447
+ }
448
+
449
+ public async unLinkCustomerDeviceOntFiles(fileId: string, linkedCustomerDeviceOntId: string) {
450
+
451
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedCustomerDeviceOntId);
452
+ }
453
+
454
+
455
+ // Use this function when you want to return a single record
456
+ public async getCreditNotes(fileId: string) {
457
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CreditNote');
458
+ }
459
+
460
+ public async linkCreditNoteFiles(fileId: string, creditNoteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
461
+
462
+ const associationDtos = [];
463
+ for(const param of creditNoteIds){
464
+ associationDtos.push({
465
+ entity: 'BillingModule:CreditNote',
466
+ recordId: param.id,
467
+ linkType: 'CreditNote__File',
468
+ relationType: param?.relationType,
469
+ relatedAssociationId: param?.relatedAssociationId
470
+ });
471
+ }
472
+
473
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
474
+ }
475
+
476
+ public async unLinkCreditNoteFiles(fileId: string, linkedCreditNoteId: string) {
477
+
478
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedCreditNoteId);
479
+ }
480
+
481
+
482
+ // Use this function when you want to return a single record
483
+ public async getAddresss(fileId: string) {
484
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Address');
485
+ }
486
+
487
+ public async linkAddressFiles(fileId: string, addressIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
488
+
489
+ const associationDtos = [];
490
+ for(const param of addressIds){
491
+ associationDtos.push({
492
+ entity: 'CrmModule:Address',
493
+ recordId: param.id,
494
+ linkType: 'Address__File',
495
+ relationType: param?.relationType,
496
+ relatedAssociationId: param?.relatedAssociationId
497
+ });
498
+ }
499
+
500
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
501
+ }
502
+
503
+ public async unLinkAddressFiles(fileId: string, linkedAddressId: string) {
504
+
505
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedAddressId);
506
+ }
507
+
508
+
509
+ // Use this function when you want to return a single record
510
+ public async getChangeReasons(fileId: string) {
511
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ChangeReason');
512
+ }
513
+
514
+ public async linkChangeReasonFiles(fileId: string, changeReasonIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
515
+
516
+ const associationDtos = [];
517
+ for(const param of changeReasonIds){
518
+ associationDtos.push({
519
+ entity: 'FieldServiceModule:ChangeReason',
520
+ recordId: param.id,
521
+ linkType: 'ChangeReason__File',
522
+ relationType: param?.relationType,
523
+ relatedAssociationId: param?.relatedAssociationId
524
+ });
525
+ }
526
+
527
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
528
+ }
529
+
530
+ public async unLinkChangeReasonFiles(fileId: string, linkedChangeReasonId: string) {
531
+
532
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedChangeReasonId);
533
+ }
534
+
535
+
536
+ // Use this function when you want to return a single record
537
+ public async getDiscounts(fileId: string) {
538
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Discount');
539
+ }
540
+
541
+ public async linkDiscountFiles(fileId: string, discountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
542
+
543
+ const associationDtos = [];
544
+ for(const param of discountIds){
545
+ associationDtos.push({
546
+ entity: 'ProductModule:Discount',
547
+ recordId: param.id,
548
+ linkType: 'Discount__File',
549
+ relationType: param?.relationType,
550
+ relatedAssociationId: param?.relatedAssociationId
551
+ });
552
+ }
553
+
554
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
555
+ }
556
+
557
+ public async unLinkDiscountFiles(fileId: string, linkedDiscountId: string) {
558
+
559
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedDiscountId);
560
+ }
561
+
562
+
563
+ // Use this function when you want to return a single record
564
+ public async getPaymentMethodRefunds(fileId: string) {
565
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'PaymentMethodRefund');
566
+ }
567
+
568
+ public async linkPaymentMethodRefundFiles(fileId: string, paymentMethodRefundIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
569
+
570
+ const associationDtos = [];
571
+ for(const param of paymentMethodRefundIds){
572
+ associationDtos.push({
573
+ entity: 'BillingModule:PaymentMethodRefund',
574
+ recordId: param.id,
575
+ linkType: 'PaymentMethodRefund__File',
576
+ relationType: param?.relationType,
577
+ relatedAssociationId: param?.relatedAssociationId
578
+ });
579
+ }
580
+
581
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
582
+ }
583
+
584
+ public async unLinkPaymentMethodRefundFiles(fileId: string, linkedPaymentMethodRefundId: string) {
585
+
586
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedPaymentMethodRefundId);
587
+ }
588
+
589
+
590
+ // Use this function when you want to return a single record
591
+ public async getServiceAppointments(fileId: string) {
592
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ServiceAppointment');
593
+ }
594
+
595
+ public async linkServiceAppointmentFiles(fileId: string, serviceAppointmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
596
+
597
+ const associationDtos = [];
598
+ for(const param of serviceAppointmentIds){
599
+ associationDtos.push({
600
+ entity: 'FieldServiceModule:ServiceAppointment',
601
+ recordId: param.id,
602
+ linkType: 'ServiceAppointment__File',
603
+ relationType: param?.relationType,
604
+ relatedAssociationId: param?.relatedAssociationId
605
+ });
606
+ }
607
+
608
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
609
+ }
610
+
611
+ public async unLinkServiceAppointmentFiles(fileId: string, linkedServiceAppointmentId: string) {
612
+
613
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedServiceAppointmentId);
614
+ }
615
+
616
+
617
+ // Use this function when you want to return a single record
618
+ public async getBillingAdjustments(fileId: string) {
619
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BillingAdjustment');
620
+ }
621
+
622
+ public async linkBillingAdjustmentFiles(fileId: string, billingAdjustmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
623
+
624
+ const associationDtos = [];
625
+ for(const param of billingAdjustmentIds){
626
+ associationDtos.push({
627
+ entity: 'OrderModule:BillingAdjustment',
628
+ recordId: param.id,
629
+ linkType: 'BillingAdjustment__File',
630
+ relationType: param?.relationType,
631
+ relatedAssociationId: param?.relatedAssociationId
632
+ });
633
+ }
634
+
635
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
636
+ }
637
+
638
+ public async unLinkBillingAdjustmentFiles(fileId: string, linkedBillingAdjustmentId: string) {
639
+
640
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedBillingAdjustmentId);
641
+ }
642
+
643
+
644
+ // Use this function when you want to return a single record
645
+ public async getActivitys(fileId: string) {
646
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Activity');
647
+ }
648
+
649
+ public async linkActivityFiles(fileId: string, activityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
650
+
651
+ const associationDtos = [];
652
+ for(const param of activityIds){
653
+ associationDtos.push({
654
+ entity: 'SchemaModule:Activity',
655
+ recordId: param.id,
656
+ linkType: 'Activity__File',
657
+ relationType: param?.relationType,
658
+ relatedAssociationId: param?.relatedAssociationId
659
+ });
660
+ }
661
+
662
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
663
+ }
664
+
665
+ public async unLinkActivityFiles(fileId: string, linkedActivityId: string) {
666
+
667
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedActivityId);
668
+ }
669
+
670
+
671
+ // Use this function when you want to return a single record
672
+ public async getNetomniaInstallVerifications(fileId: string) {
673
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaInstallVerification');
674
+ }
675
+
676
+ public async linkNetomniaInstallVerificationFiles(fileId: string, netomniaInstallVerificationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
677
+
678
+ const associationDtos = [];
679
+ for(const param of netomniaInstallVerificationIds){
680
+ associationDtos.push({
681
+ entity: 'FieldServiceModule:NetomniaInstallVerification',
682
+ recordId: param.id,
683
+ linkType: 'NetomniaInstallVerification__File',
684
+ relationType: param?.relationType,
685
+ relatedAssociationId: param?.relatedAssociationId
686
+ });
687
+ }
688
+
689
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
690
+ }
691
+
692
+ public async unLinkNetomniaInstallVerificationFiles(fileId: string, linkedNetomniaInstallVerificationId: string) {
693
+
694
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedNetomniaInstallVerificationId);
695
+ }
696
+
697
+
698
+ // Use this function when you want to return a single record
699
+ public async getNetomniaFtthServiceVisitSheets(fileId: string) {
700
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtthServiceVisitSheet');
701
+ }
702
+
703
+ public async linkNetomniaFtthServiceVisitSheetFiles(fileId: string, netomniaFtthServiceVisitSheetIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
704
+
705
+ const associationDtos = [];
706
+ for(const param of netomniaFtthServiceVisitSheetIds){
707
+ associationDtos.push({
708
+ entity: 'FieldServiceModule:NetomniaFtthServiceVisitSheet',
709
+ recordId: param.id,
710
+ linkType: 'NetomniaFtthServiceVisitSheet__File',
711
+ relationType: param?.relationType,
712
+ relatedAssociationId: param?.relatedAssociationId
713
+ });
714
+ }
715
+
716
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
717
+ }
718
+
719
+ public async unLinkNetomniaFtthServiceVisitSheetFiles(fileId: string, linkedNetomniaFtthServiceVisitSheetId: string) {
720
+
721
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedNetomniaFtthServiceVisitSheetId);
722
+ }
723
+
724
+
725
+ // Use this function when you want to return a single record
726
+ public async getNetomniaFtth1StageInstallAudits(fileId: string) {
727
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtth1StageInstallAudit');
728
+ }
729
+
730
+ public async linkNetomniaFtth1StageInstallAuditFiles(fileId: string, netomniaFtth1StageInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
731
+
732
+ const associationDtos = [];
733
+ for(const param of netomniaFtth1StageInstallAuditIds){
734
+ associationDtos.push({
735
+ entity: 'FieldServiceModule:NetomniaFtth1StageInstallAudit',
736
+ recordId: param.id,
737
+ linkType: 'NetomniaFtth1StageInstallAudit__File',
738
+ relationType: param?.relationType,
739
+ relatedAssociationId: param?.relatedAssociationId
740
+ });
741
+ }
742
+
743
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
744
+ }
745
+
746
+ public async unLinkNetomniaFtth1StageInstallAuditFiles(fileId: string, linkedNetomniaFtth1StageInstallAuditId: string) {
747
+
748
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedNetomniaFtth1StageInstallAuditId);
749
+ }
750
+
751
+
752
+ // Use this function when you want to return a single record
753
+ public async getCustomerDeviceRouters(fileId: string) {
754
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CustomerDeviceRouter');
755
+ }
756
+
757
+ public async linkCustomerDeviceRouterFiles(fileId: string, customerDeviceRouterIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
758
+
759
+ const associationDtos = [];
760
+ for(const param of customerDeviceRouterIds){
761
+ associationDtos.push({
762
+ entity: 'ServiceModule:CustomerDeviceRouter',
763
+ recordId: param.id,
764
+ linkType: 'CustomerDeviceRouter__File',
765
+ relationType: param?.relationType,
766
+ relatedAssociationId: param?.relatedAssociationId
767
+ });
768
+ }
769
+
770
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
771
+ }
772
+
773
+ public async unLinkCustomerDeviceRouterFiles(fileId: string, linkedCustomerDeviceRouterId: string) {
774
+
775
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedCustomerDeviceRouterId);
776
+ }
777
+
778
+
779
+ // Use this function when you want to return a single record
780
+ public async getVisits(fileId: string) {
781
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Visit');
782
+ }
783
+
784
+ public async linkVisitFiles(fileId: string, visitIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
785
+
786
+ const associationDtos = [];
787
+ for(const param of visitIds){
788
+ associationDtos.push({
789
+ entity: 'CrmModule:Visit',
790
+ recordId: param.id,
791
+ linkType: 'Visit__File',
792
+ relationType: param?.relationType,
793
+ relatedAssociationId: param?.relatedAssociationId
794
+ });
795
+ }
796
+
797
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
798
+ }
799
+
800
+ public async unLinkVisitFiles(fileId: string, linkedVisitId: string) {
801
+
802
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedVisitId);
803
+ }
804
+
805
+
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
+ // Use this function when you want to return a single record
861
+ public async getYfEquipmentCollections(fileId: string) {
862
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfEquipmentCollection');
863
+ }
864
+
865
+ public async linkYfEquipmentCollectionFiles(fileId: string, yfEquipmentCollectionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
866
+
867
+ const associationDtos = [];
868
+ for(const param of yfEquipmentCollectionIds){
869
+ associationDtos.push({
870
+ entity: 'FieldServiceModule:YfEquipmentCollection',
871
+ recordId: param.id,
872
+ linkType: 'YfEquipmentCollection__File',
873
+ relationType: param?.relationType,
874
+ relatedAssociationId: param?.relatedAssociationId
875
+ });
876
+ }
877
+
878
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
879
+ }
880
+
881
+ public async unLinkYfEquipmentCollectionFiles(fileId: string, linkedYfEquipmentCollectionId: string) {
882
+
883
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedYfEquipmentCollectionId);
884
+ }
885
+
886
+
887
+ // Use this function when you want to return a single record
888
+ public async getYfFieldServiceVisits(fileId: string) {
889
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfFieldServiceVisit');
890
+ }
891
+
892
+ public async linkYfFieldServiceVisitFiles(fileId: string, yfFieldServiceVisitIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
893
+
894
+ const associationDtos = [];
895
+ for(const param of yfFieldServiceVisitIds){
896
+ associationDtos.push({
897
+ entity: 'FieldServiceModule:YfFieldServiceVisit',
898
+ recordId: param.id,
899
+ linkType: 'YfFieldServiceVisit__File',
900
+ relationType: param?.relationType,
901
+ relatedAssociationId: param?.relatedAssociationId
902
+ });
903
+ }
904
+
905
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
906
+ }
907
+
908
+ public async unLinkYfFieldServiceVisitFiles(fileId: string, linkedYfFieldServiceVisitId: string) {
909
+
910
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedYfFieldServiceVisitId);
911
+ }
912
+
913
+
914
+ // Use this function when you want to return a single record
915
+ public async getRemediationRequiredReasons(fileId: string) {
916
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'RemediationRequiredReason');
917
+ }
918
+
919
+ public async linkRemediationRequiredReasonFiles(fileId: string, remediationRequiredReasonIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
920
+
921
+ const associationDtos = [];
922
+ for(const param of remediationRequiredReasonIds){
923
+ associationDtos.push({
924
+ entity: 'FieldServiceModule:RemediationRequiredReason',
925
+ recordId: param.id,
926
+ linkType: 'RemediationRequiredReason__File',
927
+ relationType: param?.relationType,
928
+ relatedAssociationId: param?.relatedAssociationId
929
+ });
930
+ }
931
+
932
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
933
+ }
934
+
935
+ public async unLinkRemediationRequiredReasonFiles(fileId: string, linkedRemediationRequiredReasonId: string) {
936
+
937
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedRemediationRequiredReasonId);
938
+ }
939
+
940
+
941
+ // Use this function when you want to return a single record
942
+ public async getInvoices(fileId: string) {
943
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Invoice');
944
+ }
945
+
946
+ public async linkInvoiceFiles(fileId: string, invoiceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
947
+
948
+ const associationDtos = [];
949
+ for(const param of invoiceIds){
950
+ associationDtos.push({
951
+ entity: 'BillingModule:Invoice',
952
+ recordId: param.id,
953
+ linkType: 'Invoice__File',
954
+ relationType: param?.relationType,
955
+ relatedAssociationId: param?.relatedAssociationId
956
+ });
957
+ }
958
+
959
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
960
+ }
961
+
962
+ public async unLinkInvoiceFiles(fileId: string, linkedInvoiceId: string) {
963
+
964
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedInvoiceId);
965
+ }
966
+
967
+
968
+ // Use this function when you want to return a single record
969
+ public async getFingerprints(fileId: string) {
970
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Fingerprint');
971
+ }
972
+
973
+ public async linkFingerprintFiles(fileId: string, fingerprintIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
974
+
975
+ const associationDtos = [];
976
+ for(const param of fingerprintIds){
977
+ associationDtos.push({
978
+ entity: 'CrmModule:Fingerprint',
979
+ recordId: param.id,
980
+ linkType: 'Fingerprint__File',
981
+ relationType: param?.relationType,
982
+ relatedAssociationId: param?.relatedAssociationId
983
+ });
984
+ }
985
+
986
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
987
+ }
988
+
989
+ public async unLinkFingerprintFiles(fileId: string, linkedFingerprintId: string) {
990
+
991
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedFingerprintId);
992
+ }
993
+
994
+
995
+ public async linkNoteFiles(fileId: string, noteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
996
+
997
+ const associationDtos = [];
998
+ for(const param of noteIds){
999
+ associationDtos.push({
1000
+ entity: 'SupportModule:Note',
1001
+ recordId: param.id,
1002
+ linkType: 'Note__File',
1003
+ relationType: param?.relationType,
1004
+ relatedAssociationId: param?.relatedAssociationId
1005
+ });
1006
+ }
1007
+
1008
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1009
+ }
1010
+
1011
+ public async unLinkNoteFiles(fileId: string, linkedNoteId: string) {
1012
+
1013
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedNoteId);
1014
+ }
1015
+
1016
+
1017
+ // Use this function when you want to return a single record
1018
+ public async getSweeperMaintenanceAudits(fileId: string) {
1019
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'SweeperMaintenanceAudit');
1020
+ }
1021
+
1022
+ public async linkSweeperMaintenanceAuditFiles(fileId: string, sweeperMaintenanceAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1023
+
1024
+ const associationDtos = [];
1025
+ for(const param of sweeperMaintenanceAuditIds){
1026
+ associationDtos.push({
1027
+ entity: 'FieldServiceModule:SweeperMaintenanceAudit',
1028
+ recordId: param.id,
1029
+ linkType: 'SweeperMaintenanceAudit__File',
1030
+ relationType: param?.relationType,
1031
+ relatedAssociationId: param?.relatedAssociationId
1032
+ });
1033
+ }
1034
+
1035
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1036
+ }
1037
+
1038
+ public async unLinkSweeperMaintenanceAuditFiles(fileId: string, linkedSweeperMaintenanceAuditId: string) {
1039
+
1040
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedSweeperMaintenanceAuditId);
1041
+ }
1042
+
1043
+
1044
+ // Use this function when you want to return a single record
1045
+ public async getBlockageReportA55s(fileId: string) {
1046
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BlockageReportA55');
1047
+ }
1048
+
1049
+ public async linkBlockageReportA55Files(fileId: string, blockageReportA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1050
+
1051
+ const associationDtos = [];
1052
+ for(const param of blockageReportA55Ids){
1053
+ associationDtos.push({
1054
+ entity: 'FieldServiceModule:BlockageReportA55',
1055
+ recordId: param.id,
1056
+ linkType: 'BlockageReportA55__File',
1057
+ relationType: param?.relationType,
1058
+ relatedAssociationId: param?.relatedAssociationId
1059
+ });
1060
+ }
1061
+
1062
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1063
+ }
1064
+
1065
+ public async unLinkBlockageReportA55Files(fileId: string, linkedBlockageReportA55Id: string) {
1066
+
1067
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedBlockageReportA55Id);
1068
+ }
1069
+
1070
+
1071
+ // Use this function when you want to return a single record
1072
+ public async getUgInstallationAudits(fileId: string) {
1073
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInstallationAudit');
1074
+ }
1075
+
1076
+ public async linkUgInstallationAuditFiles(fileId: string, ugInstallationAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1077
+
1078
+ const associationDtos = [];
1079
+ for(const param of ugInstallationAuditIds){
1080
+ associationDtos.push({
1081
+ entity: 'FieldServiceModule:UgInstallationAudit',
1082
+ recordId: param.id,
1083
+ linkType: 'UgInstallationAudit__File',
1084
+ relationType: param?.relationType,
1085
+ relatedAssociationId: param?.relatedAssociationId
1086
+ });
1087
+ }
1088
+
1089
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1090
+ }
1091
+
1092
+ public async unLinkUgInstallationAuditFiles(fileId: string, linkedUgInstallationAuditId: string) {
1093
+
1094
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedUgInstallationAuditId);
1095
+ }
1096
+
1097
+
1098
+ // Use this function when you want to return a single record
1099
+ public async getOhInstallationAudits(fileId: string) {
1100
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhInstallationAudit');
1101
+ }
1102
+
1103
+ public async linkOhInstallationAuditFiles(fileId: string, ohInstallationAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1104
+
1105
+ const associationDtos = [];
1106
+ for(const param of ohInstallationAuditIds){
1107
+ associationDtos.push({
1108
+ entity: 'FieldServiceModule:OhInstallationAudit',
1109
+ recordId: param.id,
1110
+ linkType: 'OhInstallationAudit__File',
1111
+ relationType: param?.relationType,
1112
+ relatedAssociationId: param?.relatedAssociationId
1113
+ });
1114
+ }
1115
+
1116
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1117
+ }
1118
+
1119
+ public async unLinkOhInstallationAuditFiles(fileId: string, linkedOhInstallationAuditId: string) {
1120
+
1121
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOhInstallationAuditId);
1122
+ }
1123
+
1124
+
1125
+ // Use this function when you want to return a single record
1126
+ public async getServiceVisitAudits(fileId: string) {
1127
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ServiceVisitAudit');
1128
+ }
1129
+
1130
+ public async linkServiceVisitAuditFiles(fileId: string, serviceVisitAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1131
+
1132
+ const associationDtos = [];
1133
+ for(const param of serviceVisitAuditIds){
1134
+ associationDtos.push({
1135
+ entity: 'FieldServiceModule:ServiceVisitAudit',
1136
+ recordId: param.id,
1137
+ linkType: 'ServiceVisitAudit__File',
1138
+ relationType: param?.relationType,
1139
+ relatedAssociationId: param?.relatedAssociationId
1140
+ });
1141
+ }
1142
+
1143
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1144
+ }
1145
+
1146
+ public async unLinkServiceVisitAuditFiles(fileId: string, linkedServiceVisitAuditId: string) {
1147
+
1148
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedServiceVisitAuditId);
1149
+ }
1150
+
1151
+
1152
+ // Use this function when you want to return a single record
1153
+ public async getOhAuditOfInstallations(fileId: string) {
1154
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhAuditOfInstallation');
1155
+ }
1156
+
1157
+ public async linkOhAuditOfInstallationFiles(fileId: string, ohAuditOfInstallationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1158
+
1159
+ const associationDtos = [];
1160
+ for(const param of ohAuditOfInstallationIds){
1161
+ associationDtos.push({
1162
+ entity: 'FieldServiceModule:OhAuditOfInstallation',
1163
+ recordId: param.id,
1164
+ linkType: 'OhAuditOfInstallation__File',
1165
+ relationType: param?.relationType,
1166
+ relatedAssociationId: param?.relatedAssociationId
1167
+ });
1168
+ }
1169
+
1170
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1171
+ }
1172
+
1173
+ public async unLinkOhAuditOfInstallationFiles(fileId: string, linkedOhAuditOfInstallationId: string) {
1174
+
1175
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOhAuditOfInstallationId);
1176
+ }
1177
+
1178
+
1179
+ // Use this function when you want to return a single record
1180
+ public async getUgAuditOfInstallations(fileId: string) {
1181
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgAuditOfInstallation');
1182
+ }
1183
+
1184
+ public async linkUgAuditOfInstallationFiles(fileId: string, ugAuditOfInstallationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1185
+
1186
+ const associationDtos = [];
1187
+ for(const param of ugAuditOfInstallationIds){
1188
+ associationDtos.push({
1189
+ entity: 'FieldServiceModule:UgAuditOfInstallation',
1190
+ recordId: param.id,
1191
+ linkType: 'UgAuditOfInstallation__File',
1192
+ relationType: param?.relationType,
1193
+ relatedAssociationId: param?.relatedAssociationId
1194
+ });
1195
+ }
1196
+
1197
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1198
+ }
1199
+
1200
+ public async unLinkUgAuditOfInstallationFiles(fileId: string, linkedUgAuditOfInstallationId: string) {
1201
+
1202
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedUgAuditOfInstallationId);
1203
+ }
1204
+
1205
+
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
+ // Use this function when you want to return a single record
1288
+ public async getUgInProgressAudits(fileId: string) {
1289
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInProgressAudit');
1290
+ }
1291
+
1292
+ public async linkUgInProgressAuditFiles(fileId: string, ugInProgressAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1293
+
1294
+ const associationDtos = [];
1295
+ for(const param of ugInProgressAuditIds){
1296
+ associationDtos.push({
1297
+ entity: 'FieldServiceModule:UgInProgressAudit',
1298
+ recordId: param.id,
1299
+ linkType: 'UgInProgressAudit_File',
1300
+ relationType: param?.relationType,
1301
+ relatedAssociationId: param?.relatedAssociationId
1302
+ });
1303
+ }
1304
+
1305
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1306
+ }
1307
+
1308
+ public async unLinkUgInProgressAuditFiles(fileId: string, linkedUgInProgressAuditId: string) {
1309
+
1310
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedUgInProgressAuditId);
1311
+ }
1312
+
1313
+
1314
+ // Use this function when you want to return a single record
1315
+ public async getOhInProgressAudits(fileId: string) {
1316
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhInProgressAudit');
1317
+ }
1318
+
1319
+ public async linkOhInProgressAuditFiles(fileId: string, ohInProgressAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1320
+
1321
+ const associationDtos = [];
1322
+ for(const param of ohInProgressAuditIds){
1323
+ associationDtos.push({
1324
+ entity: 'FieldServiceModule:OhInProgressAudit',
1325
+ recordId: param.id,
1326
+ linkType: 'OhInProgressAudit_File',
1327
+ relationType: param?.relationType,
1328
+ relatedAssociationId: param?.relatedAssociationId
1329
+ });
1330
+ }
1331
+
1332
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1333
+ }
1334
+
1335
+ public async unLinkOhInProgressAuditFiles(fileId: string, linkedOhInProgressAuditId: string) {
1336
+
1337
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOhInProgressAuditId);
1338
+ }
1339
+
1340
+
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
+ // Use this function when you want to return a single record
1369
+ public async getOverlayRealA55s(fileId: string) {
1370
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OverlayRealA55');
1371
+ }
1372
+
1373
+ public async linkOverlayRealA55Files(fileId: string, overlayRealA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1374
+
1375
+ const associationDtos = [];
1376
+ for(const param of overlayRealA55Ids){
1377
+ associationDtos.push({
1378
+ entity: 'FieldServiceModule:OverlayRealA55',
1379
+ recordId: param.id,
1380
+ linkType: 'OverlayRealA55_File',
1381
+ relationType: param?.relationType,
1382
+ relatedAssociationId: param?.relatedAssociationId
1383
+ });
1384
+ }
1385
+
1386
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1387
+ }
1388
+
1389
+ public async unLinkOverlayRealA55Files(fileId: string, linkedOverlayRealA55Id: string) {
1390
+
1391
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOverlayRealA55Id);
1392
+ }
1393
+
1394
+
1395
+ // Use this function when you want to return a single record
1396
+ public async getOhExternalAudits(fileId: string) {
1397
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhExternalAudit');
1398
+ }
1399
+
1400
+ public async linkOhExternalAuditFiles(fileId: string, ohExternalAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1401
+
1402
+ const associationDtos = [];
1403
+ for(const param of ohExternalAuditIds){
1404
+ associationDtos.push({
1405
+ entity: 'FieldServiceModule:OhExternalAudit',
1406
+ recordId: param.id,
1407
+ linkType: 'OhExternalAudit_File',
1408
+ relationType: param?.relationType,
1409
+ relatedAssociationId: param?.relatedAssociationId
1410
+ });
1411
+ }
1412
+
1413
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1414
+ }
1415
+
1416
+ public async unLinkOhExternalAuditFiles(fileId: string, linkedOhExternalAuditId: string) {
1417
+
1418
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, linkedOhExternalAuditId);
1419
+ }
1420
+
1421
+
131
1422
  }