@d19n/youfibre-odin-sdk 1.0.21 → 1.0.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/dist/api-sdk-v1/BillingRequestApi.d.ts +7 -0
  2. package/dist/api-sdk-v1/BillingRequestApi.js +26 -0
  3. package/dist/api-sdk-v1/CaseApi.d.ts +7 -0
  4. package/dist/api-sdk-v1/CaseApi.js +26 -0
  5. package/dist/api-sdk-v1/ConsumptionRateApi.d.ts +7 -0
  6. package/dist/api-sdk-v1/ConsumptionRateApi.js +26 -0
  7. package/dist/api-sdk-v1/ConsumptionScheduleApi.d.ts +7 -0
  8. package/dist/api-sdk-v1/ConsumptionScheduleApi.js +26 -0
  9. package/dist/api-sdk-v1/ContactApi.d.ts +7 -0
  10. package/dist/api-sdk-v1/ContactApi.js +26 -0
  11. package/dist/api-sdk-v1/ContactIdentityApi.d.ts +7 -0
  12. package/dist/api-sdk-v1/ContactIdentityApi.js +26 -0
  13. package/dist/api-sdk-v1/CustomerDeviceOntRemovalApi.d.ts +7 -0
  14. package/dist/api-sdk-v1/CustomerDeviceOntRemovalApi.js +26 -0
  15. package/dist/api-sdk-v1/FileApi.d.ts +0 -49
  16. package/dist/api-sdk-v1/FileApi.js +0 -182
  17. package/dist/api-sdk-v1/InvoiceItemApi.d.ts +7 -0
  18. package/dist/api-sdk-v1/InvoiceItemApi.js +26 -0
  19. package/dist/api-sdk-v1/MilestoneApi.d.ts +7 -0
  20. package/dist/api-sdk-v1/MilestoneApi.js +26 -0
  21. package/dist/api-sdk-v1/NoteApi.d.ts +7 -0
  22. package/dist/api-sdk-v1/NoteApi.js +26 -0
  23. package/dist/api-sdk-v1/OfferApi.d.ts +7 -0
  24. package/dist/api-sdk-v1/OfferApi.js +26 -0
  25. package/dist/api-sdk-v1/OrderApi.d.ts +7 -0
  26. package/dist/api-sdk-v1/OrderApi.js +26 -0
  27. package/dist/api-sdk-v1/OrderItemApi.d.ts +7 -0
  28. package/dist/api-sdk-v1/OrderItemApi.js +26 -0
  29. package/dist/api-sdk-v1/OrganizationApi.d.ts +7 -0
  30. package/dist/api-sdk-v1/OrganizationApi.js +26 -0
  31. package/dist/api-sdk-v1/ProductApi.d.ts +9 -1
  32. package/dist/api-sdk-v1/ProductApi.js +31 -0
  33. package/dist/api-sdk-v1/ProductComponentApi.d.ts +7 -0
  34. package/dist/api-sdk-v1/ProductComponentApi.js +26 -0
  35. package/dist/api-sdk-v1/RestrictionApi.d.ts +7 -0
  36. package/dist/api-sdk-v1/RestrictionApi.js +26 -0
  37. package/dist/api-sdk-v1/ServiceApi.d.ts +7 -0
  38. package/dist/api-sdk-v1/ServiceApi.js +26 -0
  39. package/dist/api-sdk-v1/SplitOrderApi.d.ts +7 -0
  40. package/dist/api-sdk-v1/SplitOrderApi.js +26 -0
  41. package/dist/api-sdk-v1/TransactionApi.d.ts +7 -0
  42. package/dist/api-sdk-v1/TransactionApi.js +26 -0
  43. package/dist/api-sdk-v1/WorkOrderApi.d.ts +14 -0
  44. package/dist/api-sdk-v1/WorkOrderApi.js +52 -0
  45. package/dist/db-sdk-v1/BillingRequestDb.d.ts +7 -0
  46. package/dist/db-sdk-v1/BillingRequestDb.js +33 -0
  47. package/dist/db-sdk-v1/CaseDb.d.ts +7 -0
  48. package/dist/db-sdk-v1/CaseDb.js +33 -0
  49. package/dist/db-sdk-v1/ConsumptionRateDb.d.ts +7 -0
  50. package/dist/db-sdk-v1/ConsumptionRateDb.js +33 -0
  51. package/dist/db-sdk-v1/ConsumptionScheduleDb.d.ts +7 -0
  52. package/dist/db-sdk-v1/ConsumptionScheduleDb.js +33 -0
  53. package/dist/db-sdk-v1/ContactDb.d.ts +7 -0
  54. package/dist/db-sdk-v1/ContactDb.js +33 -0
  55. package/dist/db-sdk-v1/ContactIdentityDb.d.ts +7 -0
  56. package/dist/db-sdk-v1/ContactIdentityDb.js +33 -0
  57. package/dist/db-sdk-v1/FileDb.d.ts +0 -49
  58. package/dist/db-sdk-v1/FileDb.js +0 -231
  59. package/dist/db-sdk-v1/InvoiceItemDb.d.ts +7 -0
  60. package/dist/db-sdk-v1/InvoiceItemDb.js +33 -0
  61. package/dist/db-sdk-v1/MilestoneDb.d.ts +7 -0
  62. package/dist/db-sdk-v1/MilestoneDb.js +33 -0
  63. package/dist/db-sdk-v1/NoteDb.d.ts +7 -0
  64. package/dist/db-sdk-v1/NoteDb.js +33 -0
  65. package/dist/db-sdk-v1/OfferDb.d.ts +7 -0
  66. package/dist/db-sdk-v1/OfferDb.js +33 -0
  67. package/dist/db-sdk-v1/OrderDb.d.ts +7 -0
  68. package/dist/db-sdk-v1/OrderDb.js +33 -0
  69. package/dist/db-sdk-v1/OrderItemDb.d.ts +7 -0
  70. package/dist/db-sdk-v1/OrderItemDb.js +33 -0
  71. package/dist/db-sdk-v1/OrganizationDb.d.ts +7 -0
  72. package/dist/db-sdk-v1/OrganizationDb.js +33 -0
  73. package/dist/db-sdk-v1/ProductComponentDb.d.ts +7 -0
  74. package/dist/db-sdk-v1/ProductComponentDb.js +33 -0
  75. package/dist/db-sdk-v1/ProductDb.d.ts +9 -1
  76. package/dist/db-sdk-v1/ProductDb.js +38 -0
  77. package/dist/db-sdk-v1/RestrictionDb.d.ts +7 -0
  78. package/dist/db-sdk-v1/RestrictionDb.js +33 -0
  79. package/dist/db-sdk-v1/ServiceDb.d.ts +7 -0
  80. package/dist/db-sdk-v1/ServiceDb.js +33 -0
  81. package/dist/db-sdk-v1/SplitOrderDb.d.ts +7 -0
  82. package/dist/db-sdk-v1/SplitOrderDb.js +33 -0
  83. package/dist/db-sdk-v1/TransactionDb.d.ts +7 -0
  84. package/dist/db-sdk-v1/TransactionDb.js +33 -0
  85. package/dist/db-sdk-v1/WorkOrderDb.d.ts +14 -0
  86. package/dist/db-sdk-v1/WorkOrderDb.js +66 -0
  87. package/package.json +2 -2
  88. package/src/api-sdk-v1/BillingRequestApi.ts +27 -0
  89. package/src/api-sdk-v1/CaseApi.ts +27 -0
  90. package/src/api-sdk-v1/ConsumptionRateApi.ts +27 -0
  91. package/src/api-sdk-v1/ConsumptionScheduleApi.ts +27 -0
  92. package/src/api-sdk-v1/ContactApi.ts +27 -0
  93. package/src/api-sdk-v1/ContactIdentityApi.ts +27 -0
  94. package/src/api-sdk-v1/CustomerDeviceOntRemovalApi.ts +27 -0
  95. package/src/api-sdk-v1/FileApi.ts +0 -189
  96. package/src/api-sdk-v1/InvoiceItemApi.ts +27 -0
  97. package/src/api-sdk-v1/MilestoneApi.ts +27 -0
  98. package/src/api-sdk-v1/NoteApi.ts +27 -0
  99. package/src/api-sdk-v1/OfferApi.ts +27 -0
  100. package/src/api-sdk-v1/OrderApi.ts +27 -0
  101. package/src/api-sdk-v1/OrderItemApi.ts +27 -0
  102. package/src/api-sdk-v1/OrganizationApi.ts +27 -0
  103. package/src/api-sdk-v1/ProductApi.ts +31 -0
  104. package/src/api-sdk-v1/ProductComponentApi.ts +27 -0
  105. package/src/api-sdk-v1/RestrictionApi.ts +27 -0
  106. package/src/api-sdk-v1/ServiceApi.ts +27 -0
  107. package/src/api-sdk-v1/SplitOrderApi.ts +27 -0
  108. package/src/api-sdk-v1/TransactionApi.ts +27 -0
  109. package/src/api-sdk-v1/WorkOrderApi.ts +54 -0
  110. package/src/db-sdk-v1/BillingRequestDb.ts +35 -0
  111. package/src/db-sdk-v1/CaseDb.ts +35 -0
  112. package/src/db-sdk-v1/ConsumptionRateDb.ts +35 -0
  113. package/src/db-sdk-v1/ConsumptionScheduleDb.ts +35 -0
  114. package/src/db-sdk-v1/ContactDb.ts +35 -0
  115. package/src/db-sdk-v1/ContactIdentityDb.ts +35 -0
  116. package/src/db-sdk-v1/FileDb.ts +0 -245
  117. package/src/db-sdk-v1/InvoiceItemDb.ts +35 -0
  118. package/src/db-sdk-v1/MilestoneDb.ts +35 -0
  119. package/src/db-sdk-v1/NoteDb.ts +35 -0
  120. package/src/db-sdk-v1/OfferDb.ts +35 -0
  121. package/src/db-sdk-v1/OrderDb.ts +35 -0
  122. package/src/db-sdk-v1/OrderItemDb.ts +35 -0
  123. package/src/db-sdk-v1/OrganizationDb.ts +35 -0
  124. package/src/db-sdk-v1/ProductComponentDb.ts +35 -0
  125. package/src/db-sdk-v1/ProductDb.ts +39 -0
  126. package/src/db-sdk-v1/RestrictionDb.ts +35 -0
  127. package/src/db-sdk-v1/ServiceDb.ts +35 -0
  128. package/src/db-sdk-v1/SplitOrderDb.ts +35 -0
  129. package/src/db-sdk-v1/TransactionDb.ts +35 -0
  130. package/src/db-sdk-v1/WorkOrderDb.ts +70 -0
