@d19n/youfibre-odin-sdk 2.0.321 → 2.0.322
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 +7 -2
- package/dist/actions-v2/CompleteServiceWorkOrderFlowDto.d.ts +14 -14
- package/dist/actions-v2/CompleteServiceWorkOrderFlowDto.js +22 -22
- package/dist/actions-v2/DefaultServiceWorkOrderEditFormDto.d.ts +8 -1
- package/dist/actions-v2/UpdateCustomerDeviceBatteryDto.d.ts +3 -1
- package/dist/actions-v2/UpdateCustomerDeviceBatteryDto.js +3 -1
- package/dist/api-sdk-v2/CaseApi.d.ts +4 -0
- package/dist/api-sdk-v2/CaseApi.js +12 -0
- package/dist/api-sdk-v2/CoachingSessionApi.d.ts +50 -0
- package/dist/api-sdk-v2/CoachingSessionApi.js +161 -0
- package/dist/api-sdk-v2/QaEvaluationAnswerApi.d.ts +48 -0
- package/dist/api-sdk-v2/QaEvaluationAnswerApi.js +155 -0
- package/dist/api-sdk-v2/QaEvaluationApi.d.ts +54 -0
- package/dist/api-sdk-v2/QaEvaluationApi.js +173 -0
- package/dist/api-sdk-v2/QaScorecardQuestionApi.d.ts +48 -0
- package/dist/api-sdk-v2/QaScorecardQuestionApi.js +155 -0
- package/dist/api-sdk-v2/QaScorecardTemplateApi.d.ts +50 -0
- package/dist/api-sdk-v2/QaScorecardTemplateApi.js +161 -0
- package/dist/db-sdk-v2/CaseDb.d.ts +4 -0
- package/dist/db-sdk-v2/CaseDb.js +12 -0
- package/dist/db-sdk-v2/CoachingSessionDb.d.ts +122 -0
- package/dist/db-sdk-v2/CoachingSessionDb.js +210 -0
- package/dist/db-sdk-v2/QaEvaluationAnswerDb.d.ts +120 -0
- package/dist/db-sdk-v2/QaEvaluationAnswerDb.js +204 -0
- package/dist/db-sdk-v2/QaEvaluationDb.d.ts +126 -0
- package/dist/db-sdk-v2/QaEvaluationDb.js +222 -0
- package/dist/db-sdk-v2/QaScorecardQuestionDb.d.ts +120 -0
- package/dist/db-sdk-v2/QaScorecardQuestionDb.js +204 -0
- package/dist/db-sdk-v2/QaScorecardTemplateDb.d.ts +122 -0
- package/dist/db-sdk-v2/QaScorecardTemplateDb.js +210 -0
- package/dist/entities-v2/Case.d.ts +14 -0
- package/dist/entities-v2/Case.js +9 -1
- package/dist/entities-v2/CoachingSession.d.ts +247 -0
- package/dist/entities-v2/CoachingSession.js +145 -0
- package/dist/entities-v2/CustomerDeviceRouter.d.ts +258 -8
- package/dist/entities-v2/CustomerDeviceRouter.js +17 -9
- package/dist/entities-v2/QaEvaluation.d.ts +361 -0
- package/dist/entities-v2/QaEvaluation.js +217 -0
- package/dist/entities-v2/QaEvaluationAnswer.d.ts +127 -0
- package/dist/entities-v2/QaEvaluationAnswer.js +92 -0
- package/dist/entities-v2/QaScorecardQuestion.d.ts +155 -0
- package/dist/entities-v2/QaScorecardQuestion.js +96 -0
- package/dist/entities-v2/QaScorecardTemplate.d.ts +152 -0
- package/dist/entities-v2/QaScorecardTemplate.js +114 -0
- package/dist/entities-v2/WorkOrder.d.ts +210 -1
- package/dist/entities-v2/WorkOrder.js +22 -4
- package/dist/entities-v2/YfFieldVisitOutcomeForm.d.ts +4 -3
- package/dist/entities-v2/YfFieldVisitOutcomeForm.js +2 -1
- package/dist/records-v2/CustomerDeviceRouterRecord.d.ts +38 -2
- package/dist/records-v2/CustomerDeviceRouterRecord.js +37 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +4 -4
- package/dist/records-v2/WorkOrderRecord.js +4 -4
- package/dist/records-v2/YfFieldVisitOutcomeFormRecord.d.ts +5 -4
- package/dist/records-v2/YfFieldVisitOutcomeFormRecord.js +5 -5
- package/package.json +1 -1
|
@@ -0,0 +1,161 @@
|
|
|
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.QaScorecardTemplateApi = 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 QaScorecardTemplateApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.qascorecardtemplate.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinApiClient returns typed record wrappers with action methods.
|
|
23
|
+
*/
|
|
24
|
+
class QaScorecardTemplateApi extends api_provider_1.ApiProvider {
|
|
25
|
+
constructor(authParams, authToken) {
|
|
26
|
+
super(authParams, authToken);
|
|
27
|
+
this.authToken = authToken;
|
|
28
|
+
this.moduleName = 'SupportModule';
|
|
29
|
+
this.entityName = 'QaScorecardTemplate';
|
|
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 qaevaluation() {
|
|
37
|
+
if (!this._qaevaluation) {
|
|
38
|
+
this._qaevaluation = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'SupportModule:QaScorecardTemplate', 'SupportModule:QaEvaluation', 'QaScorecardTemplate__QaEvaluation');
|
|
39
|
+
}
|
|
40
|
+
return this._qaevaluation;
|
|
41
|
+
}
|
|
42
|
+
get qascorecardquestion() {
|
|
43
|
+
if (!this._qascorecardquestion) {
|
|
44
|
+
this._qascorecardquestion = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'SupportModule:QaScorecardTemplate', 'SupportModule:QaScorecardQuestion', 'QaScorecardTemplate__QaScorecardQuestion');
|
|
45
|
+
}
|
|
46
|
+
return this._qascorecardquestion;
|
|
47
|
+
}
|
|
48
|
+
// ============================================
|
|
49
|
+
// STANDARD METHODS (Unchanged API)
|
|
50
|
+
// ============================================
|
|
51
|
+
setRecord(sourceRecord) {
|
|
52
|
+
this.sourceRecord = sourceRecord;
|
|
53
|
+
}
|
|
54
|
+
schema() {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
return yield this.getSchema(this.moduleName, this.entityName);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// Use this function when you want to search and handle all pagination on your own
|
|
60
|
+
search(params) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
// Use this function when you want paginating through the results to be handled
|
|
66
|
+
searchAndPaginate(params) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
// Use this function to re-index records in elastic search
|
|
72
|
+
reIndex(body) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
return yield this._reIndexRecords(body);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
// Use this function when you want to return a single record
|
|
78
|
+
get(qaScorecardTemplateId) {
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, qaScorecardTemplateId);
|
|
81
|
+
if (res)
|
|
82
|
+
this.setRecord(res);
|
|
83
|
+
return res;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Use this function when you want to return many records by primaryKeys
|
|
87
|
+
getMany(qaScorecardTemplateIds) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, qaScorecardTemplateIds);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Use this function when you want to upsert one record
|
|
93
|
+
upsert(upsertDto) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto]);
|
|
96
|
+
return res[0];
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
// Use this function when you want to upsert many records
|
|
100
|
+
upsertMany(upsertDtos) {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos);
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Use this function when you want to update one record
|
|
106
|
+
update(updateDto) {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto]);
|
|
109
|
+
return res[0];
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// Use this function when you want to update many records
|
|
113
|
+
updateMany(updateDtos) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
// Use this function when you want to delete one record
|
|
119
|
+
delete(qaScorecardTemplateId) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
return yield this._delete(this.moduleName, this.entityName, [qaScorecardTemplateId]);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Use this function when you want to delete many records
|
|
125
|
+
deleteMany(qaScorecardTemplateIds) {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
return yield this._delete(this.moduleName, this.entityName, qaScorecardTemplateIds);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
// Use this function when you want to restore one or many records
|
|
131
|
+
restore(qaScorecardTemplateIds) {
|
|
132
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
+
return yield this._restore(this.moduleName, this.entityName, qaScorecardTemplateIds);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// Use this function when you want to apply a single action
|
|
137
|
+
applyAction(dto) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto);
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
// Use this function when you want to bulk apply actions
|
|
143
|
+
bulkApplyActions(dtos) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return yield this._bulkApplyActions(this.moduleName, this.entityName, dtos);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// Use this function when you want to return the versions for a single record
|
|
149
|
+
getVersions() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
// Use this function when you want to return the change history for a single record
|
|
155
|
+
getRevisionTimeline() {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.QaScorecardTemplateApi = QaScorecardTemplateApi;
|
|
@@ -50,6 +50,8 @@ export declare class CaseDb extends DbProvider {
|
|
|
50
50
|
private _outbounddialsession?;
|
|
51
51
|
private _call?;
|
|
52
52
|
private _qareport?;
|
|
53
|
+
private _qaevaluation?;
|
|
54
|
+
private _coachingsession?;
|
|
53
55
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
54
56
|
get activitylog(): DbRecordLinkManager;
|
|
55
57
|
get caseaction(): DbRecordLinkManager;
|
|
@@ -80,6 +82,8 @@ export declare class CaseDb extends DbProvider {
|
|
|
80
82
|
get outbounddialsession(): DbRecordLinkManager;
|
|
81
83
|
get call(): DbRecordLinkManager;
|
|
82
84
|
get qareport(): DbRecordLinkManager;
|
|
85
|
+
get qaevaluation(): DbRecordLinkManager;
|
|
86
|
+
get coachingsession(): DbRecordLinkManager;
|
|
83
87
|
setRecord(sourceRecord: any): void;
|
|
84
88
|
/**
|
|
85
89
|
* Search records with manual pagination control
|
package/dist/db-sdk-v2/CaseDb.js
CHANGED
|
@@ -212,6 +212,18 @@ class CaseDb extends db_provider_1.DbProvider {
|
|
|
212
212
|
}
|
|
213
213
|
return this._qareport;
|
|
214
214
|
}
|
|
215
|
+
get qaevaluation() {
|
|
216
|
+
if (!this._qaevaluation) {
|
|
217
|
+
this._qaevaluation = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:Case', 'SupportModule:QaEvaluation', 'Case__QaEvaluation');
|
|
218
|
+
}
|
|
219
|
+
return this._qaevaluation;
|
|
220
|
+
}
|
|
221
|
+
get coachingsession() {
|
|
222
|
+
if (!this._coachingsession) {
|
|
223
|
+
this._coachingsession = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:Case', 'SupportModule:CoachingSession', 'Case__CoachingSession');
|
|
224
|
+
}
|
|
225
|
+
return this._coachingsession;
|
|
226
|
+
}
|
|
215
227
|
// ============================================
|
|
216
228
|
// STANDARD METHODS
|
|
217
229
|
// ============================================
|
|
@@ -0,0 +1,122 @@
|
|
|
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 { CoachingSessionProperties } from '../entities-v2/CoachingSession';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new CoachingSessionApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.coachingsession.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 CoachingSessionDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class CoachingSessionDb 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 _qaevaluation?;
|
|
25
|
+
private _case?;
|
|
26
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
27
|
+
get qaevaluation(): DbRecordLinkManager;
|
|
28
|
+
get case(): DbRecordLinkManager;
|
|
29
|
+
setRecord(sourceRecord: any): void;
|
|
30
|
+
/**
|
|
31
|
+
* Search records with manual pagination control
|
|
32
|
+
* @param params - Search parameters
|
|
33
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
34
|
+
*/
|
|
35
|
+
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<CoachingSessionProperties>>>;
|
|
36
|
+
/**
|
|
37
|
+
* Search all records with automatic pagination
|
|
38
|
+
* @param params - Search parameters
|
|
39
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
40
|
+
*/
|
|
41
|
+
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<CoachingSessionProperties>>>;
|
|
42
|
+
/**
|
|
43
|
+
* Get a single record by primary key
|
|
44
|
+
* @param coachingSessionId - Record ID
|
|
45
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
46
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* // Simple get
|
|
50
|
+
* const record = await db.getByPrimaryKey(id);
|
|
51
|
+
*
|
|
52
|
+
* // With related entities
|
|
53
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
54
|
+
*
|
|
55
|
+
* // With permissions bypass
|
|
56
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
57
|
+
*
|
|
58
|
+
* // Both options
|
|
59
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
60
|
+
*/
|
|
61
|
+
getByPrimaryKey(coachingSessionId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<CoachingSessionProperties>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get multiple records by primary keys
|
|
64
|
+
* @param coachingSessionIds - Array of record IDs
|
|
65
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
66
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
67
|
+
*/
|
|
68
|
+
getManyByPrimaryKey(coachingSessionIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<CoachingSessionProperties>[]>;
|
|
69
|
+
/**
|
|
70
|
+
* Upsert a single record
|
|
71
|
+
* @param upsertDto - Record to upsert
|
|
72
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
73
|
+
*/
|
|
74
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
75
|
+
/**
|
|
76
|
+
* Upsert multiple records
|
|
77
|
+
* @param upsertDtos - Records to upsert
|
|
78
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
79
|
+
*/
|
|
80
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Update a single record
|
|
83
|
+
* @param updateDto - Record to update
|
|
84
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
85
|
+
*/
|
|
86
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
87
|
+
/**
|
|
88
|
+
* Update multiple records
|
|
89
|
+
* @param updateDtos - Records to update
|
|
90
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
91
|
+
*/
|
|
92
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
93
|
+
/**
|
|
94
|
+
* Delete one or many records
|
|
95
|
+
* @param coachingSessionIds - Record IDs to delete
|
|
96
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
97
|
+
*/
|
|
98
|
+
delete(coachingSessionIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
99
|
+
/**
|
|
100
|
+
* Restore one or many deleted records
|
|
101
|
+
* @param coachingSessionIds - Record IDs to restore
|
|
102
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
103
|
+
*/
|
|
104
|
+
restore(coachingSessionIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
105
|
+
/**
|
|
106
|
+
* Apply an action to a record
|
|
107
|
+
* @param actionName - The action key
|
|
108
|
+
* @param dto - The action DTO
|
|
109
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
110
|
+
*/
|
|
111
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
112
|
+
/**
|
|
113
|
+
* Get version history for the current source record
|
|
114
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
115
|
+
*/
|
|
116
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
117
|
+
/**
|
|
118
|
+
* Get revision timeline for the current source record
|
|
119
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
120
|
+
*/
|
|
121
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
122
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
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.CoachingSessionDb = void 0;
|
|
13
|
+
const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
|
|
14
|
+
const db_record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/db.record.link.manager");
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use OdinDbClient.
|
|
17
|
+
*
|
|
18
|
+
* Migration:
|
|
19
|
+
* - Old: new CoachingSessionApi(authParams).get(id)
|
|
20
|
+
* - New: new odin.coachingsession.get(id)
|
|
21
|
+
*
|
|
22
|
+
* The new OdinDbClient returns typed record wrappers with action methods.
|
|
23
|
+
*
|
|
24
|
+
* Supports separate query options and provider options:
|
|
25
|
+
* - Constructor level: new CoachingSessionDb(principal, dbService, { omitPermissionsCheck: true })
|
|
26
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
27
|
+
*/
|
|
28
|
+
class CoachingSessionDb extends db_provider_1.DbProvider {
|
|
29
|
+
constructor(principal, dbService, defaultOptions) {
|
|
30
|
+
super(principal, dbService, defaultOptions);
|
|
31
|
+
this.moduleName = 'SupportModule';
|
|
32
|
+
this.entityName = 'CoachingSession';
|
|
33
|
+
this.principal = principal;
|
|
34
|
+
this.dbService = dbService;
|
|
35
|
+
// Link managers are lazy-loaded on first access
|
|
36
|
+
}
|
|
37
|
+
// ============================================
|
|
38
|
+
// LAZY-LOADED LINK MANAGERS (Public Getters)
|
|
39
|
+
// ============================================
|
|
40
|
+
// Usage remains identical: db.address.list(recordId)
|
|
41
|
+
get qaevaluation() {
|
|
42
|
+
if (!this._qaevaluation) {
|
|
43
|
+
this._qaevaluation = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:CoachingSession', 'SupportModule:QaEvaluation', 'QaEvaluation__CoachingSession');
|
|
44
|
+
}
|
|
45
|
+
return this._qaevaluation;
|
|
46
|
+
}
|
|
47
|
+
get case() {
|
|
48
|
+
if (!this._case) {
|
|
49
|
+
this._case = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SupportModule:CoachingSession', 'SupportModule:Case', 'Case__CoachingSession');
|
|
50
|
+
}
|
|
51
|
+
return this._case;
|
|
52
|
+
}
|
|
53
|
+
// ============================================
|
|
54
|
+
// STANDARD METHODS
|
|
55
|
+
// ============================================
|
|
56
|
+
// Methods support separate query options and provider options for clean API
|
|
57
|
+
setRecord(sourceRecord) {
|
|
58
|
+
this.sourceRecord = sourceRecord;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Search records with manual pagination control
|
|
62
|
+
* @param params - Search parameters
|
|
63
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
64
|
+
*/
|
|
65
|
+
searchRecords(params, providerOptions) {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Search all records with automatic pagination
|
|
72
|
+
* @param params - Search parameters
|
|
73
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
74
|
+
*/
|
|
75
|
+
searchAllRecordsAndPaginate(params, providerOptions) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Get a single record by primary key
|
|
82
|
+
* @param coachingSessionId - Record ID
|
|
83
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
84
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // Simple get
|
|
88
|
+
* const record = await db.getByPrimaryKey(id);
|
|
89
|
+
*
|
|
90
|
+
* // With related entities
|
|
91
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
92
|
+
*
|
|
93
|
+
* // With permissions bypass
|
|
94
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
95
|
+
*
|
|
96
|
+
* // Both options
|
|
97
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
98
|
+
*/
|
|
99
|
+
getByPrimaryKey(coachingSessionId, queryOptions, providerOptions) {
|
|
100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, coachingSessionId, queryOptions, providerOptions);
|
|
102
|
+
if (res)
|
|
103
|
+
this.setRecord(res);
|
|
104
|
+
return res;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Get multiple records by primary keys
|
|
109
|
+
* @param coachingSessionIds - Array of record IDs
|
|
110
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
111
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
112
|
+
*/
|
|
113
|
+
getManyByPrimaryKey(coachingSessionIds, queryOptions, providerOptions) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, coachingSessionIds, queryOptions, providerOptions);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Upsert a single record
|
|
120
|
+
* @param upsertDto - Record to upsert
|
|
121
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
122
|
+
*/
|
|
123
|
+
upsert(upsertDto, providerOptions) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
|
|
126
|
+
return res[0];
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Upsert multiple records
|
|
131
|
+
* @param upsertDtos - Records to upsert
|
|
132
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
133
|
+
*/
|
|
134
|
+
upsertMany(upsertDtos, providerOptions) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Update a single record
|
|
141
|
+
* @param updateDto - Record to update
|
|
142
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
143
|
+
*/
|
|
144
|
+
update(updateDto, providerOptions) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
|
|
147
|
+
return res[0];
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Update multiple records
|
|
152
|
+
* @param updateDtos - Records to update
|
|
153
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
154
|
+
*/
|
|
155
|
+
updateMany(updateDtos, providerOptions) {
|
|
156
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
157
|
+
return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Delete one or many records
|
|
162
|
+
* @param coachingSessionIds - Record IDs to delete
|
|
163
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
164
|
+
*/
|
|
165
|
+
delete(coachingSessionIds, providerOptions) {
|
|
166
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
167
|
+
return yield this._delete(this.moduleName, this.entityName, coachingSessionIds, providerOptions);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Restore one or many deleted records
|
|
172
|
+
* @param coachingSessionIds - Record IDs to restore
|
|
173
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
174
|
+
*/
|
|
175
|
+
restore(coachingSessionIds, providerOptions) {
|
|
176
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
177
|
+
return yield this._restore(this.moduleName, this.entityName, coachingSessionIds, providerOptions);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Apply an action to a record
|
|
182
|
+
* @param actionName - The action key
|
|
183
|
+
* @param dto - The action DTO
|
|
184
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
185
|
+
*/
|
|
186
|
+
applyAction(actionName, dto, providerOptions) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Get version history for the current source record
|
|
193
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
194
|
+
*/
|
|
195
|
+
getVersions(providerOptions) {
|
|
196
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Get revision timeline for the current source record
|
|
202
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
203
|
+
*/
|
|
204
|
+
getRevisionTimeline(providerOptions) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
exports.CoachingSessionDb = CoachingSessionDb;
|
|
@@ -0,0 +1,120 @@
|
|
|
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 { QaEvaluationAnswerProperties } from '../entities-v2/QaEvaluationAnswer';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use OdinDbClient.
|
|
7
|
+
*
|
|
8
|
+
* Migration:
|
|
9
|
+
* - Old: new QaEvaluationAnswerApi(authParams).get(id)
|
|
10
|
+
* - New: new odin.qaevaluationanswer.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 QaEvaluationAnswerDb(principal, dbService, { omitPermissionsCheck: true })
|
|
16
|
+
* - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
|
|
17
|
+
*/
|
|
18
|
+
export declare class QaEvaluationAnswerDb 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 _qaevaluation?;
|
|
25
|
+
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
26
|
+
get qaevaluation(): DbRecordLinkManager;
|
|
27
|
+
setRecord(sourceRecord: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* Search records with manual pagination control
|
|
30
|
+
* @param params - Search parameters
|
|
31
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
32
|
+
*/
|
|
33
|
+
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<QaEvaluationAnswerProperties>>>;
|
|
34
|
+
/**
|
|
35
|
+
* Search all records with automatic pagination
|
|
36
|
+
* @param params - Search parameters
|
|
37
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
38
|
+
*/
|
|
39
|
+
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<QaEvaluationAnswerProperties>>>;
|
|
40
|
+
/**
|
|
41
|
+
* Get a single record by primary key
|
|
42
|
+
* @param qaEvaluationAnswerId - Record ID
|
|
43
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
44
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* // Simple get
|
|
48
|
+
* const record = await db.getByPrimaryKey(id);
|
|
49
|
+
*
|
|
50
|
+
* // With related entities
|
|
51
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
|
|
52
|
+
*
|
|
53
|
+
* // With permissions bypass
|
|
54
|
+
* const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
|
|
55
|
+
*
|
|
56
|
+
* // Both options
|
|
57
|
+
* const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
|
|
58
|
+
*/
|
|
59
|
+
getByPrimaryKey(qaEvaluationAnswerId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaEvaluationAnswerProperties>>;
|
|
60
|
+
/**
|
|
61
|
+
* Get multiple records by primary keys
|
|
62
|
+
* @param qaEvaluationAnswerIds - Array of record IDs
|
|
63
|
+
* @param queryOptions - Query options (WHAT: entities to include)
|
|
64
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
65
|
+
*/
|
|
66
|
+
getManyByPrimaryKey(qaEvaluationAnswerIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<QaEvaluationAnswerProperties>[]>;
|
|
67
|
+
/**
|
|
68
|
+
* Upsert a single record
|
|
69
|
+
* @param upsertDto - Record to upsert
|
|
70
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
71
|
+
*/
|
|
72
|
+
upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
73
|
+
/**
|
|
74
|
+
* Upsert multiple records
|
|
75
|
+
* @param upsertDtos - Records to upsert
|
|
76
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
77
|
+
*/
|
|
78
|
+
upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
79
|
+
/**
|
|
80
|
+
* Update a single record
|
|
81
|
+
* @param updateDto - Record to update
|
|
82
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
83
|
+
*/
|
|
84
|
+
update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
|
|
85
|
+
/**
|
|
86
|
+
* Update multiple records
|
|
87
|
+
* @param updateDtos - Records to update
|
|
88
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
89
|
+
*/
|
|
90
|
+
updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Delete one or many records
|
|
93
|
+
* @param qaEvaluationAnswerIds - Record IDs to delete
|
|
94
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
95
|
+
*/
|
|
96
|
+
delete(qaEvaluationAnswerIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Restore one or many deleted records
|
|
99
|
+
* @param qaEvaluationAnswerIds - Record IDs to restore
|
|
100
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
101
|
+
*/
|
|
102
|
+
restore(qaEvaluationAnswerIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
|
|
103
|
+
/**
|
|
104
|
+
* Apply an action to a record
|
|
105
|
+
* @param actionName - The action key
|
|
106
|
+
* @param dto - The action DTO
|
|
107
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
108
|
+
*/
|
|
109
|
+
applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
|
|
110
|
+
/**
|
|
111
|
+
* Get version history for the current source record
|
|
112
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
113
|
+
*/
|
|
114
|
+
getVersions(providerOptions?: DbProviderOptions): Promise<any>;
|
|
115
|
+
/**
|
|
116
|
+
* Get revision timeline for the current source record
|
|
117
|
+
* @param providerOptions - Provider options (HOW: omitPermissionsCheck)
|
|
118
|
+
*/
|
|
119
|
+
getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
|
|
120
|
+
}
|