@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
@@ -309,4 +309,64 @@
309
309
  }
310
310
 
311
311
 
312
+ public async linkManagers(serviceAppointmentConfigId: string, userIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
313
+
314
+ const associationDtos = [];
315
+ for(const param of userIds){
316
+ associationDtos.push({
317
+ entity: 'IdentityModule:User',
318
+ recordId: param.id,
319
+ linkType: 'Manager',
320
+ relationType: param?.relationType,
321
+ relatedAssociationId: param?.relatedAssociationId
322
+ });
323
+ }
324
+
325
+ return await this._createLinks(this.moduleName, this.entityName, serviceAppointmentConfigId, associationDtos);
326
+ }
327
+
328
+ public async unlinkManagers(serviceAppointmentConfigId: string, linkedUserIds: string[]) {
329
+
330
+ const associationDtos = [];
331
+ for(const pk of linkedUserIds){
332
+ associationDtos.push({
333
+ primaryKey: serviceAppointmentConfigId,
334
+ linkedRecordPrimaryKey: pk,
335
+ });
336
+ }
337
+
338
+ return await this._deleteLinks(this.moduleName, this.entityName, serviceAppointmentConfigId, associationDtos);
339
+ }
340
+
341
+
342
+ public async linkSupervisors(serviceAppointmentConfigId: string, userIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
343
+
344
+ const associationDtos = [];
345
+ for(const param of userIds){
346
+ associationDtos.push({
347
+ entity: 'IdentityModule:User',
348
+ recordId: param.id,
349
+ linkType: 'Supervisor',
350
+ relationType: param?.relationType,
351
+ relatedAssociationId: param?.relatedAssociationId
352
+ });
353
+ }
354
+
355
+ return await this._createLinks(this.moduleName, this.entityName, serviceAppointmentConfigId, associationDtos);
356
+ }
357
+
358
+ public async unlinkSupervisors(serviceAppointmentConfigId: string, linkedUserIds: string[]) {
359
+
360
+ const associationDtos = [];
361
+ for(const pk of linkedUserIds){
362
+ associationDtos.push({
363
+ primaryKey: serviceAppointmentConfigId,
364
+ linkedRecordPrimaryKey: pk,
365
+ });
366
+ }
367
+
368
+ return await this._deleteLinks(this.moduleName, this.entityName, serviceAppointmentConfigId, associationDtos);
369
+ }
370
+
371
+
312
372
  }
@@ -99,39 +99,4 @@
99
99
  }
100
100
 
101
101
 
102
- // Use this function when you want to return a single record
103
- public async getServices(serviceId: string) {
104
- return await this._getLinks(this.moduleName, this.entityName, serviceId, 'Service');
105
- }
106
-
107
- public async linkServiceServices(serviceId: string, serviceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
-
109
- const associationDtos = [];
110
- for(const param of serviceIds){
111
- associationDtos.push({
112
- entity: 'ServiceModule:Service',
113
- recordId: param.id,
114
- linkType: 'Service__Service',
115
- relationType: param?.relationType,
116
- relatedAssociationId: param?.relatedAssociationId
117
- });
118
- }
119
-
120
- return await this._createLinks(this.moduleName, this.entityName, serviceId, associationDtos);
121
- }
122
-
123
- public async unlinkServiceServices(serviceId: string, linkedServiceIds: string[]) {
124
-
125
- const associationDtos = [];
126
- for(const pk of linkedServiceIds){
127
- associationDtos.push({
128
- primaryKey: serviceId,
129
- linkedRecordPrimaryKey: pk,
130
- });
131
- }
132
-
133
- return await this._deleteLinks(this.moduleName, this.entityName, serviceId, associationDtos);
134
- }
135
-
136
-
137
102
  }
@@ -134,39 +134,34 @@
134
134
  }
135
135
 
136
136
 