@@ -145,5 +145,38 @@ class ProductComponentDb extends db_provider_1.DbProvider {
145
145
  return yield this._deleteLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
146
146
  });
147
147
  }
148
+ // Use this function when you want to return a single record
149
+ getProductComponents(productComponentId) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return yield this._getLinks(this.moduleName, this.entityName, productComponentId, 'ProductComponent');
152
+ });
153
+ }
154
+ linkProductComponentProductComponents(productComponentId, productComponentIds) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ const associationDtos = [];
157
+ for (const param of productComponentIds) {
158
+ associationDtos.push({
159
+ entity: 'ProductModule:ProductComponent',
160
+ recordId: param.id,
161
+ linkType: 'ProductComponent__ProductComponent',
162
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
163
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
164
+ });
165
+ }
166
+ return yield this._createLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
167
+ });
168
+ }
169
+ unlinkProductComponentProductComponents(productComponentId, linkedProductComponentIds) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const associationDtos = [];
172
+ for (const pk of linkedProductComponentIds) {
173
+ associationDtos.push({
174
+ primaryKey: productComponentId,
175
+ linkedRecordPrimaryKey: pk,
176
+ });
177
+ }
178
+ return yield this._deleteLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
179
+ });
180
+ }
148
181
  }
149
182
  exports.ProductComponentDb = ProductComponentDb;
