@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 getContacts(contactId: string) {
69
- return await this._getLinks(this.moduleName, this.entityName, contactId, 'Contact');
70
- }
67
+ // Use this function when you want to return a single record
68
+ public async getOrganizations(contactId: string) {
69
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Organization');
70
+ }
71
71
 
72
- public async linkOrganizationContacts(contactId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
72
+ public async linkOrganizationContacts(contactId: string, organizationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
73
73
 
74
- const associationDtos = [];
75
- for(const param of contactIds){
76
- associationDtos.push({
77
- entity: 'CrmModule:Contact',
78
- recordId: param.id,
79
- linkType: 'Organization__Contact',
80
- relationType: param?.relationType,
81
- relatedAssociationId: param?.relatedAssociationId
82
- });
83
- }
84
-
85
- return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
74
+ const associationDtos = [];
75
+ for(const param of organizationIds){
76
+ associationDtos.push({
77
+ entity: 'CrmModule:Organization',
78
+ recordId: param.id,
79
+ linkType: 'Organization__Contact',
80
+ relationType: param?.relationType,
81
+ relatedAssociationId: param?.relatedAssociationId
82
+ });
86
83
  }
87
84
 
88
- public async unlinkOrganizationContacts(contactId: string, linkedContactIds: string[]) {
89
-
90
- const associationDtos = [];
91
- for(const pk of linkedContactIds){
85
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
86
+ }
87
+
88
+ public async unlinkOrganizationContacts(contactId: string, linkedOrganizationIds: string[]) {
89
+
90
+ const associationDtos = [];
91
+ for(const pk of linkedOrganizationIds){
92
92
  associationDtos.push({
93
93
  primaryKey: contactId,
94
94
  linkedRecordPrimaryKey: pk,
95
95
  });
96
96
  }
97
-
98
- return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
97
+
98
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
99
+ }
100
+
101
+
102
+ // Use this function when you want to return a single record
103
+ public async getAccounts(contactId: string) {
104
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Account');
105
+ }
106
+
107
+ public async linkBillingContacts(contactId: string, accountIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
+
109
+ const associationDtos = [];
110
+ for(const param of accountIds){
111
+ associationDtos.push({
112
+ entity: 'CrmModule:Account',
113
+ recordId: param.id,
114
+ linkType: 'BillingContact',
115
+ relationType: param?.relationType,
116
+ relatedAssociationId: param?.relatedAssociationId
117
+ });
99
118
  }
100
119
 
120
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
121
+ }
122
+
123
+ public async unlinkBillingContacts(contactId: string, linkedAccountIds: string[]) {
124
+
125
+ const associationDtos = [];
126
+ for(const pk of linkedAccountIds){
127
+ associationDtos.push({
128
+ primaryKey: contactId,
129
+ linkedRecordPrimaryKey: pk,
130
+ });
131
+ }
132
+
133
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
134
+ }
135
+
101
136
 
102
137
  // Use this function when you want to return a single record
103
138
  public async getActivitys(contactId: string) {
@@ -169,6 +204,111 @@
169
204
  }
170
205
 
171
206
 
207
+ // Use this function when you want to return a single record
208
+ public async getWorkOrders(contactId: string) {
209
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'WorkOrder');
210
+ }
211
+
212
+ public async linkWorkOrderContacts(contactId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
213
+
214
+ const associationDtos = [];
215
+ for(const param of workOrderIds){
216
+ associationDtos.push({
217
+ entity: 'FieldServiceModule:WorkOrder',
218
+ recordId: param.id,
219
+ linkType: 'WorkOrder__Contact',
220
+ relationType: param?.relationType,
221
+ relatedAssociationId: param?.relatedAssociationId
222
+ });
223
+ }
224
+
225
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
226
+ }
227
+
228
+ public async unlinkWorkOrderContacts(contactId: string, linkedWorkOrderIds: string[]) {
229
+
230
+ const associationDtos = [];
231
+ for(const pk of linkedWorkOrderIds){
232
+ associationDtos.push({
233
+ primaryKey: contactId,
234
+ linkedRecordPrimaryKey: pk,
235
+ });
236
+ }
237
+
238
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
239
+ }
240
+
241
+
242
+ // Use this function when you want to return a single record
243
+ public async getOrders(contactId: string) {
244
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Order');
245
+ }
246
+
247
+ public async linkOrderContacts(contactId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
248
+
249
+ const associationDtos = [];
250
+ for(const param of orderIds){
251
+ associationDtos.push({
252
+ entity: 'OrderModule:Order',
253
+ recordId: param.id,
254
+ linkType: 'Order__Contact',
255
+ relationType: param?.relationType,
256
+ relatedAssociationId: param?.relatedAssociationId
257
+ });
258
+ }
259
+
260
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
261
+ }
262
+
263
+ public async unlinkOrderContacts(contactId: string, linkedOrderIds: string[]) {
264
+
265
+ const associationDtos = [];
266
+ for(const pk of linkedOrderIds){
267
+ associationDtos.push({
268
+ primaryKey: contactId,
269
+ linkedRecordPrimaryKey: pk,
270
+ });
271
+ }
272
+
273
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
274
+ }
275
+
276
+
277
+ // Use this function when you want to return a single record
278
+ public async getLeads(contactId: string) {
279
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Lead');
280
+ }
281
+
282
+ public async linkLeadContacts(contactId: string, leadIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
283
+
284
+ const associationDtos = [];
285
+ for(const param of leadIds){
286
+ associationDtos.push({
287
+ entity: 'CrmModule:Lead',
288
+ recordId: param.id,
289
+ linkType: 'Lead__Contact',
290
+ relationType: param?.relationType,
291
+ relatedAssociationId: param?.relatedAssociationId
292
+ });
293
+ }
294
+
295
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
296
+ }
297
+
298
+ public async unlinkLeadContacts(contactId: string, linkedLeadIds: string[]) {
299
+
300
+ const associationDtos = [];
301
+ for(const pk of linkedLeadIds){
302
+ associationDtos.push({
303
+ primaryKey: contactId,
304
+ linkedRecordPrimaryKey: pk,
305
+ });
306
+ }
307
+
308
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
309
+ }
310
+
311
+
172
312
  // Use this function when you want to return a single record
173
313
  public async getAddresss(contactId: string) {
174
314
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'Address');
@@ -239,6 +379,41 @@
239
379
  }
240
380
 
241
381
 
382
+ // Use this function when you want to return a single record
383
+ public async getInvoices(contactId: string) {
384
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Invoice');
385
+ }
386
+
387
+ public async linkInvoiceContacts(contactId: string, invoiceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
388
+
389
+ const associationDtos = [];
390
+ for(const param of invoiceIds){
391
+ associationDtos.push({
392
+ entity: 'BillingModule:Invoice',
393
+ recordId: param.id,
394
+ linkType: 'Invoice__Contact',
395
+ relationType: param?.relationType,
396
+ relatedAssociationId: param?.relatedAssociationId
397
+ });
398
+ }
399
+
400
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
401
+ }
402
+
403
+ public async unlinkInvoiceContacts(contactId: string, linkedInvoiceIds: string[]) {
404
+
405
+ const associationDtos = [];
406
+ for(const pk of linkedInvoiceIds){
407
+ associationDtos.push({
408
+ primaryKey: contactId,
409
+ linkedRecordPrimaryKey: pk,
410
+ });
411
+ }
412
+
413
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
414
+ }
415
+
416
+
242
417
  // Use this function when you want to return a single record
243
418
  public async getBillingRequests(contactId: string) {
244
419
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'BillingRequest');
@@ -309,6 +484,76 @@
309
484
  }