137
- // Use this function when you want to return a single record
138
- public async getSplitOrders(splitOrderId: string) {
139
- return await this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
140
- }
141
-
142
- public async linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
143
-
144
- const associationDtos = [];
145
- for(const param of splitOrderIds){
146
- associationDtos.push({
147
- entity: 'OrderModule:SplitOrder',
148
- recordId: param.id,
149
- linkType: 'SplitOrder__SplitOrder',
150
- relationType: param?.relationType,
151
- relatedAssociationId: param?.relatedAssociationId
152
- });
153
- }
137
+ public async linkOrderSplitOrders(splitOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
154
138
 
155
- return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
139
+ const associationDtos = [];
140
+ for(const param of orderIds){
141
+ associationDtos.push({
142
+ entity: 'OrderModule:Order',
143
+ recordId: param.id,
144
+ linkType: 'Order__SplitOrder',
145
+ relationType: param?.relationType,
146
+ relatedAssociationId: param?.relatedAssociationId
147
+ });
156
148
  }
157
149
 
158
- public async unlinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderIds: string[]) {
159
-
160
- const associationDtos = [];
161
- for(const pk of linkedSplitOrderIds){
150
+ return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
151
+ }
152
+
153
+ public async unlinkOrderSplitOrders(splitOrderId: string, linkedOrderIds: string[]) {
154
+
155
+ const associationDtos = [];
156
+ for(const pk of linkedOrderIds){
162
157
  associationDtos.push({
163
158
  primaryKey: splitOrderId,
164
159
  linkedRecordPrimaryKey: pk,
165
160
  });
166
161
  }
167
-
168
- return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
169
- }
162
+
163
+ return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
164
+ }
170
165
 
171
166
 
172
167
  }
@@ -99,41 +99,6 @@
99
99
  }
100
100
 
101
101
 
102
- // Use this function when you want to return a single record
103
- public async getTransactions(transactionId: string) {
104
- return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
105
- }
106
-
107
- public async linkTransactionTransactions(transactionId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
-
109
- const associationDtos = [];
110
- for(const param of transactionIds){
111
- associationDtos.push({
112
- entity: 'BillingModule:Transaction',
113
- recordId: param.id,
114
- linkType: 'Transaction__Transaction',
115
- relationType: param?.relationType,
116
- relatedAssociationId: param?.relatedAssociationId
117
- });
118
- }
119
-
120
- return await this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
121
- }
122
-
123
- public async unlinkTransactionTransactions(transactionId: string, linkedTransactionIds: string[]) {
124
-
125
- const associationDtos = [];
126
- for(const pk of linkedTransactionIds){
127
- associationDtos.push({
128
- primaryKey: transactionId,
129
- linkedRecordPrimaryKey: pk,
130
- });
131
- }
132
-
133
- return await this._deleteLinks(this.moduleName, this.entityName, transactionId, associationDtos);
134
- }
135
-
136
-
137
102
  // Use this function when you want to return a single record
138
103
  public async getInvoices(transactionId: string) {
139
104
  return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -449,4 +449,94 @@
449
449
  }
450
450
 
451
451
 