@@ -1,6 +1,6 @@
1
1
  import { DbProvider } from '@d19n/odin-sdk-generator/dist/db.provider';
2
2
  import { OdinSearchV2 } from '@d19n/odin-types/dist/interfaces/v2.db.interfaces';
3
- import { OdinRecordCreateDto, OdinRecordUpdateDto, RelationTypeEnum } from '@d19n/odin-types/dist/dtos/odin.dtos';
3
+ import { OdinRecordCreateDto, OdinRecordUpdateDto, OdinLinkedRecordUpdateDto, RelationTypeEnum } from '@d19n/odin-types/dist/dtos/odin.dtos';
4
4
  export declare class ProductDb extends DbProvider {
5
5
  protected readonly principal: any;
6
6
  protected readonly dbService: any;
@@ -80,4 +80,12 @@ export declare class ProductDb extends DbProvider {
80
80
  relatedAssociationId?: string;
81
81
  }[]): Promise<any>;
82
82
  unlinkOrderItemProducts(productId: string, linkedOrderItemIds: string[]): Promise<any>;
83
+ getProducts(productId: string): Promise<any>;
84
+ linkProductProducts(productId: string, productIds: {
85
+ id: string;
86
+ relationType?: RelationTypeEnum;
87
+ relatedAssociationId?: string;
88
+ }[]): Promise<any>;
89
+ unlinkProductProducts(productId: string, linkedProductIds: string[]): Promise<any>;
90
+ updateProductProductLinkProperties(productId: string, dbRecordAssociationId: string, updateDto: OdinLinkedRecordUpdateDto): Promise<any>;
83
91
  }
