@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
|
@@ -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 getProductComponents(productComponentId: string) {
|
|
133
|
+
return await this._getLinks(this.moduleName, this.entityName, productComponentId, 'ProductComponent');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public async linkProductComponentProductComponents(productComponentId: string, productComponentIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
137
|
+
|
|
138
|
+
const associationDtos = [];
|
|
139
|
+
for(const param of productComponentIds){
|
|
140
|
+
associationDtos.push({
|
|
141
|
+
entity: 'ProductModule:ProductComponent',
|
|
142
|
+
recordId: param.id,
|
|
143
|
+
linkType: 'ProductComponent__ProductComponent',
|
|
144
|
+
relationType: param?.relationType,
|
|
145
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return await this._createLinks(this.moduleName, this.entityName, productComponentId, associationDtos);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public async unLinkProductComponentProductComponents(productComponentId: string, linkedProductComponentId: string) {
|
|
153
|
+
|
|
154
|
+
return await this._deleteLinks(this.moduleName, this.entityName, productComponentId, linkedProductComponentId);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
131
158
|
}
|
|
@@ -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 getRestrictions(restrictionId: string) {
|
|
133
|
+
return await this._getLinks(this.moduleName, this.entityName, restrictionId, 'Restriction');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public async linkRestrictionRestrictions(restrictionId: string, restrictionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
137
|
+
|
|
138
|
+
const associationDtos = [];
|
|
139
|
+
for(const param of restrictionIds){
|
|
140
|
+
associationDtos.push({
|
|
141
|
+
entity: 'ProductModule:Restriction',
|
|
142
|
+
recordId: param.id,
|
|
143
|
+
linkType: 'Restriction__Restriction',
|
|
144
|
+
relationType: param?.relationType,
|
|
145
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return await this._createLinks(this.moduleName, this.entityName, restrictionId, associationDtos);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public async unLinkRestrictionRestrictions(restrictionId: string, linkedRestrictionId: string) {
|
|
153
|
+
|
|
154
|
+
return await this._deleteLinks(this.moduleName, this.entityName, restrictionId, linkedRestrictionId);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
131
158
|
}
|
|
@@ -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 getServices(serviceId: string) {
|
|
106
|
+
return await this._getLinks(this.moduleName, this.entityName, serviceId, 'Service');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public async linkServiceServices(serviceId: string, serviceIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
110
|
+
|
|
111
|
+
const associationDtos = [];
|
|
112
|
+
for(const param of serviceIds){
|
|
113
|
+
associationDtos.push({
|
|
114
|
+
entity: 'ServiceModule:Service',
|
|
115
|
+
recordId: param.id,
|
|
116
|
+
linkType: 'Service__Service',
|
|
117
|
+
relationType: param?.relationType,
|
|
118
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return await this._createLinks(this.moduleName, this.entityName, serviceId, associationDtos);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public async unLinkServiceServices(serviceId: string, linkedServiceId: string) {
|
|
126
|
+
|
|
127
|
+
return await this._deleteLinks(this.moduleName, this.entityName, serviceId, linkedServiceId);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
104
131
|
}
|
|
@@ -128,6 +128,33 @@
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
|
|
131
|
+
// Use this function when you want to return a single record
|
|
132
|
+
public async getSplitOrders(splitOrderId: string) {
|
|
133
|
+
return await this._getLinks(this.moduleName, this.entityName, splitOrderId, 'SplitOrder');
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public async linkSplitOrderSplitOrders(splitOrderId: string, splitOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
137
|
+
|
|
138
|
+
const associationDtos = [];
|
|
139
|
+
for(const param of splitOrderIds){
|
|
140
|
+
associationDtos.push({
|
|
141
|
+
entity: 'OrderModule:SplitOrder',
|
|
142
|
+
recordId: param.id,
|
|
143
|
+
linkType: 'SplitOrder__SplitOrder',
|
|
144
|
+
relationType: param?.relationType,
|
|
145
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return await this._createLinks(this.moduleName, this.entityName, splitOrderId, associationDtos);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public async unLinkSplitOrderSplitOrders(splitOrderId: string, linkedSplitOrderId: string) {
|
|
153
|
+
|
|
154
|
+
return await this._deleteLinks(this.moduleName, this.entityName, splitOrderId, linkedSplitOrderId);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
131
158
|
public async linkOrderSplitOrders(splitOrderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
132
159
|
|
|
133
160
|
const associationDtos = [];
|
|
@@ -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 getTransactions(transactionId: string) {
|
|
106
|
+
return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Transaction');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public async linkTransactionTransactions(transactionId: string, transactionIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
110
|
+
|
|
111
|
+
const associationDtos = [];
|
|
112
|
+
for(const param of transactionIds){
|
|
113
|
+
associationDtos.push({
|
|
114
|
+
entity: 'BillingModule:Transaction',
|
|
115
|
+
recordId: param.id,
|
|
116
|
+
linkType: 'Transaction__Transaction',
|
|
117
|
+
relationType: param?.relationType,
|
|
118
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return await this._createLinks(this.moduleName, this.entityName, transactionId, associationDtos);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
public async unLinkTransactionTransactions(transactionId: string, linkedTransactionId: string) {
|
|
126
|
+
|
|
127
|
+
return await this._deleteLinks(this.moduleName, this.entityName, transactionId, linkedTransactionId);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
|
|
104
131
|
// Use this function when you want to return a single record
|
|
105
132
|
public async getInvoices(transactionId: string) {
|
|
106
133
|
return await this._getLinks(this.moduleName, this.entityName, transactionId, 'Invoice');
|
|
@@ -938,6 +938,33 @@
|
|
|
938
938
|
}
|
|
939
939
|
|
|
940
940
|
|
|
941
|
+
// Use this function when you want to return a single record
|
|
942
|
+
public async getWorkOrders(workOrderId: string) {
|
|
943
|
+
return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'WorkOrder');
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
public async linkWorkOrderWorkOrders(workOrderId: string, workOrderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
947
|
+
|
|
948
|
+
const associationDtos = [];
|
|
949
|
+
for(const param of workOrderIds){
|
|
950
|
+
associationDtos.push({
|
|
951
|
+
entity: 'FieldServiceModule:WorkOrder',
|
|
952
|
+
recordId: param.id,
|
|
953
|
+
linkType: 'WorkOrder__WorkOrder',
|
|
954
|
+
relationType: param?.relationType,
|
|
955
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
956
|
+
});
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
return await this._createLinks(this.moduleName, this.entityName, workOrderId, associationDtos);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
public async unLinkWorkOrderWorkOrders(workOrderId: string, linkedWorkOrderId: string) {
|
|
963
|
+
|
|
964
|
+
return await this._deleteLinks(this.moduleName, this.entityName, workOrderId, linkedWorkOrderId);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
|
|
941
968
|
// Use this function when you want to return a single record
|
|
942
969
|
public async getOhAuditOfInstallations(workOrderId: string) {
|
|
943
970
|
return await this._getLinks(this.moduleName, this.entityName, workOrderId, 'OhAuditOfInstallation');
|
|
@@ -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 getBillingRequests(billingRequestId: string) {
|
|
104
|
+
return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'BillingRequest');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public async linkBillingRequestBillingRequests(billingRequestId: string, billingRequestIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
108
|
+
|
|
109
|
+
const associationDtos = [];
|
|
110
|
+
for(const param of billingRequestIds){
|
|
111
|
+
associationDtos.push({
|
|
112
|
+
entity: 'BillingModule:BillingRequest',
|
|
113
|
+
recordId: param.id,
|
|
114
|
+
linkType: 'BillingRequest__BillingRequest',
|
|
115
|
+
relationType: param?.relationType,
|
|
116
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return await this._createLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public async unlinkBillingRequestBillingRequests(billingRequestId: string, linkedBillingRequestIds: string[]) {
|
|
124
|
+
|
|
125
|
+
const associationDtos = [];
|
|
126
|
+
for(const pk of linkedBillingRequestIds){
|
|
127
|
+
associationDtos.push({
|
|
128
|
+
primaryKey: billingRequestId,
|
|
129
|
+
linkedRecordPrimaryKey: pk,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return await this._deleteLinks(this.moduleName, this.entityName, billingRequestId, associationDtos);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
102
137
|
// Use this function when you want to return a single record
|
|
103
138
|
public async getFiles(billingRequestId: string) {
|
|
104
139
|
return await this._getLinks(this.moduleName, this.entityName, billingRequestId, 'File');
|
package/src/db-sdk-v1/CaseDb.ts
CHANGED
|
@@ -64,6 +64,41 @@
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
// Use this function when you want to return a single record
|
|
68
|
+
public async getCases(caseId: string) {
|
|
69
|
+
return await this._getLinks(this.moduleName, this.entityName, caseId, 'Case');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
public async linkCaseCases(caseId: string, caseIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
73
|
+
|
|
74
|
+
const associationDtos = [];
|
|
75
|
+
for(const param of caseIds){
|
|
76
|
+
associationDtos.push({
|
|
77
|
+
entity: 'SupportModule:Case',
|
|
78
|
+
recordId: param.id,
|
|
79
|
+
linkType: 'Case__Case',
|
|
80
|
+
relationType: param?.relationType,
|
|
81
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return await this._createLinks(this.moduleName, this.entityName, caseId, associationDtos);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
public async unlinkCaseCases(caseId: string, linkedCaseIds: string[]) {
|
|
89
|
+
|
|
90
|
+
const associationDtos = [];
|
|
91
|
+
for(const pk of linkedCaseIds){
|
|
92
|
+
associationDtos.push({
|
|
93
|
+
primaryKey: caseId,
|
|
94
|
+
linkedRecordPrimaryKey: pk,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return await this._deleteLinks(this.moduleName, this.entityName, caseId, associationDtos);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
67
102
|
// Use this function when you want to return a single record
|
|
68
103
|
public async getFiles(caseId: string) {
|
|
69
104
|
return await this._getLinks(this.moduleName, this.entityName, caseId, 'File');
|
|
@@ -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 getConsumptionRates(consumptionRateId: string) {
|
|
104
|
+
return await this._getLinks(this.moduleName, this.entityName, consumptionRateId, 'ConsumptionRate');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public async linkConsumptionRateConsumptionRates(consumptionRateId: string, consumptionRateIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
108
|
+
|
|
109
|
+
const associationDtos = [];
|
|
110
|
+
for(const param of consumptionRateIds){
|
|
111
|
+
associationDtos.push({
|
|
112
|
+
entity: 'ProductModule:ConsumptionRate',
|
|
113
|
+
recordId: param.id,
|
|
114
|
+
linkType: 'ConsumptionRate__ConsumptionRate',
|
|
115
|
+
relationType: param?.relationType,
|
|
116
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return await this._createLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public async unlinkConsumptionRateConsumptionRates(consumptionRateId: string, linkedConsumptionRateIds: string[]) {
|
|
124
|
+
|
|
125
|
+
const associationDtos = [];
|
|
126
|
+
for(const pk of linkedConsumptionRateIds){
|
|
127
|
+
associationDtos.push({
|
|
128
|
+
primaryKey: consumptionRateId,
|
|
129
|
+
linkedRecordPrimaryKey: pk,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return await this._deleteLinks(this.moduleName, this.entityName, consumptionRateId, associationDtos);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
|
|
102
137
|
}
|
|
@@ -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 getConsumptionSchedules(consumptionScheduleId: string) {
|
|
139
|
+
return await this._getLinks(this.moduleName, this.entityName, consumptionScheduleId, 'ConsumptionSchedule');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public async linkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, consumptionScheduleIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
143
|
+
|
|
144
|
+
const associationDtos = [];
|
|
145
|
+
for(const param of consumptionScheduleIds){
|
|
146
|
+
associationDtos.push({
|
|
147
|
+
entity: 'ProductModule:ConsumptionSchedule',
|
|
148
|
+
recordId: param.id,
|
|
149
|
+
linkType: 'ConsumptionSchedule__ConsumptionSchedule',
|
|
150
|
+
relationType: param?.relationType,
|
|
151
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return await this._createLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public async unlinkConsumptionScheduleConsumptionSchedules(consumptionScheduleId: string, linkedConsumptionScheduleIds: string[]) {
|
|
159
|
+
|
|
160
|
+
const associationDtos = [];
|
|
161
|
+
for(const pk of linkedConsumptionScheduleIds){
|
|
162
|
+
associationDtos.push({
|
|
163
|
+
primaryKey: consumptionScheduleId,
|
|
164
|
+
linkedRecordPrimaryKey: pk,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return await this._deleteLinks(this.moduleName, this.entityName, consumptionScheduleId, associationDtos);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
137
172
|
}
|
|
@@ -519,6 +519,41 @@
|
|
|
519
519
|
}
|
|
520
520
|
|
|
521
521
|
|
|
522
|
+
// Use this function when you want to return a single record
|
|
523
|
+
public async getContacts(contactId: string) {
|
|
524
|
+
return await this._getLinks(this.moduleName, this.entityName, contactId, 'Contact');
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
public async linkContactContacts(contactId: string, contactIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
528
|
+
|
|
529
|
+
const associationDtos = [];
|
|
530
|
+
for(const param of contactIds){
|
|
531
|
+
associationDtos.push({
|
|
532
|
+
entity: 'CrmModule:Contact',
|
|
533
|
+
recordId: param.id,
|
|
534
|
+
linkType: 'Contact__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 unlinkContactContacts(contactId: string, linkedContactIds: string[]) {
|
|
544
|
+
|
|
545
|
+
const associationDtos = [];
|
|
546
|
+
for(const pk of linkedContactIds){
|
|
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
|
+
|
|
522
557
|
// Use this function when you want to return a single record
|
|
523
558
|
public async getOneTouchSwitchs(contactId: string) {
|
|
524
559
|
return await this._getLinks(this.moduleName, this.entityName, contactId, 'OneTouchSwitch');
|
|
@@ -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 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
|
+
|
|
102
137
|
// Use this function when you want to return a single record
|
|
103
138
|
public async getContacts(contactIdentityId: string) {
|
|
104
139
|
return await this._getLinks(this.moduleName, this.entityName, contactIdentityId, 'Contact');
|
|
@@ -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 getInvoiceItems(invoiceItemId: string) {
|
|
104
|
+
return await this._getLinks(this.moduleName, this.entityName, invoiceItemId, 'InvoiceItem');
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public async linkInvoiceItemInvoiceItems(invoiceItemId: string, invoiceItemIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
108
|
+
|
|
109
|
+
const associationDtos = [];
|
|
110
|
+
for(const param of invoiceItemIds){
|
|
111
|
+
associationDtos.push({
|
|
112
|
+
entity: 'BillingModule:InvoiceItem',
|
|
113
|
+
recordId: param.id,
|
|
114
|
+
linkType: 'InvoiceItem__InvoiceItem',
|
|
115
|
+
relationType: param?.relationType,
|
|
116
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return await this._createLinks(this.moduleName, this.entityName, invoiceItemId, associationDtos);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
public async unlinkInvoiceItemInvoiceItems(invoiceItemId: string, linkedInvoiceItemIds: string[]) {
|
|
124
|
+
|
|
125
|
+
const associationDtos = [];
|
|
126
|
+
for(const pk of linkedInvoiceItemIds){
|
|
127
|
+
associationDtos.push({
|
|
128
|
+
primaryKey: invoiceItemId,
|
|
129
|
+
linkedRecordPrimaryKey: pk,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return await this._deleteLinks(this.moduleName, this.entityName, invoiceItemId, 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 getMilestones(milestoneId: string) {
|
|
139
|
+
return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Milestone');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
public async linkMilestoneMilestones(milestoneId: string, milestoneIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
143
|
+
|
|
144
|
+
const associationDtos = [];
|
|
145
|
+
for(const param of milestoneIds){
|
|
146
|
+
associationDtos.push({
|
|
147
|
+
entity: 'ProjectModule:Milestone',
|
|
148
|
+
recordId: param.id,
|
|
149
|
+
linkType: 'Milestone__Milestone',
|
|
150
|
+
relationType: param?.relationType,
|
|
151
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
return await this._createLinks(this.moduleName, this.entityName, milestoneId, associationDtos);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
public async unlinkMilestoneMilestones(milestoneId: string, linkedMilestoneIds: string[]) {
|
|
159
|
+
|
|
160
|
+
const associationDtos = [];
|
|
161
|
+
for(const pk of linkedMilestoneIds){
|
|
162
|
+
associationDtos.push({
|
|
163
|
+
primaryKey: milestoneId,
|
|
164
|
+
linkedRecordPrimaryKey: pk,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return await this._deleteLinks(this.moduleName, this.entityName, milestoneId, associationDtos);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
|
|
137
172
|
// Use this function when you want to return a single record
|
|
138
173
|
public async getNotes(milestoneId: string) {
|
|
139
174
|
return await this._getLinks(this.moduleName, this.entityName, milestoneId, 'Note');
|
package/src/db-sdk-v1/NoteDb.ts
CHANGED
|
@@ -1709,6 +1709,41 @@
|
|
|
1709
1709
|
}
|
|
1710
1710
|
|
|
1711
1711
|
|
|
1712
|
+
// Use this function when you want to return a single record
|
|
1713
|
+
public async getNotes(noteId: string) {
|
|
1714
|
+
return await this._getLinks(this.moduleName, this.entityName, noteId, 'Note');
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1717
|
+
public async linkNoteNotes(noteId: string, noteIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
1718
|
+
|
|
1719
|
+
const associationDtos = [];
|
|
1720
|
+
for(const param of noteIds){
|
|
1721
|
+
associationDtos.push({
|
|
1722
|
+
entity: 'SupportModule:Note',
|
|
1723
|
+
recordId: param.id,
|
|
1724
|
+
linkType: 'Note__Note',
|
|
1725
|
+
relationType: param?.relationType,
|
|
1726
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
1727
|
+
});
|
|
1728
|
+
}
|
|
1729
|
+
|
|
1730
|
+
return await this._createLinks(this.moduleName, this.entityName, noteId, associationDtos);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
public async unlinkNoteNotes(noteId: string, linkedNoteIds: string[]) {
|
|
1734
|
+
|
|
1735
|
+
const associationDtos = [];
|
|
1736
|
+
for(const pk of linkedNoteIds){
|
|
1737
|
+
associationDtos.push({
|
|
1738
|
+
primaryKey: noteId,
|
|
1739
|
+
linkedRecordPrimaryKey: pk,
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
return await this._deleteLinks(this.moduleName, this.entityName, noteId, associationDtos);
|
|
1744
|
+
}
|
|
1745
|
+
|
|
1746
|
+
|
|
1712
1747
|
public async linkNoteFiles(noteId: string, fileIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
1713
1748
|
|
|
1714
1749
|
const associationDtos = [];
|
package/src/db-sdk-v1/OfferDb.ts
CHANGED
|
@@ -169,6 +169,41 @@
|
|
|
169
169
|
}
|
|
170
170
|
|
|
171
171
|
|
|
172
|
+
// Use this function when you want to return a single record
|
|
173
|
+
public async getOffers(offerId: string) {
|
|
174
|
+
return await this._getLinks(this.moduleName, this.entityName, offerId, 'Offer');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
public async linkOfferOffers(offerId: string, offerIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
178
|
+
|
|
179
|
+
const associationDtos = [];
|
|
180
|
+
for(const param of offerIds){
|
|
181
|
+
associationDtos.push({
|
|
182
|
+
entity: 'ProductModule:Offer',
|
|
183
|
+
recordId: param.id,
|
|
184
|
+
linkType: 'Offer__Offer',
|
|
185
|
+
relationType: param?.relationType,
|
|
186
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return await this._createLinks(this.moduleName, this.entityName, offerId, associationDtos);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
public async unlinkOfferOffers(offerId: string, linkedOfferIds: string[]) {
|
|
194
|
+
|
|
195
|
+
const associationDtos = [];
|
|
196
|
+
for(const pk of linkedOfferIds){
|
|
197
|
+
associationDtos.push({
|
|
198
|
+
primaryKey: offerId,
|
|
199
|
+
linkedRecordPrimaryKey: pk,
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return await this._deleteLinks(this.moduleName, this.entityName, offerId, associationDtos);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
|
|
172
207
|
// Use this function when you want to return a single record
|
|
173
208
|
public async getDiscounts(offerId: string) {
|
|
174
209
|
return await this._getLinks(this.moduleName, this.entityName, offerId, 'Discount');
|
package/src/db-sdk-v1/OrderDb.ts
CHANGED
|
@@ -558,6 +558,41 @@
|
|
|
558
558
|
}
|
|
559
559
|
|
|
560
560
|
|
|
561
|
+
// Use this function when you want to return a single record
|
|
562
|
+
public async getOrders(orderId: string) {
|
|
563
|
+
return await this._getLinks(this.moduleName, this.entityName, orderId, 'Order');
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
public async linkOrderOrders(orderId: string, orderIds: {id: string, relationType?: RelationTypeEnum, relatedAssociationId?: string}[]) {
|
|
567
|
+
|
|
568
|
+
const associationDtos = [];
|
|
569
|
+
for(const param of orderIds){
|
|
570
|
+
associationDtos.push({
|
|
571
|
+
entity: 'OrderModule:Order',
|
|
572
|
+
recordId: param.id,
|
|
573
|
+
linkType: 'Order__Order',
|
|
574
|
+
relationType: param?.relationType,
|
|
575
|
+
relatedAssociationId: param?.relatedAssociationId
|
|
576
|
+
});
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
return await this._createLinks(this.moduleName, this.entityName, orderId, associationDtos);
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
public async unlinkOrderOrders(orderId: string, linkedOrderIds: string[]) {
|
|
583
|
+
|
|
584
|
+
const associationDtos = [];
|
|
585
|
+
for(const pk of linkedOrderIds){
|
|
586
|
+
associationDtos.push({
|
|
587
|
+
primaryKey: orderId,
|
|
588
|
+
linkedRecordPrimaryKey: pk,
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return await this._deleteLinks(this.moduleName, this.entityName, orderId, associationDtos);
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
|
|
561
596
|
// Use this function when you want to return a single record
|
|
562
597
|
public async getPicRequests(orderId: string) {
|
|
563
598
|
return await this._getLinks(this.moduleName, this.entityName, orderId, 'PICRequest');
|