452
+ public async linkWorkOrderOwners(userId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
453
+
454
+ const associationDtos = [];
455
+ for(const param of workOrderIds){
456
+ associationDtos.push({
457
+ entity: 'FieldServiceModule:WorkOrder',
458
+ recordId: param.id,
459
+ linkType: 'WorkOrderOwner',
460
+ relationType: param?.relationType,
461
+ relatedAssociationId: param?.relatedAssociationId
462
+ });
463
+ }
464
+
465
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
466
+ }
467
+
468
+ public async unlinkWorkOrderOwners(userId: string, linkedWorkOrderIds: string[]) {
469
+
470
+ const associationDtos = [];
471
+ for(const pk of linkedWorkOrderIds){
472
+ associationDtos.push({
473
+ primaryKey: userId,
474
+ linkedRecordPrimaryKey: pk,
475
+ });
476
+ }
477
+
478
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, associationDtos);
479
+ }
480
+
481
+
482
+ public async linkManagers(userId: string, serviceAppointmentConfigIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
483
+
484
+ const associationDtos = [];
485
+ for(const param of serviceAppointmentConfigIds){
486
+ associationDtos.push({
487
+ entity: 'FieldServiceModule:ServiceAppointmentConfig',
488
+ recordId: param.id,
489
+ linkType: 'Manager',
490
+ relationType: param?.relationType,
491
+ relatedAssociationId: param?.relatedAssociationId
492
+ });
493
+ }
494
+
495
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
496
+ }
497
+
498
+ public async unlinkManagers(userId: string, linkedServiceAppointmentConfigIds: string[]) {
499
+
500
+ const associationDtos = [];
501
+ for(const pk of linkedServiceAppointmentConfigIds){
502
+ associationDtos.push({
503
+ primaryKey: userId,
504
+ linkedRecordPrimaryKey: pk,
505
+ });
506
+ }
507
+
508
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, associationDtos);
509
+ }
510
+
511
+
512
+ public async linkSupervisors(userId: string, serviceAppointmentConfigIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
513
+
514
+ const associationDtos = [];
515
+ for(const param of serviceAppointmentConfigIds){
516
+ associationDtos.push({
517
+ entity: 'FieldServiceModule:ServiceAppointmentConfig',
518
+ recordId: param.id,
519
+ linkType: 'Supervisor',
520
+ relationType: param?.relationType,
521
+ relatedAssociationId: param?.relatedAssociationId
522
+ });
523
+ }
524
+
525
+ return await this._createLinks(this.moduleName, this.entityName, userId, associationDtos);
526
+ }
527
+
528
+ public async unlinkSupervisors(userId: string, linkedServiceAppointmentConfigIds: string[]) {
529
+
530
+ const associationDtos = [];
531
+ for(const pk of linkedServiceAppointmentConfigIds){
532
+ associationDtos.push({
533
+ primaryKey: userId,
534
+ linkedRecordPrimaryKey: pk,
535
+ });
536
+ }
537
+
538
+ return await this._deleteLinks(this.moduleName, this.entityName, userId, associationDtos);
539
+ }
540
+
541
+
452
542
  }
@@ -274,39 +274,39 @@
274
274
  }
275
275
 
276
276
 
277
- // Use this function when you want to return a single record
278
- public async getWorkOrders(workOrderId: string) {
279
- return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
280
- }
277
+ // Use this function when you want to return a single record
278
+ public async getAccounts(workOrderId: string) {
279
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Account');
280
+ }
281
281
 
282
- public async linkAccountWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
283
-
284
- const associationDtos = [];
285
- for(const param of workOrderIds){
286
- associationDtos.push({
287
- entity: 'FieldServiceModule:WorkOrder',
288
- recordId: param.id,
289
- linkType: 'Account__WorkOrder',
290
- relationType: param?.relationType,
291
- relatedAssociationId: param?.relatedAssociationId
292
- });
293
- }
282
+ public async linkAccountWorkOrders(workOrderId: string, accountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
294
283
 
295
- return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
284
+ const associationDtos = [];
285
+ for(const param of accountIds){
286
+ associationDtos.push({
287
+ entity: 'CrmModule:Account',
288
+ recordId: param.id,
289
+ linkType: 'Account__WorkOrder',
290
+ relationType: param?.relationType,
291
+ relatedAssociationId: param?.relatedAssociationId
292
+ });
296
293
  }
297
294
 
298
- public async unlinkAccountWorkOrders(workOrderId: string, linkedWorkOrderIds: string[]) {
299
-
300
- const associationDtos = [];
301
- for(const pk of linkedWorkOrderIds){
295
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
296
+ }
297
+
298
+ public async unlinkAccountWorkOrders(workOrderId: string, linkedAccountIds: string[]) {
299
+
300
+ const associationDtos = [];
301
+ for(const pk of linkedAccountIds){
302
302
  associationDtos.push({
303
303
  primaryKey: workOrderId,
304
304
  linkedRecordPrimaryKey: pk,
305
305
  });
306
306
  }
307
-
308
- return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
309
- }
307
+
308
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
309
+ }
310
310
 
311
311
 
312
312
  // Use this function when you want to return a single record
@@ -554,6 +554,41 @@
554
554
  }
555
555
 
556
556
 