@@ -376,5 +376,43 @@ class ProductDb extends db_provider_1.DbProvider {
376
376
  return yield this._deleteLinks(this.moduleName, this.entityName, productId, associationDtos);
377
377
  });
378
378
  }
379
+ // Use this function when you want to return a single record
380
+ getProducts(productId) {
381
+ return __awaiter(this, void 0, void 0, function* () {
382
+ return yield this._getLinks(this.moduleName, this.entityName, productId, 'Product');
383
+ });
384
+ }
385
+ linkProductProducts(productId, productIds) {
386
+ return __awaiter(this, void 0, void 0, function* () {
387
+ const associationDtos = [];
388
+ for (const param of productIds) {
389
+ associationDtos.push({
390
+ entity: 'ProductModule:Product',
391
+ recordId: param.id,
392
+ linkType: 'Product__Product',
393
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
394
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
395
+ });
396
+ }
397
+ return yield this._createLinks(this.moduleName, this.entityName, productId, associationDtos);
398
+ });
399
+ }
400
+ unlinkProductProducts(productId, linkedProductIds) {
401
+ return __awaiter(this, void 0, void 0, function* () {
402
+ const associationDtos = [];
403
+ for (const pk of linkedProductIds) {
404
+ associationDtos.push({
405
+ primaryKey: productId,
406
+ linkedRecordPrimaryKey: pk,
407
+ });
408
+ }
409
+ return yield this._deleteLinks(this.moduleName, this.entityName, productId, associationDtos);
410
+ });
411
+ }
412
+ updateProductProductLinkProperties(productId, dbRecordAssociationId, updateDto) {
413
+ return __awaiter(this, void 0, void 0, function* () {
414
+ return yield this._updateLinkProperties('ProductModule', 'Product', productId, dbRecordAssociationId, updateDto);
415
+ });
416
+ }
379
417
  }
380
418
  exports.ProductDb = ProductDb;
@@ -31,4 +31,11 @@ export declare class RestrictionDb extends DbProvider {
31
31
  relatedAssociationId?: string;
32
32
  }[]): Promise<any>;
33
33
  unlinkProductComponentRestrictions(restrictionId: string, linkedProductComponentIds: string[]): Promise<any>;
34
+ getRestrictions(restrictionId: string): Promise<any>;
35
+ linkRestrictionRestrictions(restrictionId: string, restrictionIds: {
36
+ id: string;
37
+ relationType?: RelationTypeEnum;
38
+ relatedAssociationId?: string;
39
+ }[]): Promise<any>;
40
+ unlinkRestrictionRestrictions(restrictionId: string, linkedRestrictionIds: string[]): Promise<any>;
34
41
  }
@@ -145,5 +145,38 @@ class RestrictionDb extends db_provider_1.DbProvider {
145
145
  return yield this._deleteLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
146
146
  });
147
147
  }
148
+ // Use this function when you want to return a single record
149
+ getRestrictions(restrictionId) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return yield this._getLinks(this.moduleName, this.entityName, restrictionId, 'Restriction');
152
+ });
153
+ }
154
+ linkRestrictionRestrictions(restrictionId, restrictionIds) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ const associationDtos = [];
157
+ for (const param of restrictionIds) {
158
+ associationDtos.push({
159
+ entity: 'ProductModule:Restriction',
160
+ recordId: param.id,
161
+ linkType: 'Restriction__Restriction',
162
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
163
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
164
+ });
165
+ }
166
+ return yield this._createLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
167
+ });
168
+ }
169
+ unlinkRestrictionRestrictions(restrictionId, linkedRestrictionIds) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const associationDtos = [];
172
+ for (const pk of linkedRestrictionIds) {
173
+ associationDtos.push({
174
+ primaryKey: restrictionId,
175
+ linkedRecordPrimaryKey: pk,
176
+ });
177
+ }
178
+ return yield this._deleteLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
179
+ });
180
+ }
148
181
  }
149
182
  exports.RestrictionDb = RestrictionDb;
@@ -24,4 +24,11 @@ export declare class ServiceDb extends DbProvider {
24
24
  relatedAssociationId?: string;
25
25
  }[]): Promise<any>;
26
26
  unlinkProductServices(serviceId: string, linkedProductIds: string[]): Promise<any>;
27
+ getServices(serviceId: string): Promise<any>;
28
+ linkServiceServices(serviceId: string, serviceIds: {
29
+ id: string;
30
+ relationType?: RelationTypeEnum;
31
+ relatedAssociationId?: string;
32
+ }[]): Promise<any>;
33
+ unlinkServiceServices(serviceId: string, linkedServiceIds: string[]): Promise<any>;
27
34
  }