310
485
 
311
486
 
487
+ // Use this function when you want to return a single record
488
+ public async getCommissions(contactId: string) {
489
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Commission');
490
+ }
491
+
492
+ public async linkCommissionContacts(contactId: string, commissionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
493
+
494
+ const associationDtos = [];
495
+ for(const param of commissionIds){
496
+ associationDtos.push({
497
+ entity: 'BillingModule:Commission',
498
+ recordId: param.id,
499
+ linkType: 'Commission__Contact',
500
+ relationType: param?.relationType,
501
+ relatedAssociationId: param?.relatedAssociationId
502
+ });
503
+ }
504
+
505
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
506
+ }
507
+
508
+ public async unlinkCommissionContacts(contactId: string, linkedCommissionIds: string[]) {
509
+
510
+ const associationDtos = [];
511
+ for(const pk of linkedCommissionIds){
512
+ associationDtos.push({
513
+ primaryKey: contactId,
514
+ linkedRecordPrimaryKey: pk,
515
+ });
516
+ }
517
+
518
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
519
+ }
520
+
521
+
522
+ // Use this function when you want to return a single record
523
+ public async getOneTouchSwitchs(contactId: string) {
524
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'OneTouchSwitch');
525
+ }
526
+
527
+ public async linkOneTouchSwitchContacts(contactId: string, oneTouchSwitchIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
528
+
529
+ const associationDtos = [];
530
+ for(const param of oneTouchSwitchIds){
531
+ associationDtos.push({
532
+ entity: 'OrderModule:OneTouchSwitch',
533
+ recordId: param.id,
534
+ linkType: 'OneTouchSwitch__Contact',
535
+ relationType: param?.relationType,
536
+ relatedAssociationId: param?.relatedAssociationId
537
+ });
538
+ }
539
+
540
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
541
+ }
542
+
543
+ public async unlinkOneTouchSwitchContacts(contactId: string, linkedOneTouchSwitchIds: string[]) {
544
+
545
+ const associationDtos = [];
546
+ for(const pk of linkedOneTouchSwitchIds){
547
+ associationDtos.push({
548
+ primaryKey: contactId,
549
+ linkedRecordPrimaryKey: pk,
550
+ });
551
+ }
552
+
553
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
554
+ }
555
+
556
+
312
557
  // Use this function when you want to return a single record
