@d19n/youfibre-odin-sdk 2.0.378 → 2.0.379
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/README.md +2 -1
- package/dist/api-sdk-v2/AccountApi.d.ts +2 -0
- package/dist/api-sdk-v2/AccountApi.js +6 -0
- package/dist/api-sdk-v2/ContractApi.d.ts +52 -0
- package/dist/api-sdk-v2/ContractApi.js +167 -0
- package/dist/api-sdk-v2/OrderApi.d.ts +2 -0
- package/dist/api-sdk-v2/OrderApi.js +6 -0
- package/dist/api-sdk-v2/RecontractApi.d.ts +2 -0
- package/dist/api-sdk-v2/RecontractApi.js +6 -0
- package/dist/db-sdk-v2/AccountDb.d.ts +2 -0
- package/dist/db-sdk-v2/AccountDb.js +6 -0
- package/dist/db-sdk-v2/ContractDb.d.ts +124 -0
- package/dist/db-sdk-v2/ContractDb.js +216 -0
- package/dist/db-sdk-v2/OrderDb.d.ts +2 -0
- package/dist/db-sdk-v2/OrderDb.js +6 -0
- package/dist/db-sdk-v2/RecontractDb.d.ts +2 -0
- package/dist/db-sdk-v2/RecontractDb.js +6 -0
- package/dist/entities-v2/Account.d.ts +3 -0
- package/dist/entities-v2/Contract.d.ts +299 -0
- package/dist/entities-v2/Contract.js +198 -0
- package/dist/entities-v2/DocumentProcessing.d.ts +3 -1
- package/dist/entities-v2/DocumentProcessing.js +2 -0
- package/dist/entities-v2/Lead.d.ts +2 -0
- package/dist/entities-v2/Lead.js +2 -0
- package/dist/entities-v2/Order.d.ts +3 -0
- package/dist/entities-v2/Recontract.d.ts +16 -1
- package/dist/entities-v2/Recontract.js +7 -1
- package/dist/entities-v2/VoiceConfiguration.d.ts +130 -130
- package/dist/entities-v2/VoiceConfiguration.js +46 -46
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -124,7 +124,7 @@ await workOrder.completeWorkOrder({ ... });
|
|
|
124
124
|
|
|
125
125
|
## Entities
|
|
126
126
|
|
|
127
|
-
This SDK includes **
|
|
127
|
+
This SDK includes **208** entities across **13** modules.
|
|
128
128
|
|
|
129
129
|
### CrmModule
|
|
130
130
|
|
|
@@ -247,6 +247,7 @@ This SDK includes **207** entities across **13** modules.
|
|
|
247
247
|
| **BillingAdjustment** | BillingAdjustment Entity Definition | DEFAULT |
|
|
248
248
|
| **ChurnRequest** | ChurnRequest Entity Definition | DEFAULT |
|
|
249
249
|
| **Commitment** | Commitment Entity Definition | DEFAULT |
|
|
250
|
+
| **Contract** | Contract Entity Definition | DEFAULT |
|
|
250
251
|
| **ContractBuyOut** | ContractBuyOut Entity Definition | DEFAULT |
|
|
251
252
|
| **DeactivationApproval** | DeactivationApproval Entity Definition | DEFAULT |
|
|
252
253
|
| **HomeMove** | HomeMove Entity Definition | DEFAULT |
|
|
@@ -33,6 +33,7 @@ export declare class AccountApi extends ApiProvider {
|
|
|
33
33
|
private _dataissue?;
|
|
34
34
|
private _frustrationscore?;
|
|
35
35
|
private _frustrationevent?;
|
|
36
|
+
private _contract?;
|
|
36
37
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
37
38
|
get note(): ApiRecordLinkManager;
|
|
38
39
|
get organization(): ApiRecordLinkManager;
|
|
@@ -50,6 +51,7 @@ export declare class AccountApi extends ApiProvider {
|
|
|
50
51
|
get dataissue(): ApiRecordLinkManager;
|
|
51
52
|
get frustrationscore(): ApiRecordLinkManager;
|
|
52
53
|
get frustrationevent(): ApiRecordLinkManager;
|
|
54
|
+
get contract(): ApiRecordLinkManager;
|
|
53
55
|
setRecord(sourceRecord: any): void;
|
|
54
56
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
55
57
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<AccountProperties>>>;
|
|
@@ -129,6 +129,12 @@ class AccountApi extends api_provider_1.ApiProvider {
|
|
|
129
129
|
}
|
|
130
130
|
return this._frustrationevent;
|
|
131
131
|
}
|
|
132
|
+
get contract() {
|
|
133
|
+
if (!this._contract) {
|
|
134
|
+
this._contract = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'CrmModule:Account', 'OrderModule:Contract', 'Contract__Account');
|
|
135
|
+
}
|
|
136
|
+
return this._contract;
|
|
137
|
+
}
|
|
132
138
|
// ============================================
|
|
133
139
|
// STANDARD METHODS (Unchanged API)
|
|
134
140
|
// ============================================
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { OauthParams } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
2
|
+
import { ApiProvider } from '@d19n/odin-sdk-generator/dist/api.provider';
|
|
3
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
4
|
+
import { ApiRecordLinkManager } from '@d19n/odin-sdk-generator/dist/api.record.link.manager';
|
|
5
|
+
import { ContractProperties } from '../entities-v2/Contract';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use OdinApiClient.
|
|
8
|
+
*
|
|
9
|
+
* Migration:
|
|
10
|
+
* - Old: new ContractApi(authParams).get(id)
|
|
11
|
+
* - New: new odin.contract.get(id)
|
|
12
|
+
*
|
|
13
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
14
|
+
*/
|
|
15
|
+
export declare class ContractApi extends ApiProvider {
|
|
16
|
+
protected readonly authToken?: string;
|
|
17
|
+
private readonly moduleName;
|
|
18
|
+
private readonly entityName;
|
|
19
|
+
private sourceRecord;
|
|
20
|
+
private _order?;
|
|
21
|
+
private _account?;
|
|
22
|
+
private _recontract?;
|
|
23
|
+
constructor(authParams?: OauthParams, authToken?: string);
|
|
24
|
+
get order(): ApiRecordLinkManager;
|
|
25
|
+
get account(): ApiRecordLinkManager;
|
|
26
|
+
get recontract(): ApiRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
29
|
+
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>>;
|
|
30
|
+
searchAndPaginate(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>>;
|
|
31
|
+
reIndex(body: {
|
|
32
|
+
id: string;
|
|
33
|
+
schemaId: string;
|
|
34
|
+
}[]): Promise<any>;
|
|
35
|
+
get(contractId: string): Promise<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>;
|
|
36
|
+
getMany(contractIds: string[]): Promise<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>[]>;
|
|
37
|
+
upsert(upsertDto: OdinRecordCreateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
38
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
39
|
+
update(updateDto: OdinRecordUpdateDto): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes>;
|
|
40
|
+
updateMany(updateDtos: OdinRecordUpdateDto[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").IDbRecordCreateUpdateRes[]>;
|
|
41
|
+
delete(contractId: string): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
42
|
+
deleteMany(contractIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinDeleteResponse[]>;
|
|
43
|
+
restore(contractIds: string[]): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinRestoreResponse[]>;
|
|
44
|
+
applyAction(dto: any): Promise<any[]>;
|
|
45
|
+
bulkApplyActions(dtos: any[]): Promise<any[]>;
|
|
46
|
+
getVersions(): Promise<{
|
|
47
|
+
[key: string]: Record<string, any>;
|
|
48
|
+
}>;
|
|
49
|
+
getRevisionTimeline(): Promise<{
|
|
50
|
+
[key: string]: Record<string, any>[];
|
|
51
|
+
}>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ContractApi = void 0;
|
|
13
|
+
const api_provider_1 = require("@d19n/odin-sdk-generator/dist/api.provider");
|
|
14
|
+
const api_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/api.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinApiClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new ContractApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.contract.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
23
|
+
*/
|
|
24
|
+
class ContractApi extends api_provider_1.ApiProvider {
|
|
25
|
+
constructor(authParams, authToken) {
|
|
26
|
+
super(authParams, authToken);
|
|
27
|
+
this.authToken = authToken;
|
|
28
|
+
this.moduleName = 'OrderModule';
|
|
29
|
+
this.entityName = 'Contract';
|
|
30
|
+
// Link managers are lazy-loaded on first access
|
|
31
|
+
}
|
|
32
|
+
// ============================================
|
|
33
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
34
|
+
// ============================================
|
|
35
|
+
// Usage remains identical: api.address.list(recordId)
|
|
36
|
+
get order() {
|
|
37
|
+
if (!this._order) {
|
|
38
|
+
this._order = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:Contract', 'OrderModule:Order', 'Contract__Order');
|
|
39
|
+
}
|
|
40
|
+
return this._order;
|
|
41
|
+
}
|
|
42
|
+
get account() {
|
|
43
|
+
if (!this._account) {
|
|
44
|
+
this._account = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:Contract', 'CrmModule:Account', 'Contract__Account');
|
|
45
|
+
}
|
|
46
|
+
return this._account;
|
|
47
|
+
}
|
|
48
|
+
get recontract() {
|
|
49
|
+
if (!this._recontract) {
|
|
50
|
+
this._recontract = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:Contract', 'OrderModule:Recontract', 'Recontract__Contract');
|
|
51
|
+
}
|
|
52
|
+
return this._recontract;
|
|
53
|
+
}
|
|
54
|
+
// ============================================
|
|
55
|
+
// STANDARD METHODS (Unchanged API)
|
|
56
|
+
// ============================================
|
|
57
|
+
setRecord(sourceRecord) {
|
|
58
|
+
this.sourceRecord = sourceRecord;
|
|
59
|
+
}
|
|
60
|
+
schema() {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
66
|
+
search(params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function when you want paginating through the results to be handled
|
|
72
|
+
searchAndPaginate(params) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Use this function to re-index records in elastic search
|
|
78
|
+
reIndex(body) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
return yield this._reIndexRecords(body);
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
// Use this function when you want to return a single record
|
|
84
|
+
get(contractId) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, contractId);
|
|
87
|
+
if (res)
|
|
88
|
+
this.setRecord(res);
|
|
89
|
+
return res;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Use this function when you want to return many records by primaryKeys
|
|
93
|
+
getMany(contractIds) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, contractIds);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// Use this function when you want to upsert one record
|
|
99
|
+
upsert(upsertDto) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
102
|
+
return res[0];
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Use this function when you want to upsert many records
|
|
106
|
+
upsertMany(upsertDtos) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// Use this function when you want to update one record
|
|
112
|
+
update(updateDto) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
115
|
+
return res[0];
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Use this function when you want to update many records
|
|
119
|
+
updateMany(updateDtos) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Use this function when you want to delete one record
|
|
125
|
+
delete(contractId) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
return yield this._delete(this.moduleName, this.entityName, [contractId]);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Use this function when you want to delete many records
|
|
131
|
+
deleteMany(contractIds) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
return yield this._delete(this.moduleName, this.entityName, contractIds);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Use this function when you want to restore one or many records
|
|
137
|
+
restore(contractIds) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return yield this._restore(this.moduleName, this.entityName, contractIds);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Use this function when you want to apply a single action
|
|
143
|
+
applyAction(dto) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Use this function when you want to bulk apply actions
|
|
149
|
+
bulkApplyActions(dtos) {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Use this function when you want to return the versions for a single record
|
|
155
|
+
getVersions() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
// Use this function when you want to return the change history for a single record
|
|
161
|
+
getRevisionTimeline() {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
exports.ContractApi = ContractApi;
|
|
@@ -62,6 +62,7 @@ export declare class OrderApi extends ApiProvider {
|
|
|
62
62
|
private _commitment?;
|
|
63
63
|
private _homemove__oldorder?;
|
|
64
64
|
private _homemove__neworder?;
|
|
65
|
+
private _contract?;
|
|
65
66
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
66
67
|
get note(): ApiRecordLinkManager;
|
|
67
68
|
get lead(): ApiRecordLinkManager;
|
|
@@ -108,6 +109,7 @@ export declare class OrderApi extends ApiProvider {
|
|
|
108
109
|
get commitment(): ApiRecordLinkManager;
|
|
109
110
|
get homemove__oldorder(): ApiRecordLinkManager;
|
|
110
111
|
get homemove__neworder(): ApiRecordLinkManager;
|
|
112
|
+
get contract(): ApiRecordLinkManager;
|
|
111
113
|
setRecord(sourceRecord: any): void;
|
|
112
114
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
113
115
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<OrderProperties>>>;
|
|
@@ -303,6 +303,12 @@ class OrderApi extends api_provider_1.ApiProvider {
|
|
|
303
303
|
}
|
|
304
304
|
return this._homemove__neworder;
|
|
305
305
|
}
|
|
306
|
+
get contract() {
|
|
307
|
+
if (!this._contract) {
|
|
308
|
+
this._contract = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:Order', 'OrderModule:Contract', 'Contract__Order');
|
|
309
|
+
}
|
|
310
|
+
return this._contract;
|
|
311
|
+
}
|
|
306
312
|
// ============================================
|
|
307
313
|
// STANDARD METHODS (Unchanged API)
|
|
308
314
|
// ============================================
|
|
@@ -19,9 +19,11 @@ export declare class RecontractApi extends ApiProvider {
|
|
|
19
19
|
private sourceRecord;
|
|
20
20
|
private _order?;
|
|
21
21
|
private _modifyservicerequest?;
|
|
22
|
+
private _contract?;
|
|
22
23
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
23
24
|
get order(): ApiRecordLinkManager;
|
|
24
25
|
get modifyservicerequest(): ApiRecordLinkManager;
|
|
26
|
+
get contract(): ApiRecordLinkManager;
|
|
25
27
|
setRecord(sourceRecord: any): void;
|
|
26
28
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
27
29
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<RecontractProperties>>>;
|
|
@@ -45,6 +45,12 @@ class RecontractApi extends api_provider_1.ApiProvider {
|
|
|
45
45
|
}
|
|
46
46
|
return this._modifyservicerequest;
|
|
47
47
|
}
|
|
48
|
+
get contract() {
|
|
49
|
+
if (!this._contract) {
|
|
50
|
+
this._contract = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:Recontract', 'OrderModule:Contract', 'Recontract__Contract');
|
|
51
|
+
}
|
|
52
|
+
return this._contract;
|
|
53
|
+
}
|
|
48
54
|
// ============================================
|
|
49
55
|
// STANDARD METHODS (Unchanged API)
|
|
50
56
|
// ============================================
|
|
@@ -37,6 +37,7 @@ export declare class AccountDb extends DbProvider {
|
|
|
37
37
|
private _dataissue?;
|
|
38
38
|
private _frustrationscore?;
|
|
39
39
|
private _frustrationevent?;
|
|
40
|
+
private _contract?;
|
|
40
41
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
41
42
|
get note(): DbRecordLinkManager;
|
|
42
43
|
get organization(): DbRecordLinkManager;
|
|
@@ -54,6 +55,7 @@ export declare class AccountDb extends DbProvider {
|
|
|
54
55
|
get dataissue(): DbRecordLinkManager;
|
|
55
56
|
get frustrationscore(): DbRecordLinkManager;
|
|
56
57
|
get frustrationevent(): DbRecordLinkManager;
|
|
58
|
+
get contract(): DbRecordLinkManager;
|
|
57
59
|
setRecord(sourceRecord: any): void;
|
|
58
60
|
/**
|
|
59
61
|
* Search records with manual pagination control
|
|
@@ -134,6 +134,12 @@ class AccountDb extends db_provider_1.DbProvider {
|
|
|
134
134
|
}
|
|
135
135
|
return this._frustrationevent;
|
|
136
136
|
}
|
|
137
|
+
get contract() {
|
|
138
|
+
if (!this._contract) {
|
|
139
|
+
this._contract = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'CrmModule:Account', 'OrderModule:Contract', 'Contract__Account');
|
|
140
|
+
}
|
|
141
|
+
return this._contract;
|
|
142
|
+
}
|
|
137
143
|
// ============================================
|
|
138
144
|
// STANDARD METHODS
|
|
139
145
|
// ============================================
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { DbProvider, DbProviderOptions, DbGetQueryOptions } from '@d19n/odin-sdk-generator/dist/db.provider';
|
|
2
|
+
import { OdinSearchV2, OdinRecordCreateDto, OdinRecordUpdateDto } from '@d19n/odin-types/dist/core';
|
|
3
|
+
import { DbRecordLinkManager } from '@d19n/odin-sdk-generator/dist/db.record.link.manager';
|
|
4
|
+
import { ContractProperties } from '../entities-v2/Contract';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new ContractApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.contract.get(id)
|
|
11
|
+
*
|
|
12
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
13
|
+
*
|
|
14
|
+
* Supports separate query options and provider options:
|
|
15
|
+
* - Constructor level: new ContractDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class ContractDb extends DbProvider {
|
|
19
|
+
protected readonly principal: any;
|
|
20
|
+
protected readonly dbService: any;
|
|
21
|
+
private readonly moduleName;
|
|
22
|
+
private readonly entityName;
|
|
23
|
+
private sourceRecord;
|
|
24
|
+
private _order?;
|
|
25
|
+
private _account?;
|
|
26
|
+
private _recontract?;
|
|
27
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
28
|
+
get order(): DbRecordLinkManager;
|
|
29
|
+
get account(): DbRecordLinkManager;
|
|
30
|
+
get recontract(): DbRecordLinkManager;
|
|
31
|
+
setRecord(sourceRecord: any): void;
|
|
32
|
+
/**
|
|
33
|
+
* Search records with manual pagination control
|
|
34
|
+
* @param params - Search parameters
|
|
35
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
36
|
+
*/
|
|
37
|
+
searchRecords(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>>;
|
|
38
|
+
/**
|
|
39
|
+
* Search all records with automatic pagination
|
|
40
|
+
* @param params - Search parameters
|
|
41
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
42
|
+
*/
|
|
43
|
+
searchAllRecordsAndPaginate(params: Partial<OdinSearchV2>, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core/interfaces/v2.db.interfaces").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get a single record by primary key
|
|
46
|
+
* @param contractId - Record ID
|
|
47
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
48
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Simple get
|
|
52
|
+
* const record = await db.getByPrimaryKey(id);
|
|
53
|
+
*
|
|
54
|
+
* // With related entities
|
|
55
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
56
|
+
*
|
|
57
|
+
* // With permissions bypass
|
|
58
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
59
|
+
*
|
|
60
|
+
* // Both options
|
|
61
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
62
|
+
*/
|
|
63
|
+
getByPrimaryKey(contractId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>>;
|
|
64
|
+
/**
|
|
65
|
+
* Get multiple records by primary keys
|
|
66
|
+
* @param contractIds - Array of record IDs
|
|
67
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
68
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
69
|
+
*/
|
|
70
|
+
getManyByPrimaryKey(contractIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<ContractProperties>[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Upsert a single record
|
|
73
|
+
* @param upsertDto - Record to upsert
|
|
74
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
75
|
+
*/
|
|
76
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
77
|
+
/**
|
|
78
|
+
* Upsert multiple records
|
|
79
|
+
* @param upsertDtos - Records to upsert
|
|
80
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
81
|
+
*/
|
|
82
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Update a single record
|
|
85
|
+
* @param updateDto - Record to update
|
|
86
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
87
|
+
*/
|
|
88
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
89
|
+
/**
|
|
90
|
+
* Update multiple records
|
|
91
|
+
* @param updateDtos - Records to update
|
|
92
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
93
|
+
*/
|
|
94
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
95
|
+
/**
|
|
96
|
+
* Delete one or many records
|
|
97
|
+
* @param contractIds - Record IDs to delete
|
|
98
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
99
|
+
*/
|
|
100
|
+
delete(contractIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
101
|
+
/**
|
|
102
|
+
* Restore one or many deleted records
|
|
103
|
+
* @param contractIds - Record IDs to restore
|
|
104
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
105
|
+
*/
|
|
106
|
+
restore(contractIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
107
|
+
/**
|
|
108
|
+
* Apply an action to a record
|
|
109
|
+
* @param actionName - The action key
|
|
110
|
+
* @param dto - The action DTO
|
|
111
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
112
|
+
*/
|
|
113
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
114
|
+
/**
|
|
115
|
+
* Get version history for the current source record
|
|
116
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
117
|
+
*/
|
|
118
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
119
|
+
/**
|
|
120
|
+
* Get revision timeline for the current source record
|
|
121
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
122
|
+
*/
|
|
123
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
124
|
+
}
|