@@ -112,5 +112,38 @@ class ServiceDb extends db_provider_1.DbProvider {
112
112
  return yield this._deleteLinks(this.moduleName, this.entityName, serviceId, associationDtos);
113
113
  });
114
114
  }
115
+ // Use this function when you want to return a single record
116
+ getServices(serviceId) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ return yield this._getLinks(this.moduleName, this.entityName, serviceId, 'Service');
119
+ });
120
+ }
121
+ linkServiceServices(serviceId, serviceIds) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const associationDtos = [];
124
+ for (const param of serviceIds) {
125
+ associationDtos.push({
126
+ entity: 'ServiceModule:Service',
127
+ recordId: param.id,
128
+ linkType: 'Service__Service',
129
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
130
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
131
+ });
132
+ }
133
+ return yield this._createLinks(this.moduleName, this.entityName, serviceId, associationDtos);
134
+ });
135
+ }
136
+ unlinkServiceServices(serviceId, linkedServiceIds) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ const associationDtos = [];
139
+ for (const pk of linkedServiceIds) {
140
+ associationDtos.push({
141
+ primaryKey: serviceId,
142
+ linkedRecordPrimaryKey: pk,
143
+ });
144
+ }
145
+ return yield this._deleteLinks(this.moduleName, this.entityName, serviceId, associationDtos);
146
+ });
147
+ }
115
148
  }
116
149
  exports.ServiceDb = ServiceDb;
@@ -31,6 +31,13 @@ export declare class SplitOrderDb extends DbProvider {
31
31
  relatedAssociationId?: string;
32
32
  }[]): Promise<any>;
33
33
  unlinkSplitOrderOrders(splitOrderId: string, linkedOrderIds: string[]): Promise<any>;
34
+ getSplitOrders(splitOrderId: string): Promise<any>;
35
+ linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {
36
+ id: string;
37
+ relationType?: RelationTypeEnum;
38
+ relatedAssociationId?: string;
39
+ }[]): Promise<any>;
40
+ unlinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderIds: string[]): Promise<any>;
34
41
  linkOrderSplitOrders(splitOrderId: string, orderIds: {
35
42
  id: string;
36
43
  relationType?: RelationTypeEnum;
@@ -145,6 +145,39 @@ class SplitOrderDb extends db_provider_1.DbProvider {
145
145
  return yield this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
146
146
  });
147
147
  }