313
558
  public async getContactIdentitys(contactId: string) {
314
559
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'ContactIdentity');
@@ -379,6 +624,41 @@
379
624
  }
380
625
 
381
626
 
627
+ // Use this function when you want to return a single record
628
+ public async getDeactivationApprovals(contactId: string) {
629
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'DeactivationApproval');
630
+ }
631
+
632
+ public async linkDeactivationApprovalContacts(contactId: string, deactivationApprovalIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
633
+
634
+ const associationDtos = [];
635
+ for(const param of deactivationApprovalIds){
636
+ associationDtos.push({
637
+ entity: 'OrderModule:DeactivationApproval',
638
+ recordId: param.id,
639
+ linkType: 'DeactivationApproval__Contact',
640
+ relationType: param?.relationType,
641
+ relatedAssociationId: param?.relatedAssociationId
642
+ });
643
+ }
644
+
645
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
646
+ }
647
+
648
+ public async unlinkDeactivationApprovalContacts(contactId: string, linkedDeactivationApprovalIds: string[]) {
649
+
650
+ const associationDtos = [];
651
+ for(const pk of linkedDeactivationApprovalIds){
652
+ associationDtos.push({
653
+ primaryKey: contactId,
654
+ linkedRecordPrimaryKey: pk,
655
+ });
656
+ }
657
+
658
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
659
+ }
660
+
661
+
382
662
  // Use this function when you want to return a single record
383
663
  public async getPhoneNumbers(contactId: string) {
384
664
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'PhoneNumber');
@@ -414,6 +694,76 @@
414
694
  }
415
695
 
416
696
 
697
+ // Use this function when you want to return a single record
698
+ public async getOrderRemediationTasks(contactId: string) {
699
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'OrderRemediationTask');
700
+ }
701
+
702
+ public async linkOrderRemediationTaskContacts(contactId: string, orderRemediationTaskIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
703
+
704
+ const associationDtos = [];
705
+ for(const param of orderRemediationTaskIds){
706
+ associationDtos.push({
707
+ entity: 'OrderModule:OrderRemediationTask',
708
+ recordId: param.id,
709
+ linkType: 'OrderRemediationTask__Contact',
710
+ relationType: param?.relationType,
711
+ relatedAssociationId: param?.relatedAssociationId
712
+ });
713
+ }
714
+
715
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
716
+ }
717
+
718
+ public async unlinkOrderRemediationTaskContacts(contactId: string, linkedOrderRemediationTaskIds: string[]) {
719
+
720
+ const associationDtos = [];
721
+ for(const pk of linkedOrderRemediationTaskIds){
722
+ associationDtos.push({
723
+ primaryKey: contactId,
724
+ linkedRecordPrimaryKey: pk,
725
+ });
726
+ }
727
+
728
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
729
+ }
730
+
731
+
732
+ // Use this function when you want to return a single record
733
+ public async getCases(contactId: string) {
734
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Case');
735
+ }
736
+
737
+ public async linkCaseContacts(contactId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
738
+
739
+ const associationDtos = [];
740
+ for(const param of caseIds){
741
+ associationDtos.push({
742
+ entity: 'SupportModule:Case',
743
+ recordId: param.id,
744
+ linkType: 'Case__Contact',
745
+ relationType: param?.relationType,
746
+ relatedAssociationId: param?.relatedAssociationId
747
+ });
748
+ }
749
+
750
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
751
+ }
752
+
753
+ public async unlinkCaseContacts(contactId: string, linkedCaseIds: string[]) {
754
+
755
+ const associationDtos = [];
756
+ for(const pk of linkedCaseIds){
757
+ associationDtos.push({
758
+ primaryKey: contactId,
759
+ linkedRecordPrimaryKey: pk,
760
+ });
761
+ }
762
+
763
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
764
+ }
765
+
766
+
417
767
  // Use this function when you want to return a single record
