@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
@@ -64,40 +64,75 @@
64
64
  }
65
65
 
66
66
 
67
- // Use this function when you want to return a single record
68
- public async getFiles(fileId: string) {
69
- return await this._getLinks(this.moduleName, this.entityName, fileId, 'File');
70
- }
67
+ // Use this function when you want to return a single record
68
+ public async getAppointments(fileId: string) {
69
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Appointment');
70
+ }
71
71
 
72
- public async linkAppointmentFiles(fileId: string, fileIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
73
-
74
- const associationDtos = [];
75
- for(const param of fileIds){
76
- associationDtos.push({
77
- entity: 'SchemaModule:File',
78
- recordId: param.id,
79
- linkType: 'Appointment__File',
80
- relationType: param?.relationType,
81
- relatedAssociationId: param?.relatedAssociationId
82
- });
83
- }
72
+ public async linkAppointmentFiles(fileId: string, appointmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
84
73
 
85
- return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
74
+ const associationDtos = [];
75
+ for(const param of appointmentIds){
76
+ associationDtos.push({
77
+ entity: 'CrmModule:Appointment',
78
+ recordId: param.id,
79
+ linkType: 'Appointment__File',
80
+ relationType: param?.relationType,
81
+ relatedAssociationId: param?.relatedAssociationId
82
+ });
86
83
  }
87
84
 
88
- public async unlinkAppointmentFiles(fileId: string, linkedFileIds: string[]) {
89
-
90
- const associationDtos = [];
91
- for(const pk of linkedFileIds){
85
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
86
+ }
87
+
88
+ public async unlinkAppointmentFiles(fileId: string, linkedAppointmentIds: string[]) {
89
+
90
+ const associationDtos = [];
91
+ for(const pk of linkedAppointmentIds){
92
92
  associationDtos.push({
93
93
  primaryKey: fileId,
94
94
  linkedRecordPrimaryKey: pk,
95
95
  });
96
96
  }
97
-
98
- return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
97
+
98
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
99
+ }
100
+
101
+
102
+ // Use this function when you want to return a single record
103
+ public async getUgExternalAudits(fileId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgExternalAudit');
105
+ }
106
+
107
+ public async linkUgExternalAuditFiles(fileId: string, ugExternalAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of ugExternalAuditIds){
111
+ associationDtos.push({
112
+ entity: 'FieldServiceModule:UgExternalAudit',
113
+ recordId: param.id,
114
+ linkType: 'UgExternalAudit_File',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
118
+ }
119
+
120
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
121
+ }
122
+
123
+ public async unlinkUgExternalAuditFiles(fileId: string, linkedUgExternalAuditIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedUgExternalAuditIds){
127
+ associationDtos.push({
128
+ primaryKey: fileId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
99
131
  }
100
132
 
133
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
134
+ }
135
+
101
136
 
102
137
  // Use this function when you want to return a single record
103
138
  public async getNotes(fileId: string) {
@@ -134,4 +169,1644 @@
134
169
  }
135
170
 
136
171
 
172
+ // Use this function when you want to return a single record
173
+ public async getWorkOrders(fileId: string) {
174
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'WorkOrder');
175
+ }
176
+
177
+ public async linkWorkOrderFiles(fileId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
178
+
179
+ const associationDtos = [];
180
+ for(const param of workOrderIds){
181
+ associationDtos.push({
182
+ entity: 'FieldServiceModule:WorkOrder',
183
+ recordId: param.id,
184
+ linkType: 'WorkOrder__File',
185
+ relationType: param?.relationType,
186
+ relatedAssociationId: param?.relatedAssociationId
187
+ });
188
+ }
189
+
190
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
191
+ }
192
+
193
+ public async unlinkWorkOrderFiles(fileId: string, linkedWorkOrderIds: string[]) {
194
+
195
+ const associationDtos = [];
196
+ for(const pk of linkedWorkOrderIds){
197
+ associationDtos.push({
198
+ primaryKey: fileId,
199
+ linkedRecordPrimaryKey: pk,
200
+ });
201
+ }
202
+
203
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
204
+ }
205
+
206
+
207
+ // Use this function when you want to return a single record
208
+ public async getInternalInstallAudits(fileId: string) {
209
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'InternalInstallAudit');
210
+ }
211
+
212
+ public async linkInternalInstallAuditFiles(fileId: string, internalInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
213
+
214
+ const associationDtos = [];
215
+ for(const param of internalInstallAuditIds){
216
+ associationDtos.push({
217
+ entity: 'FieldServiceModule:InternalInstallAudit',
218
+ recordId: param.id,
219
+ linkType: 'InternalInstallAudit_File',
220
+ relationType: param?.relationType,
221
+ relatedAssociationId: param?.relatedAssociationId
222
+ });
223
+ }
224
+
225
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
226
+ }
227
+
228
+ public async unlinkInternalInstallAuditFiles(fileId: string, linkedInternalInstallAuditIds: string[]) {
229
+
230
+ const associationDtos = [];
231
+ for(const pk of linkedInternalInstallAuditIds){
232
+ associationDtos.push({
233
+ primaryKey: fileId,
234
+ linkedRecordPrimaryKey: pk,
235
+ });
236
+ }
237
+
238
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
239
+ }
240
+
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
+ // Use this function when you want to return a single record
278
+ public async getCases(fileId: string) {
279
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Case');
280
+ }
281
+
282
+ public async linkCaseFiles(fileId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
283
+
284
+ const associationDtos = [];
285
+ for(const param of caseIds){
286
+ associationDtos.push({
287
+ entity: 'SupportModule:Case',
288
+ recordId: param.id,
289
+ linkType: 'Case__File',
290
+ relationType: param?.relationType,
291
+ relatedAssociationId: param?.relatedAssociationId
292
+ });
293
+ }
294
+
295
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
296
+ }
297
+
298
+ public async unlinkCaseFiles(fileId: string, linkedCaseIds: string[]) {
299
+
300
+ const associationDtos = [];
301
+ for(const pk of linkedCaseIds){
302
+ associationDtos.push({
303
+ primaryKey: fileId,
304
+ linkedRecordPrimaryKey: pk,
305
+ });
306
+ }
307
+
308
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
309
+ }
310
+
311
+
312
+ // Use this function when you want to return a single record
313
+ public async getLeads(fileId: string) {
314
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Lead');
315
+ }
316
+
317
+ public async linkLeadFiles(fileId: string, leadIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
318
+
319
+ const associationDtos = [];
320
+ for(const param of leadIds){
321
+ associationDtos.push({
322
+ entity: 'CrmModule:Lead',
323
+ recordId: param.id,
324
+ linkType: 'Lead__File',
325
+ relationType: param?.relationType,
326
+ relatedAssociationId: param?.relatedAssociationId
327
+ });
328
+ }
329
+
330
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
331
+ }
332
+
333
+ public async unlinkLeadFiles(fileId: string, linkedLeadIds: string[]) {
334
+
335
+ const associationDtos = [];
336
+ for(const pk of linkedLeadIds){
337
+ associationDtos.push({
338
+ primaryKey: fileId,
339
+ linkedRecordPrimaryKey: pk,
340
+ });
341
+ }
342
+
343
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
344
+ }
345
+
346
+
347
+ // Use this function when you want to return a single record
348
+ public async getContacts(fileId: string) {
349
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Contact');
350
+ }
351
+
352
+ public async linkContactFiles(fileId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
353
+
354
+ const associationDtos = [];
355
+ for(const param of contactIds){
356
+ associationDtos.push({
357
+ entity: 'CrmModule:Contact',
358
+ recordId: param.id,
359
+ linkType: 'Contact__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 unlinkContactFiles(fileId: string, linkedContactIds: string[]) {
369
+
370
+ const associationDtos = [];
371
+ for(const pk of linkedContactIds){
372
+ associationDtos.push({
373
+ primaryKey: fileId,
374
+ linkedRecordPrimaryKey: pk,
375
+ });
376
+ }
377
+
378
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
379
+ }
380
+
381
+
382
+ // Use this function when you want to return a single record
383
+ public async getOrders(fileId: string) {
384
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Order');
385
+ }
386
+
387
+ public async linkOrderFiles(fileId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
388
+
389
+ const associationDtos = [];
390
+ for(const param of orderIds){
391
+ associationDtos.push({
392
+ entity: 'OrderModule:Order',
393
+ recordId: param.id,
394
+ linkType: 'Order__File',
395
+ relationType: param?.relationType,
396
+ relatedAssociationId: param?.relatedAssociationId
397
+ });
398
+ }
399
+
400
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
401
+ }
402
+
403
+ public async unlinkOrderFiles(fileId: string, linkedOrderIds: string[]) {
404
+
405
+ const associationDtos = [];
406
+ for(const pk of linkedOrderIds){
407
+ associationDtos.push({
408
+ primaryKey: fileId,
409
+ linkedRecordPrimaryKey: pk,
410
+ });
411
+ }
412
+
413
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
414
+ }
415
+
416
+
417
+ // Use this function when you want to return a single record
418
+ public async getBillingRequests(fileId: string) {
419
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BillingRequest');
420
+ }
421
+
422
+ public async linkBillingRequestFiles(fileId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
423
+
424
+ const associationDtos = [];
425
+ for(const param of billingRequestIds){
426
+ associationDtos.push({
427
+ entity: 'BillingModule:BillingRequest',
428
+ recordId: param.id,
429
+ linkType: 'BillingRequest__File',
430
+ relationType: param?.relationType,
431
+ relatedAssociationId: param?.relatedAssociationId
432
+ });
433
+ }
434
+
435
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
436
+ }
437
+
438
+ public async unlinkBillingRequestFiles(fileId: string, linkedBillingRequestIds: string[]) {
439
+
440
+ const associationDtos = [];
441
+ for(const pk of linkedBillingRequestIds){
442
+ associationDtos.push({
443
+ primaryKey: fileId,
444
+ linkedRecordPrimaryKey: pk,
445
+ });
446
+ }
447
+
448
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
449
+ }
450
+
451
+
452
+ // Use this function when you want to return a single record
453
+ public async getTransactions(fileId: string) {
454
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Transaction');
455
+ }
456
+
457
+ public async linkTransactionFiles(fileId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
458
+
459
+ const associationDtos = [];
460
+ for(const param of transactionIds){
461
+ associationDtos.push({
462
+ entity: 'BillingModule:Transaction',
463
+ recordId: param.id,
464
+ linkType: 'Transaction__File',
465
+ relationType: param?.relationType,
466
+ relatedAssociationId: param?.relatedAssociationId
467
+ });
468
+ }
469
+
470
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
471
+ }
472
+
473
+ public async unlinkTransactionFiles(fileId: string, linkedTransactionIds: string[]) {
474
+
475
+ const associationDtos = [];
476
+ for(const pk of linkedTransactionIds){
477
+ associationDtos.push({
478
+ primaryKey: fileId,
479
+ linkedRecordPrimaryKey: pk,
480
+ });
481
+ }
482
+
483
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
484
+ }
485
+
486
+
487
+ // Use this function when you want to return a single record
488
+ public async getPaymentMethods(fileId: string) {
489
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'PaymentMethod');
490
+ }
491
+
492
+ public async linkPaymentMethodFiles(fileId: string, paymentMethodIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
493
+
494
+ const associationDtos = [];
495
+ for(const param of paymentMethodIds){
496
+ associationDtos.push({
497
+ entity: 'BillingModule:PaymentMethod',
498
+ recordId: param.id,
499
+ linkType: 'PaymentMethod__File',
500
+ relationType: param?.relationType,
501
+ relatedAssociationId: param?.relatedAssociationId
502
+ });
503
+ }
504
+
505
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
506
+ }
507
+
508
+ public async unlinkPaymentMethodFiles(fileId: string, linkedPaymentMethodIds: string[]) {
509
+
510
+ const associationDtos = [];
511
+ for(const pk of linkedPaymentMethodIds){
512
+ associationDtos.push({
513
+ primaryKey: fileId,
514
+ linkedRecordPrimaryKey: pk,
515
+ });
516
+ }
517
+
518
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
519
+ }
520
+
521
+
522
+ // Use this function when you want to return a single record
523
+ public async getCustomerDeviceOnts(fileId: string) {
524
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CustomerDeviceOnt');
525
+ }
526
+
527
+ public async linkCustomerDeviceOntFiles(fileId: string, customerDeviceOntIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
528
+
529
+ const associationDtos = [];
530
+ for(const param of customerDeviceOntIds){
531
+ associationDtos.push({
532
+ entity: 'ServiceModule:CustomerDeviceOnt',
533
+ recordId: param.id,
534
+ linkType: 'CustomerDeviceOnt__File',
535
+ relationType: param?.relationType,
536
+ relatedAssociationId: param?.relatedAssociationId
537
+ });
538
+ }
539
+
540
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
541
+ }
542
+
543
+ public async unlinkCustomerDeviceOntFiles(fileId: string, linkedCustomerDeviceOntIds: string[]) {
544
+
545
+ const associationDtos = [];
546
+ for(const pk of linkedCustomerDeviceOntIds){
547
+ associationDtos.push({
548
+ primaryKey: fileId,
549
+ linkedRecordPrimaryKey: pk,
550
+ });
551
+ }
552
+
553
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
554
+ }
555
+
556
+
557
+ // Use this function when you want to return a single record
558
+ public async getCreditNotes(fileId: string) {
559
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CreditNote');
560
+ }
561
+
562
+ public async linkCreditNoteFiles(fileId: string, creditNoteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
563
+
564
+ const associationDtos = [];
565
+ for(const param of creditNoteIds){
566
+ associationDtos.push({
567
+ entity: 'BillingModule:CreditNote',
568
+ recordId: param.id,
569
+ linkType: 'CreditNote__File',
570
+ relationType: param?.relationType,
571
+ relatedAssociationId: param?.relatedAssociationId
572
+ });
573
+ }
574
+
575
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
576
+ }
577
+
578
+ public async unlinkCreditNoteFiles(fileId: string, linkedCreditNoteIds: string[]) {
579
+
580
+ const associationDtos = [];
581
+ for(const pk of linkedCreditNoteIds){
582
+ associationDtos.push({
583
+ primaryKey: fileId,
584
+ linkedRecordPrimaryKey: pk,
585
+ });
586
+ }
587
+
588
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
589
+ }
590
+
591
+
592
+ // Use this function when you want to return a single record
593
+ public async getAddresss(fileId: string) {
594
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Address');
595
+ }
596
+
597
+ public async linkAddressFiles(fileId: string, addressIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
598
+
599
+ const associationDtos = [];
600
+ for(const param of addressIds){
601
+ associationDtos.push({
602
+ entity: 'CrmModule:Address',
603
+ recordId: param.id,
604
+ linkType: 'Address__File',
605
+ relationType: param?.relationType,
606
+ relatedAssociationId: param?.relatedAssociationId
607
+ });
608
+ }
609
+
610
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
611
+ }
612
+
613
+ public async unlinkAddressFiles(fileId: string, linkedAddressIds: string[]) {
614
+
615
+ const associationDtos = [];
616
+ for(const pk of linkedAddressIds){
617
+ associationDtos.push({
618
+ primaryKey: fileId,
619
+ linkedRecordPrimaryKey: pk,
620
+ });
621
+ }
622
+
623
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
624
+ }
625
+
626
+
627
+ // Use this function when you want to return a single record
628
+ public async getChangeReasons(fileId: string) {
629
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ChangeReason');
630
+ }
631
+
632
+ public async linkChangeReasonFiles(fileId: string, changeReasonIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
633
+
634
+ const associationDtos = [];
635
+ for(const param of changeReasonIds){
636
+ associationDtos.push({
637
+ entity: 'FieldServiceModule:ChangeReason',
638
+ recordId: param.id,
639
+ linkType: 'ChangeReason__File',
640
+ relationType: param?.relationType,
641
+ relatedAssociationId: param?.relatedAssociationId
642
+ });
643
+ }
644
+
645
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
646
+ }
647
+
648
+ public async unlinkChangeReasonFiles(fileId: string, linkedChangeReasonIds: string[]) {
649
+
650
+ const associationDtos = [];
651
+ for(const pk of linkedChangeReasonIds){
652
+ associationDtos.push({
653
+ primaryKey: fileId,
654
+ linkedRecordPrimaryKey: pk,
655
+ });
656
+ }
657
+
658
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
659
+ }
660
+
661
+
662
+ // Use this function when you want to return a single record
663
+ public async getDiscounts(fileId: string) {
664
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Discount');
665
+ }
666
+
667
+ public async linkDiscountFiles(fileId: string, discountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
668
+
669
+ const associationDtos = [];
670
+ for(const param of discountIds){
671
+ associationDtos.push({
672
+ entity: 'ProductModule:Discount',
673
+ recordId: param.id,
674
+ linkType: 'Discount__File',
675
+ relationType: param?.relationType,
676
+ relatedAssociationId: param?.relatedAssociationId
677
+ });
678
+ }
679
+
680
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
681
+ }
682
+
683
+ public async unlinkDiscountFiles(fileId: string, linkedDiscountIds: string[]) {
684
+
685
+ const associationDtos = [];
686
+ for(const pk of linkedDiscountIds){
687
+ associationDtos.push({
688
+ primaryKey: fileId,
689
+ linkedRecordPrimaryKey: pk,
690
+ });
691
+ }
692
+
693
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
694
+ }
695
+
696
+
697
+ // Use this function when you want to return a single record
698
+ public async getPaymentMethodRefunds(fileId: string) {
699
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'PaymentMethodRefund');
700
+ }
701
+
702
+ public async linkPaymentMethodRefundFiles(fileId: string, paymentMethodRefundIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
703
+
704
+ const associationDtos = [];
705
+ for(const param of paymentMethodRefundIds){
706
+ associationDtos.push({
707
+ entity: 'BillingModule:PaymentMethodRefund',
708
+ recordId: param.id,
709
+ linkType: 'PaymentMethodRefund__File',
710
+ relationType: param?.relationType,
711
+ relatedAssociationId: param?.relatedAssociationId
712
+ });
713
+ }
714
+
715
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
716
+ }
717
+
718
+ public async unlinkPaymentMethodRefundFiles(fileId: string, linkedPaymentMethodRefundIds: string[]) {
719
+
720
+ const associationDtos = [];
721
+ for(const pk of linkedPaymentMethodRefundIds){
722
+ associationDtos.push({
723
+ primaryKey: fileId,
724
+ linkedRecordPrimaryKey: pk,
725
+ });
726
+ }
727
+
728
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
729
+ }
730
+
731
+
732
+ // Use this function when you want to return a single record
733
+ public async getServiceAppointments(fileId: string) {
734
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ServiceAppointment');
735
+ }
736
+
737
+ public async linkServiceAppointmentFiles(fileId: string, serviceAppointmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
738
+
739
+ const associationDtos = [];
740
+ for(const param of serviceAppointmentIds){
741
+ associationDtos.push({
742
+ entity: 'FieldServiceModule:ServiceAppointment',
743
+ recordId: param.id,
744
+ linkType: 'ServiceAppointment__File',
745
+ relationType: param?.relationType,
746
+ relatedAssociationId: param?.relatedAssociationId
747
+ });
748
+ }
749
+
750
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
751
+ }
752
+
753
+ public async unlinkServiceAppointmentFiles(fileId: string, linkedServiceAppointmentIds: string[]) {
754
+
755
+ const associationDtos = [];
756
+ for(const pk of linkedServiceAppointmentIds){
757
+ associationDtos.push({
758
+ primaryKey: fileId,
759
+ linkedRecordPrimaryKey: pk,
760
+ });
761
+ }
762
+
763
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
764
+ }
765
+
766
+
767
+ // Use this function when you want to return a single record
768
+ public async getBillingAdjustments(fileId: string) {
769
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BillingAdjustment');
770
+ }
771
+
772
+ public async linkBillingAdjustmentFiles(fileId: string, billingAdjustmentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
773
+
774
+ const associationDtos = [];
775
+ for(const param of billingAdjustmentIds){
776
+ associationDtos.push({
777
+ entity: 'OrderModule:BillingAdjustment',
778
+ recordId: param.id,
779
+ linkType: 'BillingAdjustment__File',
780
+ relationType: param?.relationType,
781
+ relatedAssociationId: param?.relatedAssociationId
782
+ });
783
+ }
784
+
785
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
786
+ }
787
+
788
+ public async unlinkBillingAdjustmentFiles(fileId: string, linkedBillingAdjustmentIds: string[]) {
789
+
790
+ const associationDtos = [];
791
+ for(const pk of linkedBillingAdjustmentIds){
792
+ associationDtos.push({
793
+ primaryKey: fileId,
794
+ linkedRecordPrimaryKey: pk,
795
+ });
796
+ }
797
+
798
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
799
+ }
800
+
801
+
802
+ // Use this function when you want to return a single record
803
+ public async getActivitys(fileId: string) {
804
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Activity');
805
+ }
806
+
807
+ public async linkActivityFiles(fileId: string, activityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
808
+
809
+ const associationDtos = [];
810
+ for(const param of activityIds){
811
+ associationDtos.push({
812
+ entity: 'SchemaModule:Activity',
813
+ recordId: param.id,
814
+ linkType: 'Activity__File',
815
+ relationType: param?.relationType,
816
+ relatedAssociationId: param?.relatedAssociationId
817
+ });
818
+ }
819
+
820
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
821
+ }
822
+
823
+ public async unlinkActivityFiles(fileId: string, linkedActivityIds: string[]) {
824
+
825
+ const associationDtos = [];
826
+ for(const pk of linkedActivityIds){
827
+ associationDtos.push({
828
+ primaryKey: fileId,
829
+ linkedRecordPrimaryKey: pk,
830
+ });
831
+ }
832
+
833
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
834
+ }
835
+
836
+
837
+ // Use this function when you want to return a single record
838
+ public async getNetomniaInstallVerifications(fileId: string) {
839
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaInstallVerification');
840
+ }
841
+
842
+ public async linkNetomniaInstallVerificationFiles(fileId: string, netomniaInstallVerificationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
843
+
844
+ const associationDtos = [];
845
+ for(const param of netomniaInstallVerificationIds){
846
+ associationDtos.push({
847
+ entity: 'FieldServiceModule:NetomniaInstallVerification',
848
+ recordId: param.id,
849
+ linkType: 'NetomniaInstallVerification__File',
850
+ relationType: param?.relationType,
851
+ relatedAssociationId: param?.relatedAssociationId
852
+ });
853
+ }
854
+
855
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
856
+ }
857
+
858
+ public async unlinkNetomniaInstallVerificationFiles(fileId: string, linkedNetomniaInstallVerificationIds: string[]) {
859
+
860
+ const associationDtos = [];
861
+ for(const pk of linkedNetomniaInstallVerificationIds){
862
+ associationDtos.push({
863
+ primaryKey: fileId,
864
+ linkedRecordPrimaryKey: pk,
865
+ });
866
+ }
867
+
868
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
869
+ }
870
+
871
+
872
+ // Use this function when you want to return a single record
873
+ public async getNetomniaFtthServiceVisitSheets(fileId: string) {
874
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtthServiceVisitSheet');
875
+ }
876
+
877
+ public async linkNetomniaFtthServiceVisitSheetFiles(fileId: string, netomniaFtthServiceVisitSheetIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
878
+
879
+ const associationDtos = [];
880
+ for(const param of netomniaFtthServiceVisitSheetIds){
881
+ associationDtos.push({
882
+ entity: 'FieldServiceModule:NetomniaFtthServiceVisitSheet',
883
+ recordId: param.id,
884
+ linkType: 'NetomniaFtthServiceVisitSheet__File',
885
+ relationType: param?.relationType,
886
+ relatedAssociationId: param?.relatedAssociationId
887
+ });
888
+ }
889
+
890
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
891
+ }
892
+
893
+ public async unlinkNetomniaFtthServiceVisitSheetFiles(fileId: string, linkedNetomniaFtthServiceVisitSheetIds: string[]) {
894
+
895
+ const associationDtos = [];
896
+ for(const pk of linkedNetomniaFtthServiceVisitSheetIds){
897
+ associationDtos.push({
898
+ primaryKey: fileId,
899
+ linkedRecordPrimaryKey: pk,
900
+ });
901
+ }
902
+
903
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
904
+ }
905
+
906
+
907
+ // Use this function when you want to return a single record
908
+ public async getNetomniaFtth1StageInstallAudits(fileId: string) {
909
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'NetomniaFtth1StageInstallAudit');
910
+ }
911
+
912
+ public async linkNetomniaFtth1StageInstallAuditFiles(fileId: string, netomniaFtth1StageInstallAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
913
+
914
+ const associationDtos = [];
915
+ for(const param of netomniaFtth1StageInstallAuditIds){
916
+ associationDtos.push({
917
+ entity: 'FieldServiceModule:NetomniaFtth1StageInstallAudit',
918
+ recordId: param.id,
919
+ linkType: 'NetomniaFtth1StageInstallAudit__File',
920
+ relationType: param?.relationType,
921
+ relatedAssociationId: param?.relatedAssociationId
922
+ });
923
+ }
924
+
925
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
926
+ }
927
+
928
+ public async unlinkNetomniaFtth1StageInstallAuditFiles(fileId: string, linkedNetomniaFtth1StageInstallAuditIds: string[]) {
929
+
930
+ const associationDtos = [];
931
+ for(const pk of linkedNetomniaFtth1StageInstallAuditIds){
932
+ associationDtos.push({
933
+ primaryKey: fileId,
934
+ linkedRecordPrimaryKey: pk,
935
+ });
936
+ }
937
+
938
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
939
+ }
940
+
941
+
942
+ // Use this function when you want to return a single record
943
+ public async getCustomerDeviceRouters(fileId: string) {
944
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'CustomerDeviceRouter');
945
+ }
946
+
947
+ public async linkCustomerDeviceRouterFiles(fileId: string, customerDeviceRouterIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
948
+
949
+ const associationDtos = [];
950
+ for(const param of customerDeviceRouterIds){
951
+ associationDtos.push({
952
+ entity: 'ServiceModule:CustomerDeviceRouter',
953
+ recordId: param.id,
954
+ linkType: 'CustomerDeviceRouter__File',
955
+ relationType: param?.relationType,
956
+ relatedAssociationId: param?.relatedAssociationId
957
+ });
958
+ }
959
+
960
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
961
+ }
962
+
963
+ public async unlinkCustomerDeviceRouterFiles(fileId: string, linkedCustomerDeviceRouterIds: string[]) {
964
+
965
+ const associationDtos = [];
966
+ for(const pk of linkedCustomerDeviceRouterIds){
967
+ associationDtos.push({
968
+ primaryKey: fileId,
969
+ linkedRecordPrimaryKey: pk,
970
+ });
971
+ }
972
+
973
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
974
+ }
975
+
976
+
977
+ // Use this function when you want to return a single record
978
+ public async getVisits(fileId: string) {
979
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Visit');
980
+ }
981
+
982
+ public async linkVisitFiles(fileId: string, visitIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
983
+
984
+ const associationDtos = [];
985
+ for(const param of visitIds){
986
+ associationDtos.push({
987
+ entity: 'CrmModule:Visit',
988
+ recordId: param.id,
989
+ linkType: 'Visit__File',
990
+ relationType: param?.relationType,
991
+ relatedAssociationId: param?.relatedAssociationId
992
+ });
993
+ }
994
+
995
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
996
+ }
997
+
998
+ public async unlinkVisitFiles(fileId: string, linkedVisitIds: string[]) {
999
+
1000
+ const associationDtos = [];
1001
+ for(const pk of linkedVisitIds){
1002
+ associationDtos.push({
1003
+ primaryKey: fileId,
1004
+ linkedRecordPrimaryKey: pk,
1005
+ });
1006
+ }
1007
+
1008
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1009
+ }
1010
+
1011
+
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
+ // Use this function when you want to return a single record
1083
+ public async getYfEquipmentCollections(fileId: string) {
1084
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfEquipmentCollection');
1085
+ }
1086
+
1087
+ public async linkYfEquipmentCollectionFiles(fileId: string, yfEquipmentCollectionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1088
+
1089
+ const associationDtos = [];
1090
+ for(const param of yfEquipmentCollectionIds){
1091
+ associationDtos.push({
1092
+ entity: 'FieldServiceModule:YfEquipmentCollection',
1093
+ recordId: param.id,
1094
+ linkType: 'YfEquipmentCollection__File',
1095
+ relationType: param?.relationType,
1096
+ relatedAssociationId: param?.relatedAssociationId
1097
+ });
1098
+ }
1099
+
1100
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1101
+ }
1102
+
1103
+ public async unlinkYfEquipmentCollectionFiles(fileId: string, linkedYfEquipmentCollectionIds: string[]) {
1104
+
1105
+ const associationDtos = [];
1106
+ for(const pk of linkedYfEquipmentCollectionIds){
1107
+ associationDtos.push({
1108
+ primaryKey: fileId,
1109
+ linkedRecordPrimaryKey: pk,
1110
+ });
1111
+ }
1112
+
1113
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1114
+ }
1115
+
1116
+
1117
+ // Use this function when you want to return a single record
1118
+ public async getYfFieldServiceVisits(fileId: string) {
1119
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'YfFieldServiceVisit');
1120
+ }
1121
+
1122
+ public async linkYfFieldServiceVisitFiles(fileId: string, yfFieldServiceVisitIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1123
+
1124
+ const associationDtos = [];
1125
+ for(const param of yfFieldServiceVisitIds){
1126
+ associationDtos.push({
1127
+ entity: 'FieldServiceModule:YfFieldServiceVisit',
1128
+ recordId: param.id,
1129
+ linkType: 'YfFieldServiceVisit__File',
1130
+ relationType: param?.relationType,
1131
+ relatedAssociationId: param?.relatedAssociationId
1132
+ });
1133
+ }
1134
+
1135
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1136
+ }
1137
+
1138
+ public async unlinkYfFieldServiceVisitFiles(fileId: string, linkedYfFieldServiceVisitIds: string[]) {
1139
+
1140
+ const associationDtos = [];
1141
+ for(const pk of linkedYfFieldServiceVisitIds){
1142
+ associationDtos.push({
1143
+ primaryKey: fileId,
1144
+ linkedRecordPrimaryKey: pk,
1145
+ });
1146
+ }
1147
+
1148
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1149
+ }
1150
+
1151
+
1152
+ // Use this function when you want to return a single record
1153
+ public async getRemediationRequiredReasons(fileId: string) {
1154
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'RemediationRequiredReason');
1155
+ }
1156
+
1157
+ public async linkRemediationRequiredReasonFiles(fileId: string, remediationRequiredReasonIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1158
+
1159
+ const associationDtos = [];
1160
+ for(const param of remediationRequiredReasonIds){
1161
+ associationDtos.push({
1162
+ entity: 'FieldServiceModule:RemediationRequiredReason',
1163
+ recordId: param.id,
1164
+ linkType: 'RemediationRequiredReason__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 unlinkRemediationRequiredReasonFiles(fileId: string, linkedRemediationRequiredReasonIds: string[]) {
1174
+
1175
+ const associationDtos = [];
1176
+ for(const pk of linkedRemediationRequiredReasonIds){
1177
+ associationDtos.push({
1178
+ primaryKey: fileId,
1179
+ linkedRecordPrimaryKey: pk,
1180
+ });
1181
+ }
1182
+
1183
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1184
+ }
1185
+
1186
+
1187
+ // Use this function when you want to return a single record
1188
+ public async getInvoices(fileId: string) {
1189
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Invoice');
1190
+ }
1191
+
1192
+ public async linkInvoiceFiles(fileId: string, invoiceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1193
+
1194
+ const associationDtos = [];
1195
+ for(const param of invoiceIds){
1196
+ associationDtos.push({
1197
+ entity: 'BillingModule:Invoice',
1198
+ recordId: param.id,
1199
+ linkType: 'Invoice__File',
1200
+ relationType: param?.relationType,
1201
+ relatedAssociationId: param?.relatedAssociationId
1202
+ });
1203
+ }
1204
+
1205
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1206
+ }
1207
+
1208
+ public async unlinkInvoiceFiles(fileId: string, linkedInvoiceIds: string[]) {
1209
+
1210
+ const associationDtos = [];
1211
+ for(const pk of linkedInvoiceIds){
1212
+ associationDtos.push({
1213
+ primaryKey: fileId,
1214
+ linkedRecordPrimaryKey: pk,
1215
+ });
1216
+ }
1217
+
1218
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1219
+ }
1220
+
1221
+
1222
+ // Use this function when you want to return a single record
1223
+ public async getFingerprints(fileId: string) {
1224
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'Fingerprint');
1225
+ }
1226
+
1227
+ public async linkFingerprintFiles(fileId: string, fingerprintIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1228
+
1229
+ const associationDtos = [];
1230
+ for(const param of fingerprintIds){
1231
+ associationDtos.push({
1232
+ entity: 'CrmModule:Fingerprint',
1233
+ recordId: param.id,
1234
+ linkType: 'Fingerprint__File',
1235
+ relationType: param?.relationType,
1236
+ relatedAssociationId: param?.relatedAssociationId
1237
+ });
1238
+ }
1239
+
1240
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1241
+ }
1242
+
1243
+ public async unlinkFingerprintFiles(fileId: string, linkedFingerprintIds: string[]) {
1244
+
1245
+ const associationDtos = [];
1246
+ for(const pk of linkedFingerprintIds){
1247
+ associationDtos.push({
1248
+ primaryKey: fileId,
1249
+ linkedRecordPrimaryKey: pk,
1250
+ });
1251
+ }
1252
+
1253
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1254
+ }
1255
+
1256
+
1257
+ public async linkNoteFiles(fileId: string, noteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1258
+
1259
+ const associationDtos = [];
1260
+ for(const param of noteIds){
1261
+ associationDtos.push({
1262
+ entity: 'SupportModule:Note',
1263
+ recordId: param.id,
1264
+ linkType: 'Note__File',
1265
+ relationType: param?.relationType,
1266
+ relatedAssociationId: param?.relatedAssociationId
1267
+ });
1268
+ }
1269
+
1270
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1271
+ }
1272
+
1273
+ public async unlinkNoteFiles(fileId: string, linkedNoteIds: string[]) {
1274
+
1275
+ const associationDtos = [];
1276
+ for(const pk of linkedNoteIds){
1277
+ associationDtos.push({
1278
+ primaryKey: fileId,
1279
+ linkedRecordPrimaryKey: pk,
1280
+ });
1281
+ }
1282
+
1283
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1284
+ }
1285
+
1286
+
1287
+ // Use this function when you want to return a single record
1288
+ public async getSweeperMaintenanceAudits(fileId: string) {
1289
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'SweeperMaintenanceAudit');
1290
+ }
1291
+
1292
+ public async linkSweeperMaintenanceAuditFiles(fileId: string, sweeperMaintenanceAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1293
+
1294
+ const associationDtos = [];
1295
+ for(const param of sweeperMaintenanceAuditIds){
1296
+ associationDtos.push({
1297
+ entity: 'FieldServiceModule:SweeperMaintenanceAudit',
1298
+ recordId: param.id,
1299
+ linkType: 'SweeperMaintenanceAudit__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 unlinkSweeperMaintenanceAuditFiles(fileId: string, linkedSweeperMaintenanceAuditIds: string[]) {
1309
+
1310
+ const associationDtos = [];
1311
+ for(const pk of linkedSweeperMaintenanceAuditIds){
1312
+ associationDtos.push({
1313
+ primaryKey: fileId,
1314
+ linkedRecordPrimaryKey: pk,
1315
+ });
1316
+ }
1317
+
1318
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1319
+ }
1320
+
1321
+
1322
+ // Use this function when you want to return a single record
1323
+ public async getBlockageReportA55s(fileId: string) {
1324
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'BlockageReportA55');
1325
+ }
1326
+
1327
+ public async linkBlockageReportA55Files(fileId: string, blockageReportA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1328
+
1329
+ const associationDtos = [];
1330
+ for(const param of blockageReportA55Ids){
1331
+ associationDtos.push({
1332
+ entity: 'FieldServiceModule:BlockageReportA55',
1333
+ recordId: param.id,
1334
+ linkType: 'BlockageReportA55__File',
1335
+ relationType: param?.relationType,
1336
+ relatedAssociationId: param?.relatedAssociationId
1337
+ });
1338
+ }
1339
+
1340
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1341
+ }
1342
+
1343
+ public async unlinkBlockageReportA55Files(fileId: string, linkedBlockageReportA55Ids: string[]) {
1344
+
1345
+ const associationDtos = [];
1346
+ for(const pk of linkedBlockageReportA55Ids){
1347
+ associationDtos.push({
1348
+ primaryKey: fileId,
1349
+ linkedRecordPrimaryKey: pk,
1350
+ });
1351
+ }
1352
+
1353
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1354
+ }
1355
+
1356
+
1357
+ // Use this function when you want to return a single record
1358
+ public async getUgInstallationAudits(fileId: string) {
1359
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInstallationAudit');
1360
+ }
1361
+
1362
+ public async linkUgInstallationAuditFiles(fileId: string, ugInstallationAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1363
+
1364
+ const associationDtos = [];
1365
+ for(const param of ugInstallationAuditIds){
1366
+ associationDtos.push({
1367
+ entity: 'FieldServiceModule:UgInstallationAudit',
1368
+ recordId: param.id,
1369
+ linkType: 'UgInstallationAudit__File',
1370
+ relationType: param?.relationType,
1371
+ relatedAssociationId: param?.relatedAssociationId
1372
+ });
1373
+ }
1374
+
1375
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1376
+ }
1377
+
1378
+ public async unlinkUgInstallationAuditFiles(fileId: string, linkedUgInstallationAuditIds: string[]) {
1379
+
1380
+ const associationDtos = [];
1381
+ for(const pk of linkedUgInstallationAuditIds){
1382
+ associationDtos.push({
1383
+ primaryKey: fileId,
1384
+ linkedRecordPrimaryKey: pk,
1385
+ });
1386
+ }
1387
+
1388
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1389
+ }
1390
+
1391
+
1392
+ // Use this function when you want to return a single record
1393
+ public async getOhInstallationAudits(fileId: string) {
1394
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhInstallationAudit');
1395
+ }
1396
+
1397
+ public async linkOhInstallationAuditFiles(fileId: string, ohInstallationAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1398
+
1399
+ const associationDtos = [];
1400
+ for(const param of ohInstallationAuditIds){
1401
+ associationDtos.push({
1402
+ entity: 'FieldServiceModule:OhInstallationAudit',
1403
+ recordId: param.id,
1404
+ linkType: 'OhInstallationAudit__File',
1405
+ relationType: param?.relationType,
1406
+ relatedAssociationId: param?.relatedAssociationId
1407
+ });
1408
+ }
1409
+
1410
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1411
+ }
1412
+
1413
+ public async unlinkOhInstallationAuditFiles(fileId: string, linkedOhInstallationAuditIds: string[]) {
1414
+
1415
+ const associationDtos = [];
1416
+ for(const pk of linkedOhInstallationAuditIds){
1417
+ associationDtos.push({
1418
+ primaryKey: fileId,
1419
+ linkedRecordPrimaryKey: pk,
1420
+ });
1421
+ }
1422
+
1423
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1424
+ }
1425
+
1426
+
1427
+ // Use this function when you want to return a single record
1428
+ public async getServiceVisitAudits(fileId: string) {
1429
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'ServiceVisitAudit');
1430
+ }
1431
+
1432
+ public async linkServiceVisitAuditFiles(fileId: string, serviceVisitAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1433
+
1434
+ const associationDtos = [];
1435
+ for(const param of serviceVisitAuditIds){
1436
+ associationDtos.push({
1437
+ entity: 'FieldServiceModule:ServiceVisitAudit',
1438
+ recordId: param.id,
1439
+ linkType: 'ServiceVisitAudit__File',
1440
+ relationType: param?.relationType,
1441
+ relatedAssociationId: param?.relatedAssociationId
1442
+ });
1443
+ }
1444
+
1445
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1446
+ }
1447
+
1448
+ public async unlinkServiceVisitAuditFiles(fileId: string, linkedServiceVisitAuditIds: string[]) {
1449
+
1450
+ const associationDtos = [];
1451
+ for(const pk of linkedServiceVisitAuditIds){
1452
+ associationDtos.push({
1453
+ primaryKey: fileId,
1454
+ linkedRecordPrimaryKey: pk,
1455
+ });
1456
+ }
1457
+
1458
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1459
+ }
1460
+
1461
+
1462
+ // Use this function when you want to return a single record
1463
+ public async getOhAuditOfInstallations(fileId: string) {
1464
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhAuditOfInstallation');
1465
+ }
1466
+
1467
+ public async linkOhAuditOfInstallationFiles(fileId: string, ohAuditOfInstallationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1468
+
1469
+ const associationDtos = [];
1470
+ for(const param of ohAuditOfInstallationIds){
1471
+ associationDtos.push({
1472
+ entity: 'FieldServiceModule:OhAuditOfInstallation',
1473
+ recordId: param.id,
1474
+ linkType: 'OhAuditOfInstallation__File',
1475
+ relationType: param?.relationType,
1476
+ relatedAssociationId: param?.relatedAssociationId
1477
+ });
1478
+ }
1479
+
1480
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1481
+ }
1482
+
1483
+ public async unlinkOhAuditOfInstallationFiles(fileId: string, linkedOhAuditOfInstallationIds: string[]) {
1484
+
1485
+ const associationDtos = [];
1486
+ for(const pk of linkedOhAuditOfInstallationIds){
1487
+ associationDtos.push({
1488
+ primaryKey: fileId,
1489
+ linkedRecordPrimaryKey: pk,
1490
+ });
1491
+ }
1492
+
1493
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1494
+ }
1495
+
1496
+
1497
+ // Use this function when you want to return a single record
1498
+ public async getUgAuditOfInstallations(fileId: string) {
1499
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgAuditOfInstallation');
1500
+ }
1501
+
1502
+ public async linkUgAuditOfInstallationFiles(fileId: string, ugAuditOfInstallationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1503
+
1504
+ const associationDtos = [];
1505
+ for(const param of ugAuditOfInstallationIds){
1506
+ associationDtos.push({
1507
+ entity: 'FieldServiceModule:UgAuditOfInstallation',
1508
+ recordId: param.id,
1509
+ linkType: 'UgAuditOfInstallation__File',
1510
+ relationType: param?.relationType,
1511
+ relatedAssociationId: param?.relatedAssociationId
1512
+ });
1513
+ }
1514
+
1515
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1516
+ }
1517
+
1518
+ public async unlinkUgAuditOfInstallationFiles(fileId: string, linkedUgAuditOfInstallationIds: string[]) {
1519
+
1520
+ const associationDtos = [];
1521
+ for(const pk of linkedUgAuditOfInstallationIds){
1522
+ associationDtos.push({
1523
+ primaryKey: fileId,
1524
+ linkedRecordPrimaryKey: pk,
1525
+ });
1526
+ }
1527
+
1528
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1529
+ }
1530
+
1531
+
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
+ // Use this function when you want to return a single record
1638
+ public async getUgInProgressAudits(fileId: string) {
1639
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'UgInProgressAudit');
1640
+ }
1641
+
1642
+ public async linkUgInProgressAuditFiles(fileId: string, ugInProgressAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1643
+
1644
+ const associationDtos = [];
1645
+ for(const param of ugInProgressAuditIds){
1646
+ associationDtos.push({
1647
+ entity: 'FieldServiceModule:UgInProgressAudit',
1648
+ recordId: param.id,
1649
+ linkType: 'UgInProgressAudit_File',
1650
+ relationType: param?.relationType,
1651
+ relatedAssociationId: param?.relatedAssociationId
1652
+ });
1653
+ }
1654
+
1655
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1656
+ }
1657
+
1658
+ public async unlinkUgInProgressAuditFiles(fileId: string, linkedUgInProgressAuditIds: string[]) {
1659
+
1660
+ const associationDtos = [];
1661
+ for(const pk of linkedUgInProgressAuditIds){
1662
+ associationDtos.push({
1663
+ primaryKey: fileId,
1664
+ linkedRecordPrimaryKey: pk,
1665
+ });
1666
+ }
1667
+
1668
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1669
+ }
1670
+
1671
+
1672
+ // Use this function when you want to return a single record
1673
+ public async getOhInProgressAudits(fileId: string) {
1674
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhInProgressAudit');
1675
+ }
1676
+
1677
+ public async linkOhInProgressAuditFiles(fileId: string, ohInProgressAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1678
+
1679
+ const associationDtos = [];
1680
+ for(const param of ohInProgressAuditIds){
1681
+ associationDtos.push({
1682
+ entity: 'FieldServiceModule:OhInProgressAudit',
1683
+ recordId: param.id,
1684
+ linkType: 'OhInProgressAudit_File',
1685
+ relationType: param?.relationType,
1686
+ relatedAssociationId: param?.relatedAssociationId
1687
+ });
1688
+ }
1689
+
1690
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1691
+ }
1692
+
1693
+ public async unlinkOhInProgressAuditFiles(fileId: string, linkedOhInProgressAuditIds: string[]) {
1694
+
1695
+ const associationDtos = [];
1696
+ for(const pk of linkedOhInProgressAuditIds){
1697
+ associationDtos.push({
1698
+ primaryKey: fileId,
1699
+ linkedRecordPrimaryKey: pk,
1700
+ });
1701
+ }
1702
+
1703
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1704
+ }
1705
+
1706
+
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
+ // Use this function when you want to return a single record
1743
+ public async getOverlayRealA55s(fileId: string) {
1744
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OverlayRealA55');
1745
+ }
1746
+
1747
+ public async linkOverlayRealA55Files(fileId: string, overlayRealA55Ids: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1748
+
1749
+ const associationDtos = [];
1750
+ for(const param of overlayRealA55Ids){
1751
+ associationDtos.push({
1752
+ entity: 'FieldServiceModule:OverlayRealA55',
1753
+ recordId: param.id,
1754
+ linkType: 'OverlayRealA55_File',
1755
+ relationType: param?.relationType,
1756
+ relatedAssociationId: param?.relatedAssociationId
1757
+ });
1758
+ }
1759
+
1760
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1761
+ }
1762
+
1763
+ public async unlinkOverlayRealA55Files(fileId: string, linkedOverlayRealA55Ids: string[]) {
1764
+
1765
+ const associationDtos = [];
1766
+ for(const pk of linkedOverlayRealA55Ids){
1767
+ associationDtos.push({
1768
+ primaryKey: fileId,
1769
+ linkedRecordPrimaryKey: pk,
1770
+ });
1771
+ }
1772
+
1773
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1774
+ }
1775
+
1776
+
1777
+ // Use this function when you want to return a single record
1778
+ public async getOhExternalAudits(fileId: string) {
1779
+ return await this._getLinks(this.moduleName, this.entityName, fileId, 'OhExternalAudit');
1780
+ }
1781
+
1782
+ public async linkOhExternalAuditFiles(fileId: string, ohExternalAuditIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1783
+
1784
+ const associationDtos = [];
1785
+ for(const param of ohExternalAuditIds){
1786
+ associationDtos.push({
1787
+ entity: 'FieldServiceModule:OhExternalAudit',
1788
+ recordId: param.id,
1789
+ linkType: 'OhExternalAudit_File',
1790
+ relationType: param?.relationType,
1791
+ relatedAssociationId: param?.relatedAssociationId
1792
+ });
1793
+ }
1794
+
1795
+ return await this._createLinks(this.moduleName, this.entityName, fileId, associationDtos);
1796
+ }
1797
+
1798
+ public async unlinkOhExternalAuditFiles(fileId: string, linkedOhExternalAuditIds: string[]) {
1799
+
1800
+ const associationDtos = [];
1801
+ for(const pk of linkedOhExternalAuditIds){
1802
+ associationDtos.push({
1803
+ primaryKey: fileId,
1804
+ linkedRecordPrimaryKey: pk,
1805
+ });
1806
+ }
1807
+
1808
+ return await this._deleteLinks(this.moduleName, this.entityName, fileId, associationDtos);
1809
+ }
1810
+
1811
+
137
1812
  }