148
+ // Use this function when you want to return a single record
149
+ getSplitOrders(splitOrderId) {
150
+ return __awaiter(this, void 0, void 0, function* () {
151
+ return yield this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
152
+ });
153
+ }
154
+ linkSplitOrderSplitOrders(splitOrderId, splitOrderIds) {
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ const associationDtos = [];
157
+ for (const param of splitOrderIds) {
158
+ associationDtos.push({
159
+ entity: 'OrderModule:SplitOrder',
160
+ recordId: param.id,
161
+ linkType: 'SplitOrder__SplitOrder',
162
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
163
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
164
+ });
165
+ }
166
+ return yield this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
167
+ });
168
+ }
169
+ unlinkSplitOrderSplitOrders(splitOrderId, linkedSplitOrderIds) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ const associationDtos = [];
172
+ for (const pk of linkedSplitOrderIds) {
173
+ associationDtos.push({
174
+ primaryKey: splitOrderId,
175
+ linkedRecordPrimaryKey: pk,
176
+ });
177
+ }
178
+ return yield this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
179
+ });
180
+ }
148
181
  linkOrderSplitOrders(splitOrderId, orderIds) {
149
182
  return __awaiter(this, void 0, void 0, function* () {
150
183
  const associationDtos = [];
@@ -24,6 +24,13 @@ export declare class TransactionDb extends DbProvider {
24
24
  relatedAssociationId?: string;
25
25
  }[]): Promise<any>;
26
26
  unlinkTransactionPaymentMethods(transactionId: string, linkedPaymentMethodIds: string[]): Promise<any>;
27
+ getTransactions(transactionId: string): Promise<any>;
28
+ linkTransactionTransactions(transactionId: string, transactionIds: {
29
+ id: string;
30
+ relationType?: RelationTypeEnum;
31
+ relatedAssociationId?: string;
32
+ }[]): Promise<any>;
33
+ unlinkTransactionTransactions(transactionId: string, linkedTransactionIds: string[]): Promise<any>;
27
34
  getInvoices(transactionId: string): Promise<any>;
28
35
  linkInvoiceTransactions(transactionId: string, invoiceIds: {
29
36
  id: string;
@@ -113,6 +113,39 @@ class TransactionDb extends db_provider_1.DbProvider {
113
113
  });
114
114
  }
115
115
  // Use this function when you want to return a single record
116
+ getTransactions(transactionId) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ return yield this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
119
+ });
120
+ }
121
+ linkTransactionTransactions(transactionId, transactionIds) {
122
+ return __awaiter(this, void 0, void 0, function* () {
123
+ const associationDtos = [];
124
+ for (const param of transactionIds) {
125
+ associationDtos.push({
126
+ entity: 'BillingModule:Transaction',
127
+ recordId: param.id,
128
+ linkType: 'Transaction__Transaction',
129
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
130
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
131
+ });
132
+ }
133
+ return yield this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
134
+ });
135
+ }
136
+ unlinkTransactionTransactions(transactionId, linkedTransactionIds) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ const associationDtos = [];
139
+ for (const pk of linkedTransactionIds) {
140
+ associationDtos.push({
141
+ primaryKey: transactionId,
142
+ linkedRecordPrimaryKey: pk,
143
+ });
144
+ }
145
+ return yield this._deleteLinks(this.moduleName, this.entityName, transactionId, associationDtos);
146
+ });
147
+ }
148
+ // Use this function when you want to return a single record
116
149
  getInvoices(transactionId) {
117
150
  return __awaiter(this, void 0, void 0, function* () {
118
151
  return yield this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
@@ -150,6 +150,13 @@ export declare class WorkOrderDb extends DbProvider {
150
150
  relatedAssociationId?: string;
151
151
  }[]): Promise<any>;
152
152
  unlinkWorkOrderNetomniaInstallVerifications(workOrderId: string, linkedNetomniaInstallVerificationIds: string[]): Promise<any>;
153
+ getCustomerDeviceOntRemovals(workOrderId: string): Promise<any>;
154
+ linkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, customerDeviceOntRemovalIds: {
155
+ id: string;
156
+ relationType?: RelationTypeEnum;
157
+ relatedAssociationId?: string;
158
+ }[]): Promise<any>;
159
+ unlinkWorkOrderCustomerDeviceOntRemovals(workOrderId: string, linkedCustomerDeviceOntRemovalIds: string[]): Promise<any>;
153
160
  getYfEquipmentCollections(workOrderId: string): Promise<any>;
154
161
  linkWorkOrderYfEquipmentCollections(workOrderId: string, yfEquipmentCollectionIds: {
155
162
  id: string;
@@ -241,6 +248,13 @@ export declare class WorkOrderDb extends DbProvider {
241
248
  relatedAssociationId?: string;
242
249
  }[]): Promise<any>;
243
250
  unlinkWorkOrderOhInstallationAudits(workOrderId: string, linkedOhInstallationAuditIds: string[]): Promise<any>;
251
+ getWorkOrders(workOrderId: string): Promise<any>;
252
+ linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {
253
+ id: string;
254
+ relationType?: RelationTypeEnum;
255
+ relatedAssociationId?: string;
256
+ }[]): Promise<any>;
257
+ unlinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderIds: string[]): Promise<any>;
244
258
  getOhAuditOfInstallations(workOrderId: string): Promise<any>;
245
259
  linkWorkOrderOhAuditOfInstallations(workOrderId: string, ohAuditOfInstallationIds: {
246
260
  id: string;
@@ -707,6 +707,39 @@ class WorkOrderDb extends db_provider_1.DbProvider {
707
707
  });
708
708
  }
709
709
  // Use this function when you want to return a single record
710
+ getCustomerDeviceOntRemovals(workOrderId) {
711
+ return __awaiter(this, void 0, void 0, function* () {
712
+ return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'CustomerDeviceOntRemoval');
713
+ });
714
+ }
715
+ linkWorkOrderCustomerDeviceOntRemovals(workOrderId, customerDeviceOntRemovalIds) {
716
+ return __awaiter(this, void 0, void 0, function* () {
717
+ const associationDtos = [];
718
+ for (const param of customerDeviceOntRemovalIds) {
719
+ associationDtos.push({
720
+ entity: 'ServiceModule:CustomerDeviceOntRemoval',
721
+ recordId: param.id,
722
+ linkType: 'WorkOrder_CustomerDeviceOntRemoval',
723
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
724
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
725
+ });
726
+ }
727
+ return yield this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
728
+ });
729
+ }
730
+ unlinkWorkOrderCustomerDeviceOntRemovals(workOrderId, linkedCustomerDeviceOntRemovalIds) {
731
+ return __awaiter(this, void 0, void 0, function* () {
732
+ const associationDtos = [];
733
+ for (const pk of linkedCustomerDeviceOntRemovalIds) {
734
+ associationDtos.push({
735
+ primaryKey: workOrderId,
736
+ linkedRecordPrimaryKey: pk,
737
+ });
738
+ }
739
+ return yield this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
740
+ });
741
+ }
742
+ // Use this function when you want to return a single record
710
743
  getYfEquipmentCollections(workOrderId) {
711
744
  return __awaiter(this, void 0, void 0, function* () {
712
745
  return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'YfEquipmentCollection');
@@ -1136,6 +1169,39 @@ class WorkOrderDb extends db_provider_1.DbProvider {
1136
1169
  });
1137
1170
  }