418
768
  public async getAppointments(contactId: string) {
419
769
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'Appointment');
@@ -449,6 +799,41 @@
449
799
  }
450
800
 
451
801
 
802
+ // Use this function when you want to return a single record
803
+ public async getCalls(contactId: string) {
804
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Call');
805
+ }
806
+
807
+ public async linkCallContacts(contactId: string, callIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
808
+
809
+ const associationDtos = [];
810
+ for(const param of callIds){
811
+ associationDtos.push({
812
+ entity: 'NotificationModule:Call',
813
+ recordId: param.id,
814
+ linkType: 'Call__Contact',
815
+ relationType: param?.relationType,
816
+ relatedAssociationId: param?.relatedAssociationId
817
+ });
818
+ }
819
+
820
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
821
+ }
822
+
823
+ public async unlinkCallContacts(contactId: string, linkedCallIds: string[]) {
824
+
825
+ const associationDtos = [];
826
+ for(const pk of linkedCallIds){
827
+ associationDtos.push({
828
+ primaryKey: contactId,
829
+ linkedRecordPrimaryKey: pk,
830
+ });
831
+ }
832
+
833
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
834
+ }
835
+
836
+
452
837
  // Use this function when you want to return a single record
453
838
  public async getPaymentMethods(contactId: string) {
454
839
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'PaymentMethod');
@@ -484,4 +869,39 @@
484
869
  }
485
870
 
486
871
 
872
+ // Use this function when you want to return a single record
873
+ public async getFingerprints(contactId: string) {
874
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Fingerprint');
875
+ }
876
+
877
+ public async linkFingerprintContacts(contactId: string, fingerprintIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
878
+
879
+ const associationDtos = [];
880
+ for(const param of fingerprintIds){
881
+ associationDtos.push({
882
+ entity: 'CrmModule:Fingerprint',
883
+ recordId: param.id,
884
+ linkType: 'Fingerprint__Contact',
885
+ relationType: param?.relationType,
886
+ relatedAssociationId: param?.relatedAssociationId
887
+ });
888
+ }
889
+
890
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
891
+ }
892
+
893
+ public async unlinkFingerprintContacts(contactId: string, linkedFingerprintIds: string[]) {
894
+
895
+ const associationDtos = [];
896
+ for(const pk of linkedFingerprintIds){
897
+ associationDtos.push({
898
+ primaryKey: contactId,
899
+ linkedRecordPrimaryKey: pk,
900
+ });
901
+ }
902
+
903
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, associationDtos);
904
+ }
905
+
906
+
487
907
  }
@@ -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 getContactIdentitys(contactIdentityId: string) {
104
- return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'ContactIdentity');
105
- }
106
-
107
- public async linkContactIdentityContactIdentitys(contactIdentityId: string, contactIdentityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
108
-
109
- const associationDtos = [];
110
- for(const param of contactIdentityIds){
111
- associationDtos.push({
112
- entity: 'CrmModule:ContactIdentity',
113
- recordId: param.id,
114
- linkType: 'ContactIdentity__ContactIdentity',
115
- relationType: param?.relationType,
116
- relatedAssociationId: param?.relatedAssociationId
117
- });
118
- }
119
-
120
- return await this._createLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
121
- }
122
-
123
- public async unlinkContactIdentityContactIdentitys(contactIdentityId: string, linkedContactIdentityIds: string[]) {
124
-
125
- const associationDtos = [];
126
- for(const pk of linkedContactIdentityIds){
127
- associationDtos.push({
128
- primaryKey: contactIdentityId,
129
- linkedRecordPrimaryKey: pk,
130
- });
131
- }
132
-
133
- return await this._deleteLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
134
- }
135
-
136
-
137
102
  // Use this function when you want to return a single record
138
103
  public async getContacts(contactIdentityId: string) {
139
104
  return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'Contact');