@d19n/youfibre-odin-sdk 1.0.21 → 1.0.22
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.
- package/dist/api-sdk-v1/BillingRequestApi.d.ts +7 -0
- package/dist/api-sdk-v1/BillingRequestApi.js +26 -0
- package/dist/api-sdk-v1/CaseApi.d.ts +7 -0
- package/dist/api-sdk-v1/CaseApi.js +26 -0
- package/dist/api-sdk-v1/ConsumptionRateApi.d.ts +7 -0
- package/dist/api-sdk-v1/ConsumptionRateApi.js +26 -0
- package/dist/api-sdk-v1/ConsumptionScheduleApi.d.ts +7 -0
- package/dist/api-sdk-v1/ConsumptionScheduleApi.js +26 -0
- package/dist/api-sdk-v1/ContactApi.d.ts +7 -0
- package/dist/api-sdk-v1/ContactApi.js +26 -0
- package/dist/api-sdk-v1/ContactIdentityApi.d.ts +7 -0
- package/dist/api-sdk-v1/ContactIdentityApi.js +26 -0
- package/dist/api-sdk-v1/InvoiceItemApi.d.ts +7 -0
- package/dist/api-sdk-v1/InvoiceItemApi.js +26 -0
- package/dist/api-sdk-v1/MilestoneApi.d.ts +7 -0
- package/dist/api-sdk-v1/MilestoneApi.js +26 -0
- package/dist/api-sdk-v1/NoteApi.d.ts +7 -0
- package/dist/api-sdk-v1/NoteApi.js +26 -0
- package/dist/api-sdk-v1/OfferApi.d.ts +7 -0
- package/dist/api-sdk-v1/OfferApi.js +26 -0
- package/dist/api-sdk-v1/OrderApi.d.ts +7 -0
- package/dist/api-sdk-v1/OrderApi.js +26 -0
- package/dist/api-sdk-v1/OrderItemApi.d.ts +7 -0
- package/dist/api-sdk-v1/OrderItemApi.js +26 -0
- package/dist/api-sdk-v1/OrganizationApi.d.ts +7 -0
- package/dist/api-sdk-v1/OrganizationApi.js +26 -0
- package/dist/api-sdk-v1/ProductApi.d.ts +9 -1
- package/dist/api-sdk-v1/ProductApi.js +31 -0
- package/dist/api-sdk-v1/ProductComponentApi.d.ts +7 -0
- package/dist/api-sdk-v1/ProductComponentApi.js +26 -0
- package/dist/api-sdk-v1/RestrictionApi.d.ts +7 -0
- package/dist/api-sdk-v1/RestrictionApi.js +26 -0
- package/dist/api-sdk-v1/ServiceApi.d.ts +7 -0
- package/dist/api-sdk-v1/ServiceApi.js +26 -0
- package/dist/api-sdk-v1/SplitOrderApi.d.ts +7 -0
- package/dist/api-sdk-v1/SplitOrderApi.js +26 -0
- package/dist/api-sdk-v1/TransactionApi.d.ts +7 -0
- package/dist/api-sdk-v1/TransactionApi.js +26 -0
- package/dist/api-sdk-v1/WorkOrderApi.d.ts +7 -0
- package/dist/api-sdk-v1/WorkOrderApi.js +26 -0
- package/dist/db-sdk-v1/BillingRequestDb.d.ts +7 -0
- package/dist/db-sdk-v1/BillingRequestDb.js +33 -0
- package/dist/db-sdk-v1/CaseDb.d.ts +7 -0
- package/dist/db-sdk-v1/CaseDb.js +33 -0
- package/dist/db-sdk-v1/ConsumptionRateDb.d.ts +7 -0
- package/dist/db-sdk-v1/ConsumptionRateDb.js +33 -0
- package/dist/db-sdk-v1/ConsumptionScheduleDb.d.ts +7 -0
- package/dist/db-sdk-v1/ConsumptionScheduleDb.js +33 -0
- package/dist/db-sdk-v1/ContactDb.d.ts +7 -0
- package/dist/db-sdk-v1/ContactDb.js +33 -0
- package/dist/db-sdk-v1/ContactIdentityDb.d.ts +7 -0
- package/dist/db-sdk-v1/ContactIdentityDb.js +33 -0
- package/dist/db-sdk-v1/InvoiceItemDb.d.ts +7 -0
- package/dist/db-sdk-v1/InvoiceItemDb.js +33 -0
- package/dist/db-sdk-v1/MilestoneDb.d.ts +7 -0
- package/dist/db-sdk-v1/MilestoneDb.js +33 -0
- package/dist/db-sdk-v1/NoteDb.d.ts +7 -0
- package/dist/db-sdk-v1/NoteDb.js +33 -0
- package/dist/db-sdk-v1/OfferDb.d.ts +7 -0
- package/dist/db-sdk-v1/OfferDb.js +33 -0
- package/dist/db-sdk-v1/OrderDb.d.ts +7 -0
- package/dist/db-sdk-v1/OrderDb.js +33 -0
- package/dist/db-sdk-v1/OrderItemDb.d.ts +7 -0
- package/dist/db-sdk-v1/OrderItemDb.js +33 -0
- package/dist/db-sdk-v1/OrganizationDb.d.ts +7 -0
- package/dist/db-sdk-v1/OrganizationDb.js +33 -0
- package/dist/db-sdk-v1/ProductComponentDb.d.ts +7 -0
- package/dist/db-sdk-v1/ProductComponentDb.js +33 -0
- package/dist/db-sdk-v1/ProductDb.d.ts +9 -1
- package/dist/db-sdk-v1/ProductDb.js +38 -0
- package/dist/db-sdk-v1/RestrictionDb.d.ts +7 -0
- package/dist/db-sdk-v1/RestrictionDb.js +33 -0
- package/dist/db-sdk-v1/ServiceDb.d.ts +7 -0
- package/dist/db-sdk-v1/ServiceDb.js +33 -0
- package/dist/db-sdk-v1/SplitOrderDb.d.ts +7 -0
- package/dist/db-sdk-v1/SplitOrderDb.js +33 -0
- package/dist/db-sdk-v1/TransactionDb.d.ts +7 -0
- package/dist/db-sdk-v1/TransactionDb.js +33 -0
- package/dist/db-sdk-v1/WorkOrderDb.d.ts +7 -0
- package/dist/db-sdk-v1/WorkOrderDb.js +33 -0
- package/package.json +2 -2
- package/src/api-sdk-v1/BillingRequestApi.ts +27 -0
- package/src/api-sdk-v1/CaseApi.ts +27 -0
- package/src/api-sdk-v1/ConsumptionRateApi.ts +27 -0
- package/src/api-sdk-v1/ConsumptionScheduleApi.ts +27 -0
- package/src/api-sdk-v1/ContactApi.ts +27 -0
- package/src/api-sdk-v1/ContactIdentityApi.ts +27 -0
- package/src/api-sdk-v1/InvoiceItemApi.ts +27 -0
- package/src/api-sdk-v1/MilestoneApi.ts +27 -0
- package/src/api-sdk-v1/NoteApi.ts +27 -0
- package/src/api-sdk-v1/OfferApi.ts +27 -0
- package/src/api-sdk-v1/OrderApi.ts +27 -0
- package/src/api-sdk-v1/OrderItemApi.ts +27 -0
- package/src/api-sdk-v1/OrganizationApi.ts +27 -0
- package/src/api-sdk-v1/ProductApi.ts +31 -0
- package/src/api-sdk-v1/ProductComponentApi.ts +27 -0
- package/src/api-sdk-v1/RestrictionApi.ts +27 -0
- package/src/api-sdk-v1/ServiceApi.ts +27 -0
- package/src/api-sdk-v1/SplitOrderApi.ts +27 -0
- package/src/api-sdk-v1/TransactionApi.ts +27 -0
- package/src/api-sdk-v1/WorkOrderApi.ts +27 -0
- package/src/db-sdk-v1/BillingRequestDb.ts +35 -0
- package/src/db-sdk-v1/CaseDb.ts +35 -0
- package/src/db-sdk-v1/ConsumptionRateDb.ts +35 -0
- package/src/db-sdk-v1/ConsumptionScheduleDb.ts +35 -0
- package/src/db-sdk-v1/ContactDb.ts +35 -0
- package/src/db-sdk-v1/ContactIdentityDb.ts +35 -0
- package/src/db-sdk-v1/InvoiceItemDb.ts +35 -0
- package/src/db-sdk-v1/MilestoneDb.ts +35 -0
- package/src/db-sdk-v1/NoteDb.ts +35 -0
- package/src/db-sdk-v1/OfferDb.ts +35 -0
- package/src/db-sdk-v1/OrderDb.ts +35 -0
- package/src/db-sdk-v1/OrderItemDb.ts +35 -0
- package/src/db-sdk-v1/OrganizationDb.ts +35 -0
- package/src/db-sdk-v1/ProductComponentDb.ts +35 -0
- package/src/db-sdk-v1/ProductDb.ts +39 -0
- package/src/db-sdk-v1/RestrictionDb.ts +35 -0
- package/src/db-sdk-v1/ServiceDb.ts +35 -0
- package/src/db-sdk-v1/SplitOrderDb.ts +35 -0
- package/src/db-sdk-v1/TransactionDb.ts +35 -0
- package/src/db-sdk-v1/WorkOrderDb.ts +35 -0
|
@@ -484,6 +484,41 @@
|
|
|
484
484
|
}
|
|
485
485
|
|
|
486
486
|
|
|
487
|
+
// Use this function when you want to return a single record
|
|
488
|
+
public async getOrderItems(orderItemId: string) {
|
|
489
|
+
return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'OrderItem');
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
public async linkOrderItemOrderItems(orderItemId: string, orderItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
493
|
+
|
|
494
|
+
const associationDtos = [];
|
|
495
|
+
for(const param of orderItemIds){
|
|
496
|
+
associationDtos.push({
|
|
497
|
+
entity: 'OrderModule:OrderItem',
|
|
498
|
+
recordId: param.id,
|
|
499
|
+
linkType: 'OrderItem__OrderItem',
|
|
500
|
+
relationType: param?.relationType,
|
|
501
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
return await this._createLinks(this.moduleName, this.entityName, orderItemId, associationDtos);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
public async unlinkOrderItemOrderItems(orderItemId: string, linkedOrderItemIds: string[]) {
|
|
509
|
+
|
|
510
|
+
const associationDtos = [];
|
|
511
|
+
for(const pk of linkedOrderItemIds){
|
|
512
|
+
associationDtos.push({
|
|
513
|
+
primaryKey: orderItemId,
|
|
514
|
+
linkedRecordPrimaryKey: pk,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
return await this._deleteLinks(this.moduleName, this.entityName, orderItemId, associationDtos);
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
|
|
487
522
|
// Use this function when you want to return a single record
|
|
488
523
|
public async getVoiceConfigurations(orderItemId: string) {
|
|
489
524
|
return await this._getLinks(this.moduleName, this.entityName, orderItemId, 'VoiceConfiguration');
|
|
@@ -169,4 +169,39 @@
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
|
|
172
|
+
// Use this function when you want to return a single record
|
|
173
|
+
public async getOrganizations(organizationId: string) {
|
|
174
|
+
return await this._getLinks(this.moduleName, this.entityName, organizationId, 'Organization');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
public async linkOrganizationOrganizations(organizationId: string, organizationIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
178
|
+
|
|
179
|
+
const associationDtos = [];
|
|
180
|
+
for(const param of organizationIds){
|
|
181
|
+
associationDtos.push({
|
|
182
|
+
entity: 'CrmModule:Organization',
|
|
183
|
+
recordId: param.id,
|
|
184
|
+
linkType: 'Organization__Organization',
|
|
185
|
+
relationType: param?.relationType,
|
|
186
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return await this._createLinks(this.moduleName, this.entityName, organizationId, associationDtos);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public async unlinkOrganizationOrganizations(organizationId: string, linkedOrganizationIds: string[]) {
|
|
194
|
+
|
|
195
|
+
const associationDtos = [];
|
|
196
|
+
for(const pk of linkedOrganizationIds){
|
|
197
|
+
associationDtos.push({
|
|
198
|
+
primaryKey: organizationId,
|
|
199
|
+
linkedRecordPrimaryKey: pk,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return await this._deleteLinks(this.moduleName, this.entityName, organizationId, associationDtos);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
172
207
|
}
|
|
@@ -134,4 +134,39 @@
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
// Use this function when you want to return a single record
|
|
138
|
+
public async getProductComponents(productComponentId: string) {
|
|
139
|
+
return await this._getLinks(this.moduleName, this.entityName, productComponentId, 'ProductComponent');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public async linkProductComponentProductComponents(productComponentId: string, productComponentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
143
|
+
|
|
144
|
+
const associationDtos = [];
|
|
145
|
+
for(const param of productComponentIds){
|
|
146
|
+
associationDtos.push({
|
|
147
|
+
entity: 'ProductModule:ProductComponent',
|
|
148
|
+
recordId: param.id,
|
|
149
|
+
linkType: 'ProductComponent__ProductComponent',
|
|
150
|
+
relationType: param?.relationType,
|
|
151
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return await this._createLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public async unlinkProductComponentProductComponents(productComponentId: string, linkedProductComponentIds: string[]) {
|
|
159
|
+
|
|
160
|
+
const associationDtos = [];
|
|
161
|
+
for(const pk of linkedProductComponentIds){
|
|
162
|
+
associationDtos.push({
|
|
163
|
+
primaryKey: productComponentId,
|
|
164
|
+
linkedRecordPrimaryKey: pk,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return await this._deleteLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
137
172
|
}
|
|
@@ -379,4 +379,43 @@
|
|
|
379
379
|
}
|
|
380
380
|
|
|
381
381
|
|
|
382
|
+
// Use this function when you want to return a single record
|
|
383
|
+
public async getProducts(productId: string) {
|
|
384
|
+
return await this._getLinks(this.moduleName, this.entityName, productId, 'Product');
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
public async linkProductProducts(productId: string, productIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
388
|
+
|
|
389
|
+
const associationDtos = [];
|
|
390
|
+
for(const param of productIds){
|
|
391
|
+
associationDtos.push({
|
|
392
|
+
entity: 'ProductModule:Product',
|
|
393
|
+
recordId: param.id,
|
|
394
|
+
linkType: 'Product__Product',
|
|
395
|
+
relationType: param?.relationType,
|
|
396
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
return await this._createLinks(this.moduleName, this.entityName, productId, associationDtos);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
public async unlinkProductProducts(productId: string, linkedProductIds: string[]) {
|
|
404
|
+
|
|
405
|
+
const associationDtos = [];
|
|
406
|
+
for(const pk of linkedProductIds){
|
|
407
|
+
associationDtos.push({
|
|
408
|
+
primaryKey: productId,
|
|
409
|
+
linkedRecordPrimaryKey: pk,
|
|
410
|
+
});
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return await this._deleteLinks(this.moduleName, this.entityName, productId, associationDtos);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
|
|
417
|
+
public async updateProductProductLinkProperties(productId: string, dbRecordAssociationId: string, updateDto: OdinLinkedRecordUpdateDto) {
|
|
418
|
+
|
|
419
|
+
return await this._updateLinkProperties('ProductModule', 'Product', productId, dbRecordAssociationId, updateDto);
|
|
420
|
+
}
|
|
382
421
|
}
|
|
@@ -134,4 +134,39 @@
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
|
|
137
|
+
// Use this function when you want to return a single record
|
|
138
|
+
public async getRestrictions(restrictionId: string) {
|
|
139
|
+
return await this._getLinks(this.moduleName, this.entityName, restrictionId, 'Restriction');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public async linkRestrictionRestrictions(restrictionId: string, restrictionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
143
|
+
|
|
144
|
+
const associationDtos = [];
|
|
145
|
+
for(const param of restrictionIds){
|
|
146
|
+
associationDtos.push({
|
|
147
|
+
entity: 'ProductModule:Restriction',
|
|
148
|
+
recordId: param.id,
|
|
149
|
+
linkType: 'Restriction__Restriction',
|
|
150
|
+
relationType: param?.relationType,
|
|
151
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return await this._createLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public async unlinkRestrictionRestrictions(restrictionId: string, linkedRestrictionIds: string[]) {
|
|
159
|
+
|
|
160
|
+
const associationDtos = [];
|
|
161
|
+
for(const pk of linkedRestrictionIds){
|
|
162
|
+
associationDtos.push({
|
|
163
|
+
primaryKey: restrictionId,
|
|
164
|
+
linkedRecordPrimaryKey: pk,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return await this._deleteLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
137
172
|
}
|
|
@@ -99,4 +99,39 @@
|
|
|
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
|
+
|
|
102
137
|
}
|
|
@@ -134,6 +134,41 @@
|
|
|
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
|
+
}
|
|
154
|
+
|
|
155
|
+
return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public async unlinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderIds: string[]) {
|
|
159
|
+
|
|
160
|
+
const associationDtos = [];
|
|
161
|
+
for(const pk of linkedSplitOrderIds){
|
|
162
|
+
associationDtos.push({
|
|
163
|
+
primaryKey: splitOrderId,
|
|
164
|
+
linkedRecordPrimaryKey: pk,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
137
172
|
public async linkOrderSplitOrders(splitOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
138
173
|
|
|
139
174
|
const associationDtos = [];
|
|
@@ -99,6 +99,41 @@
|
|
|
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
|
+
|
|
102
137
|
// Use this function when you want to return a single record
|
|
103
138
|
public async getInvoices(transactionId: string) {
|
|
104
139
|
return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
|
|
@@ -1184,6 +1184,41 @@
|
|
|
1184
1184
|
}
|
|
1185
1185
|
|
|
1186
1186
|
|
|
1187
|
+
// Use this function when you want to return a single record
|
|
1188
|
+
public async getWorkOrders(workOrderId: string) {
|
|
1189
|
+
return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
public async linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
1193
|
+
|
|
1194
|
+
const associationDtos = [];
|
|
1195
|
+
for(const param of workOrderIds){
|
|
1196
|
+
associationDtos.push({
|
|
1197
|
+
entity: 'FieldServiceModule:WorkOrder',
|
|
1198
|
+
recordId: param.id,
|
|
1199
|
+
linkType: 'WorkOrder__WorkOrder',
|
|
1200
|
+
relationType: param?.relationType,
|
|
1201
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
1202
|
+
});
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1205
|
+
return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
public async unlinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderIds: string[]) {
|
|
1209
|
+
|
|
1210
|
+
const associationDtos = [];
|
|
1211
|
+
for(const pk of linkedWorkOrderIds){
|
|
1212
|
+
associationDtos.push({
|
|
1213
|
+
primaryKey: workOrderId,
|
|
1214
|
+
linkedRecordPrimaryKey: pk,
|
|
1215
|
+
});
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
|
|
1187
1222
|
// Use this function when you want to return a single record
|
|
1188
1223
|
public async getOhAuditOfInstallations(workOrderId: string) {
|
|
1189
1224
|
return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');
|