1138
1171
  // Use this function when you want to return a single record
1172
+ getWorkOrders(workOrderId) {
1173
+ return __awaiter(this, void 0, void 0, function* () {
1174
+ return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
1175
+ });
1176
+ }
1177
+ linkWorkOrderWorkOrders(workOrderId, workOrderIds) {
1178
+ return __awaiter(this, void 0, void 0, function* () {
1179
+ const associationDtos = [];
1180
+ for (const param of workOrderIds) {
1181
+ associationDtos.push({
1182
+ entity: 'FieldServiceModule:WorkOrder',
1183
+ recordId: param.id,
1184
+ linkType: 'WorkOrder__WorkOrder',
1185
+ relationType: param === null || param === void 0 ? void 0 : param.relationType,
1186
+ relatedAssociationId: param === null || param === void 0 ? void 0 : param.relatedAssociationId
1187
+ });
1188
+ }
1189
+ return yield this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1190
+ });
1191
+ }
1192
+ unlinkWorkOrderWorkOrders(workOrderId, linkedWorkOrderIds) {
1193
+ return __awaiter(this, void 0, void 0, function* () {
1194
+ const associationDtos = [];
1195
+ for (const pk of linkedWorkOrderIds) {
1196
+ associationDtos.push({
1197
+ primaryKey: workOrderId,
1198
+ linkedRecordPrimaryKey: pk,
1199
+ });
1200
+ }
1201
+ return yield this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
1202
+ });
1203
+ }
1204
+ // Use this function when you want to return a single record
1139
1205
  getOhAuditOfInstallations(workOrderId) {
1140
1206
  return __awaiter(this, void 0, void 0, function* () {
1141
1207
  return yield this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",
@@ -11,7 +11,7 @@
11
11
  "typescript": "^5.4.5"
12
12
  },
13
13
  "dependencies": {
14
- "@d19n/odin-sdk-generator": "^1.0.57",
14
+ "@d19n/odin-sdk-generator": "^1.0.59",
15
15
  "@d19n/odin-types": "^1.0.10"
16
16
  },
17
17
  "scripts": {
@@ -101,6 +101,33 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getBillingRequests(billingRequestId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'BillingRequest');
107
+ }
108
+
109
+ public async linkBillingRequestBillingRequests(billingRequestId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of billingRequestIds){
113
+ associationDtos.push({
114
+ entity: 'BillingModule:BillingRequest',
115
+ recordId: param.id,
116
+ linkType: 'BillingRequest__BillingRequest',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
123
+ }
124
+
125
+ public async unLinkBillingRequestBillingRequests(billingRequestId: string, linkedBillingRequestId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, billingRequestId, linkedBillingRequestId);
128
+ }
129
+
130
+
104
131
  // Use this function when you want to return a single record
105
132
  public async getFiles(billingRequestId: string) {
106
133
  return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'File');
@@ -74,6 +74,33 @@
74
74
  }
75
75
 
76
76
 
77
+ // Use this function when you want to return a single record
78
+ public async getCases(caseId: string) {
79
+ return await this._getLinks(this.moduleName, this.entityName, caseId, 'Case');
80
+ }
81
+
82
+ public async linkCaseCases(caseId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
83
+
84
+ const associationDtos = [];
85
+ for(const param of caseIds){
86
+ associationDtos.push({
87
+ entity: 'SupportModule:Case',
88
+ recordId: param.id,
89
+ linkType: 'Case__Case',
90
+ relationType: param?.relationType,
91
+ relatedAssociationId: param?.relatedAssociationId
92
+ });
93
+ }
94
+
95
+ return await this._createLinks(this.moduleName, this.entityName, caseId, associationDtos);
96
+ }
97
+
98
+ public async unLinkCaseCases(caseId: string, linkedCaseId: string) {
99
+
100
+ return await this._deleteLinks(this.moduleName, this.entityName, caseId, linkedCaseId);
101
+ }
102
+
103
+
77
104
  // Use this function when you want to return a single record
78
105
  public async getFiles(caseId: string) {
79
106
  return await this._getLinks(this.moduleName, this.entityName, caseId, 'File');
@@ -101,4 +101,31 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getConsumptionRates(consumptionRateId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, consumptionRateId, 'ConsumptionRate');
107
+ }
108
+
109
+ public async linkConsumptionRateConsumptionRates(consumptionRateId: string, consumptionRateIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of consumptionRateIds){
113
+ associationDtos.push({
114
+ entity: 'ProductModule:ConsumptionRate',
115
+ recordId: param.id,
116
+ linkType: 'ConsumptionRate__ConsumptionRate',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
123
+ }
124
+
125
+ public async unLinkConsumptionRateConsumptionRates(consumptionRateId: string, linkedConsumptionRateId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, consumptionRateId, linkedConsumptionRateId);
128
+ }
129
+
130
+
104
131
  }
@@ -128,4 +128,31 @@
128
128
  }
129
129
 
130
130
 
131
+ // Use this function when you want to return a single record
132
+ public async getConsumptionSchedules(consumptionScheduleId: string) {
133
+ return await this._getLinks(this.moduleName, this.entityName, consumptionScheduleId, 'ConsumptionSchedule');
134
+ }
135
+
136
+ public async linkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, consumptionScheduleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
137
+
138
+ const associationDtos = [];
139
+ for(const param of consumptionScheduleIds){
140
+ associationDtos.push({
141
+ entity: 'ProductModule:ConsumptionSchedule',
142
+ recordId: param.id,
143
+ linkType: 'ConsumptionSchedule__ConsumptionSchedule',
144
+ relationType: param?.relationType,
145
+ relatedAssociationId: param?.relatedAssociationId
146
+ });
147
+ }
148
+
149
+ return await this._createLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
150
+ }
151
+
152
+ public async unLinkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, linkedConsumptionScheduleId: string) {
153
+
154
+ return await this._deleteLinks(this.moduleName, this.entityName, consumptionScheduleId, linkedConsumptionScheduleId);
155
+ }
156
+
157
+
131
158
  }