557
+ // Use this function when you want to return a single record
558
+ public async getPaymentMethodRefunds(workOrderId: string) {
559
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'PaymentMethodRefund');
560
+ }
561
+
562
+ public async linkPaymentMethodRefundWorkOrders(workOrderId: string, paymentMethodRefundIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
563
+
564
+ const associationDtos = [];
565
+ for(const param of paymentMethodRefundIds){
566
+ associationDtos.push({
567
+ entity: 'BillingModule:PaymentMethodRefund',
568
+ recordId: param.id,
569
+ linkType: 'PaymentMethodRefund__WorkOrder',
570
+ relationType: param?.relationType,
571
+ relatedAssociationId: param?.relatedAssociationId
572
+ });
573
+ }
574
+
575
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
576
+ }
577
+
578
+ public async unlinkPaymentMethodRefundWorkOrders(workOrderId: string, linkedPaymentMethodRefundIds: string[]) {
579
+
580
+ const associationDtos = [];
581
+ for(const pk of linkedPaymentMethodRefundIds){
582
+ associationDtos.push({
583
+ primaryKey: workOrderId,
584
+ linkedRecordPrimaryKey: pk,
585
+ });
586
+ }
587
+
588
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
589
+ }
590
+
591
+
557
592
  // Use this function when you want to return a single record
558
593
  public async getLeads(workOrderId: string) {
559
594
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Lead');
@@ -729,6 +764,41 @@
729
764
  }
730
765
 
731
766
 
767
+ // Use this function when you want to return a single record
768
+ public async getOrders(workOrderId: string) {
769
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Order');
770
+ }
771
+
772
+ public async linkOrderWorkOrders(workOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
773
+
774
+ const associationDtos = [];
775
+ for(const param of orderIds){
776
+ associationDtos.push({
777
+ entity: 'OrderModule:Order',
778
+ recordId: param.id,
779
+ linkType: 'Order__WorkOrder',
780
+ relationType: param?.relationType,
781
+ relatedAssociationId: param?.relatedAssociationId
782
+ });
783
+ }
784
+
785
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
786
+ }
787
+
788
+ public async unlinkOrderWorkOrders(workOrderId: string, linkedOrderIds: string[]) {
789
+
790
+ const associationDtos = [];
791
+ for(const pk of linkedOrderIds){
792
+ associationDtos.push({
793
+ primaryKey: workOrderId,
794
+ linkedRecordPrimaryKey: pk,
795
+ });
796
+ }
797
+
798
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
799
+ }
800
+
801
+
732
802
  // Use this function when you want to return a single record
733
803
  public async getServiceAppointmentConfigs(workOrderId: string) {
734
804
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'ServiceAppointmentConfig');
@@ -834,6 +904,111 @@
834
904
  }
835
905
 
836
906
 