@@ -425,6 +425,33 @@
425
425
  }
426
426
 
427
427
 
428
+ // Use this function when you want to return a single record
429
+ public async getContacts(contactId: string) {
430
+ return await this._getLinks(this.moduleName, this.entityName, contactId, 'Contact');
431
+ }
432
+
433
+ public async linkContactContacts(contactId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
434
+
435
+ const associationDtos = [];
436
+ for(const param of contactIds){
437
+ associationDtos.push({
438
+ entity: 'CrmModule:Contact',
439
+ recordId: param.id,
440
+ linkType: 'Contact__Contact',
441
+ relationType: param?.relationType,
442
+ relatedAssociationId: param?.relatedAssociationId
443
+ });
444
+ }
445
+
446
+ return await this._createLinks(this.moduleName, this.entityName, contactId, associationDtos);
447
+ }
448
+
449
+ public async unLinkContactContacts(contactId: string, linkedContactId: string) {
450
+
451
+ return await this._deleteLinks(this.moduleName, this.entityName, contactId, linkedContactId);
452
+ }
453
+
454
+
428
455
  // Use this function when you want to return a single record
429
456
  public async getOneTouchSwitchs(contactId: string) {
430
457
  return await this._getLinks(this.moduleName, this.entityName, contactId, 'OneTouchSwitch');
@@ -101,6 +101,33 @@
101
101
  }
102
102
 
103
103
 
104
+ // Use this function when you want to return a single record
105
+ public async getContactIdentitys(contactIdentityId: string) {
106
+ return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'ContactIdentity');
107
+ }
108
+
109
+ public async linkContactIdentityContactIdentitys(contactIdentityId: string, contactIdentityIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
110
+
111
+ const associationDtos = [];
112
+ for(const param of contactIdentityIds){
113
+ associationDtos.push({
114
+ entity: 'CrmModule:ContactIdentity',
115
+ recordId: param.id,
116
+ linkType: 'ContactIdentity__ContactIdentity',
117
+ relationType: param?.relationType,
118
+ relatedAssociationId: param?.relatedAssociationId
119
+ });
120
+ }
121
+
122
+ return await this._createLinks(this.moduleName, this.entityName, contactIdentityId, associationDtos);
123
+ }
124
+
125
+ public async unLinkContactIdentityContactIdentitys(contactIdentityId: string, linkedContactIdentityId: string) {
126
+
127
+ return await this._deleteLinks(this.moduleName, this.entityName, contactIdentityId, linkedContactIdentityId);
128
+ }
129
+
130
+
104
131
  // Use this function when you want to return a single record
105
132
  public async getContacts(contactIdentityId: string) {
106
133
  return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'Contact');