907
+ // Use this function when you want to return a single record
908
+ public async getOrderRemediationTasks(workOrderId: string) {
909
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OrderRemediationTask');
910
+ }
911
+
912
+ public async linkOrderRemediationTaskWorkOrders(workOrderId: string, orderRemediationTaskIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
913
+
914
+ const associationDtos = [];
915
+ for(const param of orderRemediationTaskIds){
916
+ associationDtos.push({
917
+ entity: 'OrderModule:OrderRemediationTask',
918
+ recordId: param.id,
919
+ linkType: 'OrderRemediationTask__WorkOrder',
920
+ relationType: param?.relationType,
921
+ relatedAssociationId: param?.relatedAssociationId
922
+ });
923
+ }
924
+
925
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
926
+ }
927
+
928
+ public async unlinkOrderRemediationTaskWorkOrders(workOrderId: string, linkedOrderRemediationTaskIds: string[]) {
929
+
930
+ const associationDtos = [];
931
+ for(const pk of linkedOrderRemediationTaskIds){
932
+ associationDtos.push({
933
+ primaryKey: workOrderId,
934
+ linkedRecordPrimaryKey: pk,
935
+ });
936
+ }
937
+
938
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
939
+ }
940
+
941
+
942
+ // Use this function when you want to return a single record
943
+ public async getCases(workOrderId: string) {
944
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Case');
945
+ }
946
+
947
+ public async linkCaseWorkOrders(workOrderId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
948
+
949
+ const associationDtos = [];
950
+ for(const param of caseIds){
951
+ associationDtos.push({
952
+ entity: 'SupportModule:Case',
953
+ recordId: param.id,
954
+ linkType: 'Case__WorkOrder',
955
+ relationType: param?.relationType,
956
+ relatedAssociationId: param?.relatedAssociationId
957
+ });
958
+ }
959
+
960
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
961
+ }
962
+
963
+ public async unlinkCaseWorkOrders(workOrderId: string, linkedCaseIds: string[]) {
964
+
965
+ const associationDtos = [];
966
+ for(const pk of linkedCaseIds){
967
+ associationDtos.push({
968
+ primaryKey: workOrderId,
969
+ linkedRecordPrimaryKey: pk,
970
+ });
971
+ }
972
+
973
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
974
+ }
975
+
976
+
977
+ // Use this function when you want to return a single record
978
+ public async getCalls(workOrderId: string) {
979
+ return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'Call');
980
+ }
981
+
982
+ public async linkCallWorkOrders(workOrderId: string, callIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
983
+
984
+ const associationDtos = [];
985
+ for(const param of callIds){
986
+ associationDtos.push({
987
+ entity: 'NotificationModule:Call',
988
+ recordId: param.id,
989
+ linkType: 'Call__WorkOrder',
990
+ relationType: param?.relationType,
991
+ relatedAssociationId: param?.relatedAssociationId
992
+ });
993
+ }
994
+
995
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
996
+ }
997
+
998
+ public async unlinkCallWorkOrders(workOrderId: string, linkedCallIds: string[]) {
999
+
1000
+ const associationDtos = [];
1001
+ for(const pk of linkedCallIds){
1002
+ associationDtos.push({
1003
+ primaryKey: workOrderId,
1004
+ linkedRecordPrimaryKey: pk,
1005
+ });
1006
+ }
1007
+
1008
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1009
+ }
1010
+
1011
+
837
1012
  // Use this function when you want to return a single record
838
1013
  public async getPermissionToFails(workOrderId: string) {
839
1014
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'PermissionToFail');
@@ -1079,6 +1254,36 @@
1079
1254
  }
1080
1255
 
1081
1256
 
1257
+ public async linkWorkOrderOwners(workOrderId: string, userIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
1258
+
1259
+ const associationDtos = [];
1260
+ for(const param of userIds){
1261
+ associationDtos.push({
1262
+ entity: 'IdentityModule:User',
1263
+ recordId: param.id,
1264
+ linkType: 'WorkOrderOwner',
1265
+ relationType: param?.relationType,
1266
+ relatedAssociationId: param?.relatedAssociationId
1267
+ });
1268
+ }
1269
+
1270
+ return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1271
+ }
1272
+
1273
+ public async unlinkWorkOrderOwners(workOrderId: string, linkedUserIds: string[]) {
1274
+
1275
+ const associationDtos = [];
1276
+ for(const pk of linkedUserIds){
1277
+ associationDtos.push({
1278
+ primaryKey: workOrderId,
1279
+ linkedRecordPrimaryKey: pk,
1280
+ });
1281
+ }
1282
+
1283
+ return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1284
+ }
1285
+
1286
+
1082
1287
  // Use this function when you want to return a single record
1083
1288
  public async getNetomniaFtthServiceVisitSheets(workOrderId: string) {
1084
1289
  return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'NetomniaFtthServiceVisitSheet');
@@ -12,7 +12,6 @@ const entitiesToExclude = [
12
12
  'EsTest',
13
13
  'KnowledgeArticle',
14
14
  'OhRetroAudit',
15
- 'OrderTest1',
16
15
  'OutcomeFormOhRetroAudit',
17
16
  'OutcomeFormOverlayA55',
18
17
  'OutcomeFormUgRetroAudit',
@@ -26,8 +25,8 @@ const entitiesToExclude = [
26
25
 
27
26
  (async function exec(){
28
27
 
29
- generateEntities({ entitiesToExclude });
30
- generateTypes({ entitiesToExclude });
28
+ // generateEntities({ entitiesToExclude });
29
+ // generateTypes({ entitiesToExclude });
31
30
  generateApiSdk({ entitiesToExclude });
32
31
  generateDbSdk({ entitiesToExclude });
33
32