@d19n/youfibre-odin-sdk 2.0.342 → 2.0.344

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/README.md +26 -2
  2. package/dist/EntityRegistry.d.ts +4 -0
  3. package/dist/EntityRegistry.js +4 -0
  4. package/dist/OdinApiClient.d.ts +8 -0
  5. package/dist/OdinApiClient.js +16 -0
  6. package/dist/OdinDbClient.d.ts +8 -0
  7. package/dist/OdinDbClient.js +16 -0
  8. package/dist/accessors-v2/DocumentAccessor.d.ts +112 -0
  9. package/dist/accessors-v2/DocumentAccessor.js +191 -0
  10. package/dist/accessors-v2/DocumentProcessingAccessor.d.ts +112 -0
  11. package/dist/accessors-v2/DocumentProcessingAccessor.js +191 -0
  12. package/dist/accessors-v2/index.d.ts +2 -0
  13. package/dist/accessors-v2/index.js +7 -3
  14. package/dist/actions-v2/CreateAiRouteRequestDto.d.ts +1 -1
  15. package/dist/actions-v2/CreateChurnRequestDto.d.ts +2 -0
  16. package/dist/actions-v2/CreateChurnRequestDto.js +2 -0
  17. package/dist/actions-v2/CreateDocumentDto.d.ts +235 -0
  18. package/dist/actions-v2/CreateDocumentDto.js +57 -0
  19. package/dist/actions-v2/CreateDocumentProcessingDto.d.ts +192 -0
  20. package/dist/actions-v2/CreateDocumentProcessingDto.js +57 -0
  21. package/dist/actions-v2/CreateLeadSalesAppDto.d.ts +9 -17
  22. package/dist/actions-v2/UpdateDocumentDto.d.ts +236 -0
  23. package/dist/actions-v2/UpdateDocumentDto.js +59 -0
  24. package/dist/actions-v2/UpdateMessageReadByCustomerDto.d.ts +72 -0
  25. package/dist/actions-v2/UpdateMessageReadByCustomerDto.js +56 -0
  26. package/dist/api-sdk-v2/CommitmentApi.d.ts +48 -0
  27. package/dist/api-sdk-v2/CommitmentApi.js +155 -0
  28. package/dist/api-sdk-v2/ContractBuyOutApi.d.ts +2 -0
  29. package/dist/api-sdk-v2/ContractBuyOutApi.js +6 -0
  30. package/dist/api-sdk-v2/DocumentApi.d.ts +52 -0
  31. package/dist/api-sdk-v2/DocumentApi.js +167 -0
  32. package/dist/api-sdk-v2/DocumentProcessingApi.d.ts +50 -0
  33. package/dist/api-sdk-v2/DocumentProcessingApi.js +161 -0
  34. package/dist/api-sdk-v2/EquipmentReturnApi.d.ts +45 -0
  35. package/dist/api-sdk-v2/EquipmentReturnApi.js +151 -0
  36. package/dist/api-sdk-v2/EquipmentReturnItemApi.d.ts +45 -0
  37. package/dist/api-sdk-v2/EquipmentReturnItemApi.js +151 -0
  38. package/dist/api-sdk-v2/FileApi.d.ts +4 -0
  39. package/dist/api-sdk-v2/FileApi.js +12 -0
  40. package/dist/api-sdk-v2/OrderApi.d.ts +2 -0
  41. package/dist/api-sdk-v2/OrderApi.js +6 -0
  42. package/dist/db-accessors-v2/DocumentDbAccessor.d.ts +180 -0
  43. package/dist/db-accessors-v2/DocumentDbAccessor.js +265 -0
  44. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.d.ts +180 -0
  45. package/dist/db-accessors-v2/DocumentProcessingDbAccessor.js +265 -0
  46. package/dist/db-accessors-v2/index.d.ts +2 -0
  47. package/dist/db-accessors-v2/index.js +7 -3
  48. package/dist/db-sdk-v2/CommitmentDb.d.ts +120 -0
  49. package/dist/db-sdk-v2/CommitmentDb.js +204 -0
  50. package/dist/db-sdk-v2/ContractBuyOutDb.d.ts +2 -0
  51. package/dist/db-sdk-v2/ContractBuyOutDb.js +6 -0
  52. package/dist/db-sdk-v2/DocumentDb.d.ts +124 -0
  53. package/dist/db-sdk-v2/DocumentDb.js +216 -0
  54. package/dist/db-sdk-v2/DocumentProcessingDb.d.ts +122 -0
  55. package/dist/db-sdk-v2/DocumentProcessingDb.js +210 -0
  56. package/dist/db-sdk-v2/EquipmentReturnDb.d.ts +117 -0
  57. package/dist/db-sdk-v2/EquipmentReturnDb.js +200 -0
  58. package/dist/db-sdk-v2/EquipmentReturnItemDb.d.ts +117 -0
  59. package/dist/db-sdk-v2/EquipmentReturnItemDb.js +200 -0
  60. package/dist/db-sdk-v2/FileDb.d.ts +4 -0
  61. package/dist/db-sdk-v2/FileDb.js +12 -0
  62. package/dist/db-sdk-v2/OrderDb.d.ts +2 -0
  63. package/dist/db-sdk-v2/OrderDb.js +6 -0
  64. package/dist/entities-v2/AiRouteRequest.d.ts +23 -11
  65. package/dist/entities-v2/AiRouteRequest.js +15 -3
  66. package/dist/entities-v2/Commitment.d.ts +154 -0
  67. package/dist/entities-v2/Commitment.js +115 -0
  68. package/dist/entities-v2/ContractBuyOut.d.ts +7 -0
  69. package/dist/entities-v2/ContractBuyOut.js +5 -1
  70. package/dist/entities-v2/Document.d.ts +1145 -0
  71. package/dist/entities-v2/Document.js +220 -0
  72. package/dist/entities-v2/DocumentProcessing.d.ts +272 -0
  73. package/dist/entities-v2/DocumentProcessing.js +156 -0
  74. package/dist/entities-v2/EquipmentReturn.d.ts +66 -0
  75. package/dist/entities-v2/EquipmentReturn.js +64 -0
  76. package/dist/entities-v2/EquipmentReturnItem.d.ts +66 -0
  77. package/dist/entities-v2/EquipmentReturnItem.js +64 -0
  78. package/dist/entities-v2/File.d.ts +81 -1
  79. package/dist/entities-v2/File.js +9 -1
  80. package/dist/entities-v2/Message.d.ts +27 -1
  81. package/dist/entities-v2/Message.js +2 -0
  82. package/dist/entities-v2/Order.d.ts +49 -8
  83. package/dist/entities-v2/Order.js +24 -4
  84. package/dist/entities-v2/YfStockCount.d.ts +197 -1
  85. package/dist/entities-v2/YfStockCount.js +28 -0
  86. package/dist/records-v2/ContractBuyOutRecord.d.ts +20 -0
  87. package/dist/records-v2/ContractBuyOutRecord.js +33 -0
  88. package/dist/records-v2/DocumentProcessingRecord.d.ts +227 -0
  89. package/dist/records-v2/DocumentProcessingRecord.js +315 -0
  90. package/dist/records-v2/DocumentRecord.d.ts +355 -0
  91. package/dist/records-v2/DocumentRecord.js +468 -0
  92. package/dist/records-v2/FileRecord.d.ts +59 -3
  93. package/dist/records-v2/FileRecord.js +83 -1
  94. package/dist/records-v2/MessageRecord.d.ts +28 -0
  95. package/dist/records-v2/MessageRecord.js +37 -0
  96. package/dist/records-v2/index.d.ts +2 -0
  97. package/dist/records-v2/index.js +10 -4
  98. package/package.json +1 -1
@@ -0,0 +1,117 @@
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 { EquipmentReturnProperties } from '../entities-v2/EquipmentReturn';
4
+ /**
5
+ * @deprecated Use OdinDbClient.
6
+ *
7
+ * Migration:
8
+ * - Old: new EquipmentReturnApi(authParams).get(id)
9
+ * - New: new odin.equipmentreturn.get(id)
10
+ *
11
+ * The new OdinDbClient returns typed record wrappers with action methods.
12
+ *
13
+ * Supports separate query options and provider options:
14
+ * - Constructor level: new EquipmentReturnDb(principal, dbService, { omitPermissionsCheck: true })
15
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
16
+ */
17
+ export declare class EquipmentReturnDb extends DbProvider {
18
+ protected readonly principal: any;
19
+ protected readonly dbService: any;
20
+ private readonly moduleName;
21
+ private readonly entityName;
22
+ private sourceRecord;
23
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
24
+ setRecord(sourceRecord: any): void;
25
+ /**
26
+ * Search records with manual pagination control
27
+ * @param params - Search parameters
28
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
29
+ */
30
+ 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<EquipmentReturnProperties>>>;
31
+ /**
32
+ * Search all records with automatic pagination
33
+ * @param params - Search parameters
34
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
35
+ */
36
+ 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<EquipmentReturnProperties>>>;
37
+ /**
38
+ * Get a single record by primary key
39
+ * @param equipmentReturnId - Record ID
40
+ * @param queryOptions - Query options (WHAT: entities to include)
41
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
42
+ *
43
+ * @example
44
+ * // Simple get
45
+ * const record = await db.getByPrimaryKey(id);
46
+ *
47
+ * // With related entities
48
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
49
+ *
50
+ * // With permissions bypass
51
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
52
+ *
53
+ * // Both options
54
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
55
+ */
56
+ getByPrimaryKey(equipmentReturnId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnProperties>>;
57
+ /**
58
+ * Get multiple records by primary keys
59
+ * @param equipmentReturnIds - Array of record IDs
60
+ * @param queryOptions - Query options (WHAT: entities to include)
61
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
62
+ */
63
+ getManyByPrimaryKey(equipmentReturnIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnProperties>[]>;
64
+ /**
65
+ * Upsert a single record
66
+ * @param upsertDto - Record to upsert
67
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
68
+ */
69
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
70
+ /**
71
+ * Upsert multiple records
72
+ * @param upsertDtos - Records to upsert
73
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
74
+ */
75
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
76
+ /**
77
+ * Update a single record
78
+ * @param updateDto - Record to update
79
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
80
+ */
81
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
82
+ /**
83
+ * Update multiple records
84
+ * @param updateDtos - Records to update
85
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
86
+ */
87
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
88
+ /**
89
+ * Delete one or many records
90
+ * @param equipmentReturnIds - Record IDs to delete
91
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
92
+ */
93
+ delete(equipmentReturnIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
94
+ /**
95
+ * Restore one or many deleted records
96
+ * @param equipmentReturnIds - Record IDs to restore
97
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
98
+ */
99
+ restore(equipmentReturnIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
100
+ /**
101
+ * Apply an action to a record
102
+ * @param actionName - The action key
103
+ * @param dto - The action DTO
104
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
105
+ */
106
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
107
+ /**
108
+ * Get version history for the current source record
109
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
110
+ */
111
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
112
+ /**
113
+ * Get revision timeline for the current source record
114
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
115
+ */
116
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
117
+ }
@@ -0,0 +1,200 @@
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.EquipmentReturnDb = void 0;
13
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
14
+ /**
15
+ * @deprecated Use OdinDbClient.
16
+ *
17
+ * Migration:
18
+ * - Old: new EquipmentReturnApi(authParams).get(id)
19
+ * - New: new odin.equipmentreturn.get(id)
20
+ *
21
+ * The new OdinDbClient returns typed record wrappers with action methods.
22
+ *
23
+ * Supports separate query options and provider options:
24
+ * - Constructor level: new EquipmentReturnDb(principal, dbService, { omitPermissionsCheck: true })
25
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
26
+ */
27
+ class EquipmentReturnDb extends db_provider_1.DbProvider {
28
+ // ============================================
29
+ // PRIVATE BACKING FIELDS (Lazy Loading)
30
+ // ============================================
31
+ constructor(principal, dbService, defaultOptions) {
32
+ super(principal, dbService, defaultOptions);
33
+ this.moduleName = 'FieldServiceModule';
34
+ this.entityName = 'EquipmentReturn';
35
+ this.principal = principal;
36
+ this.dbService = dbService;
37
+ // Link managers are lazy-loaded on first access
38
+ }
39
+ // ============================================
40
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
41
+ // ============================================
42
+ // Usage remains identical: db.address.list(recordId)
43
+ // ============================================
44
+ // STANDARD METHODS
45
+ // ============================================
46
+ // Methods support separate query options and provider options for clean API
47
+ setRecord(sourceRecord) {
48
+ this.sourceRecord = sourceRecord;
49
+ }
50
+ /**
51
+ * Search records with manual pagination control
52
+ * @param params - Search parameters
53
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
54
+ */
55
+ searchRecords(params, providerOptions) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
58
+ });
59
+ }
60
+ /**
61
+ * Search all records with automatic pagination
62
+ * @param params - Search parameters
63
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
64
+ */
65
+ searchAllRecordsAndPaginate(params, providerOptions) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
68
+ });
69
+ }
70
+ /**
71
+ * Get a single record by primary key
72
+ * @param equipmentReturnId - Record ID
73
+ * @param queryOptions - Query options (WHAT: entities to include)
74
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
75
+ *
76
+ * @example
77
+ * // Simple get
78
+ * const record = await db.getByPrimaryKey(id);
79
+ *
80
+ * // With related entities
81
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
82
+ *
83
+ * // With permissions bypass
84
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
85
+ *
86
+ * // Both options
87
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
88
+ */
89
+ getByPrimaryKey(equipmentReturnId, queryOptions, providerOptions) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, equipmentReturnId, queryOptions, providerOptions);
92
+ if (res)
93
+ this.setRecord(res);
94
+ return res;
95
+ });
96
+ }
97
+ /**
98
+ * Get multiple records by primary keys
99
+ * @param equipmentReturnIds - Array of record IDs
100
+ * @param queryOptions - Query options (WHAT: entities to include)
101
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
102
+ */
103
+ getManyByPrimaryKey(equipmentReturnIds, queryOptions, providerOptions) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, equipmentReturnIds, queryOptions, providerOptions);
106
+ });
107
+ }
108
+ /**
109
+ * Upsert a single record
110
+ * @param upsertDto - Record to upsert
111
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
112
+ */
113
+ upsert(upsertDto, providerOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
116
+ return res[0];
117
+ });
118
+ }
119
+ /**
120
+ * Upsert multiple records
121
+ * @param upsertDtos - Records to upsert
122
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
123
+ */
124
+ upsertMany(upsertDtos, providerOptions) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
127
+ });
128
+ }
129
+ /**
130
+ * Update a single record
131
+ * @param updateDto - Record to update
132
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
133
+ */
134
+ update(updateDto, providerOptions) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
137
+ return res[0];
138
+ });
139
+ }
140
+ /**
141
+ * Update multiple records
142
+ * @param updateDtos - Records to update
143
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
144
+ */
145
+ updateMany(updateDtos, providerOptions) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
148
+ });
149
+ }
150
+ /**
151
+ * Delete one or many records
152
+ * @param equipmentReturnIds - Record IDs to delete
153
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
154
+ */
155
+ delete(equipmentReturnIds, providerOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ return yield this._delete(this.moduleName, this.entityName, equipmentReturnIds, providerOptions);
158
+ });
159
+ }
160
+ /**
161
+ * Restore one or many deleted records
162
+ * @param equipmentReturnIds - Record IDs to restore
163
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
164
+ */
165
+ restore(equipmentReturnIds, providerOptions) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ return yield this._restore(this.moduleName, this.entityName, equipmentReturnIds, providerOptions);
168
+ });
169
+ }
170
+ /**
171
+ * Apply an action to a record
172
+ * @param actionName - The action key
173
+ * @param dto - The action DTO
174
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
175
+ */
176
+ applyAction(actionName, dto, providerOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
179
+ });
180
+ }
181
+ /**
182
+ * Get version history for the current source record
183
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
184
+ */
185
+ getVersions(providerOptions) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
188
+ });
189
+ }
190
+ /**
191
+ * Get revision timeline for the current source record
192
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
193
+ */
194
+ getRevisionTimeline(providerOptions) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
197
+ });
198
+ }
199
+ }
200
+ exports.EquipmentReturnDb = EquipmentReturnDb;
@@ -0,0 +1,117 @@
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 { EquipmentReturnItemProperties } from '../entities-v2/EquipmentReturnItem';
4
+ /**
5
+ * @deprecated Use OdinDbClient.
6
+ *
7
+ * Migration:
8
+ * - Old: new EquipmentReturnItemApi(authParams).get(id)
9
+ * - New: new odin.equipmentreturnitem.get(id)
10
+ *
11
+ * The new OdinDbClient returns typed record wrappers with action methods.
12
+ *
13
+ * Supports separate query options and provider options:
14
+ * - Constructor level: new EquipmentReturnItemDb(principal, dbService, { omitPermissionsCheck: true })
15
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
16
+ */
17
+ export declare class EquipmentReturnItemDb extends DbProvider {
18
+ protected readonly principal: any;
19
+ protected readonly dbService: any;
20
+ private readonly moduleName;
21
+ private readonly entityName;
22
+ private sourceRecord;
23
+ constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
24
+ setRecord(sourceRecord: any): void;
25
+ /**
26
+ * Search records with manual pagination control
27
+ * @param params - Search parameters
28
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
29
+ */
30
+ 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<EquipmentReturnItemProperties>>>;
31
+ /**
32
+ * Search all records with automatic pagination
33
+ * @param params - Search parameters
34
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
35
+ */
36
+ 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<EquipmentReturnItemProperties>>>;
37
+ /**
38
+ * Get a single record by primary key
39
+ * @param equipmentReturnItemId - Record ID
40
+ * @param queryOptions - Query options (WHAT: entities to include)
41
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
42
+ *
43
+ * @example
44
+ * // Simple get
45
+ * const record = await db.getByPrimaryKey(id);
46
+ *
47
+ * // With related entities
48
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
49
+ *
50
+ * // With permissions bypass
51
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
52
+ *
53
+ * // Both options
54
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
55
+ */
56
+ getByPrimaryKey(equipmentReturnItemId: string, queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>>;
57
+ /**
58
+ * Get multiple records by primary keys
59
+ * @param equipmentReturnItemIds - Array of record IDs
60
+ * @param queryOptions - Query options (WHAT: entities to include)
61
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
62
+ */
63
+ getManyByPrimaryKey(equipmentReturnItemIds: string[], queryOptions?: DbGetQueryOptions, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").OdinRecord<EquipmentReturnItemProperties>[]>;
64
+ /**
65
+ * Upsert a single record
66
+ * @param upsertDto - Record to upsert
67
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
68
+ */
69
+ upsert(upsertDto: OdinRecordCreateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
70
+ /**
71
+ * Upsert multiple records
72
+ * @param upsertDtos - Records to upsert
73
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
74
+ */
75
+ upsertMany(upsertDtos: OdinRecordCreateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
76
+ /**
77
+ * Update a single record
78
+ * @param updateDto - Record to update
79
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
80
+ */
81
+ update(updateDto: OdinRecordUpdateDto, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes>;
82
+ /**
83
+ * Update multiple records
84
+ * @param updateDtos - Records to update
85
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
86
+ */
87
+ updateMany(updateDtos: OdinRecordUpdateDto[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
88
+ /**
89
+ * Delete one or many records
90
+ * @param equipmentReturnItemIds - Record IDs to delete
91
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
92
+ */
93
+ delete(equipmentReturnItemIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordDeleted[]>;
94
+ /**
95
+ * Restore one or many deleted records
96
+ * @param equipmentReturnItemIds - Record IDs to restore
97
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
98
+ */
99
+ restore(equipmentReturnItemIds: string[], providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-sdk-generator").DbRecordRestored[]>;
100
+ /**
101
+ * Apply an action to a record
102
+ * @param actionName - The action key
103
+ * @param dto - The action DTO
104
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
105
+ */
106
+ applyAction(actionName: string, dto: any, providerOptions?: DbProviderOptions): Promise<import("@d19n/odin-types/dist/core").IDbRecordCreateUpdateRes[]>;
107
+ /**
108
+ * Get version history for the current source record
109
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
110
+ */
111
+ getVersions(providerOptions?: DbProviderOptions): Promise<any>;
112
+ /**
113
+ * Get revision timeline for the current source record
114
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
115
+ */
116
+ getRevisionTimeline(providerOptions?: DbProviderOptions): Promise<any>;
117
+ }
@@ -0,0 +1,200 @@
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.EquipmentReturnItemDb = void 0;
13
+ const db_provider_1 = require("@d19n/odin-sdk-generator/dist/db.provider");
14
+ /**
15
+ * @deprecated Use OdinDbClient.
16
+ *
17
+ * Migration:
18
+ * - Old: new EquipmentReturnItemApi(authParams).get(id)
19
+ * - New: new odin.equipmentreturnitem.get(id)
20
+ *
21
+ * The new OdinDbClient returns typed record wrappers with action methods.
22
+ *
23
+ * Supports separate query options and provider options:
24
+ * - Constructor level: new EquipmentReturnItemDb(principal, dbService, { omitPermissionsCheck: true })
25
+ * - Method level: await db.getByPrimaryKey(id, { entities: [] }, { omitPermissionsCheck: true })
26
+ */
27
+ class EquipmentReturnItemDb extends db_provider_1.DbProvider {
28
+ // ============================================
29
+ // PRIVATE BACKING FIELDS (Lazy Loading)
30
+ // ============================================
31
+ constructor(principal, dbService, defaultOptions) {
32
+ super(principal, dbService, defaultOptions);
33
+ this.moduleName = 'FieldServiceModule';
34
+ this.entityName = 'EquipmentReturnItem';
35
+ this.principal = principal;
36
+ this.dbService = dbService;
37
+ // Link managers are lazy-loaded on first access
38
+ }
39
+ // ============================================
40
+ // LAZY-LOADED LINK MANAGERS (Public Getters)
41
+ // ============================================
42
+ // Usage remains identical: db.address.list(recordId)
43
+ // ============================================
44
+ // STANDARD METHODS
45
+ // ============================================
46
+ // Methods support separate query options and provider options for clean API
47
+ setRecord(sourceRecord) {
48
+ this.sourceRecord = sourceRecord;
49
+ }
50
+ /**
51
+ * Search records with manual pagination control
52
+ * @param params - Search parameters
53
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
54
+ */
55
+ searchRecords(params, providerOptions) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ return yield this._searchRecords(this.moduleName, this.entityName, params, providerOptions);
58
+ });
59
+ }
60
+ /**
61
+ * Search all records with automatic pagination
62
+ * @param params - Search parameters
63
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
64
+ */
65
+ searchAllRecordsAndPaginate(params, providerOptions) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ return yield this._searchAllRecordsAndPaginate(this.moduleName, this.entityName, params, 0, providerOptions);
68
+ });
69
+ }
70
+ /**
71
+ * Get a single record by primary key
72
+ * @param equipmentReturnItemId - Record ID
73
+ * @param queryOptions - Query options (WHAT: entities to include)
74
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
75
+ *
76
+ * @example
77
+ * // Simple get
78
+ * const record = await db.getByPrimaryKey(id);
79
+ *
80
+ * // With related entities
81
+ * const record = await db.getByPrimaryKey(id, { entities: ['InvoiceItem', 'Transaction'] });
82
+ *
83
+ * // With permissions bypass
84
+ * const record = await db.getByPrimaryKey(id, {}, { omitPermissionsCheck: true });
85
+ *
86
+ * // Both options
87
+ * const record = await db.getByPrimaryKey(id, { entities: ['Invoice'] }, { omitPermissionsCheck: true });
88
+ */
89
+ getByPrimaryKey(equipmentReturnItemId, queryOptions, providerOptions) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const res = yield this._getByPrimaryKey(this.moduleName, this.entityName, equipmentReturnItemId, queryOptions, providerOptions);
92
+ if (res)
93
+ this.setRecord(res);
94
+ return res;
95
+ });
96
+ }
97
+ /**
98
+ * Get multiple records by primary keys
99
+ * @param equipmentReturnItemIds - Array of record IDs
100
+ * @param queryOptions - Query options (WHAT: entities to include)
101
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
102
+ */
103
+ getManyByPrimaryKey(equipmentReturnItemIds, queryOptions, providerOptions) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return yield this._getManyByPrimaryKey(this.moduleName, this.entityName, equipmentReturnItemIds, queryOptions, providerOptions);
106
+ });
107
+ }
108
+ /**
109
+ * Upsert a single record
110
+ * @param upsertDto - Record to upsert
111
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
112
+ */
113
+ upsert(upsertDto, providerOptions) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const res = yield this._upsert(this.moduleName, this.entityName, [upsertDto], providerOptions);
116
+ return res[0];
117
+ });
118
+ }
119
+ /**
120
+ * Upsert multiple records
121
+ * @param upsertDtos - Records to upsert
122
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
123
+ */
124
+ upsertMany(upsertDtos, providerOptions) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return yield this._upsert(this.moduleName, this.entityName, upsertDtos, providerOptions);
127
+ });
128
+ }
129
+ /**
130
+ * Update a single record
131
+ * @param updateDto - Record to update
132
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
133
+ */
134
+ update(updateDto, providerOptions) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ const res = yield this._update(this.moduleName, this.entityName, [updateDto], providerOptions);
137
+ return res[0];
138
+ });
139
+ }
140
+ /**
141
+ * Update multiple records
142
+ * @param updateDtos - Records to update
143
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
144
+ */
145
+ updateMany(updateDtos, providerOptions) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ return yield this._update(this.moduleName, this.entityName, updateDtos, providerOptions);
148
+ });
149
+ }
150
+ /**
151
+ * Delete one or many records
152
+ * @param equipmentReturnItemIds - Record IDs to delete
153
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
154
+ */
155
+ delete(equipmentReturnItemIds, providerOptions) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ return yield this._delete(this.moduleName, this.entityName, equipmentReturnItemIds, providerOptions);
158
+ });
159
+ }
160
+ /**
161
+ * Restore one or many deleted records
162
+ * @param equipmentReturnItemIds - Record IDs to restore
163
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
164
+ */
165
+ restore(equipmentReturnItemIds, providerOptions) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ return yield this._restore(this.moduleName, this.entityName, equipmentReturnItemIds, providerOptions);
168
+ });
169
+ }
170
+ /**
171
+ * Apply an action to a record
172
+ * @param actionName - The action key
173
+ * @param dto - The action DTO
174
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
175
+ */
176
+ applyAction(actionName, dto, providerOptions) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ return yield this._applyAction(this.moduleName, this.entityName, dto, providerOptions);
179
+ });
180
+ }
181
+ /**
182
+ * Get version history for the current source record
183
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
184
+ */
185
+ getVersions(providerOptions) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ return yield this._getVersions(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
188
+ });
189
+ }
190
+ /**
191
+ * Get revision timeline for the current source record
192
+ * @param providerOptions - Provider options (HOW: omitPermissionsCheck)
193
+ */
194
+ getRevisionTimeline(providerOptions) {
195
+ return __awaiter(this, void 0, void 0, function* () {
196
+ return yield this._getRevisionTimeline(this.moduleName, this.entityName, this.sourceRecord.id, providerOptions);
197
+ });
198
+ }
199
+ }
200
+ exports.EquipmentReturnItemDb = EquipmentReturnItemDb;
@@ -85,6 +85,8 @@ export declare class FileDb extends DbProvider {
85
85
  private _pgdirectdebitfile?;
86
86
  private _yfwifisurvey?;
87
87
  private _yffieldvisitoutcomeform?;
88
+ private _document?;
89
+ private _documentprocessing?;
88
90
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
89
91
  get servicevisitaudit(): DbRecordLinkManager;
90
92
  get blockagea55(): DbRecordLinkManager;
@@ -150,6 +152,8 @@ export declare class FileDb extends DbProvider {
150
152
  get pgdirectdebitfile(): DbRecordLinkManager;
151
153
  get yfwifisurvey(): DbRecordLinkManager;
152
154
  get yffieldvisitoutcomeform(): DbRecordLinkManager;
155
+ get document(): DbRecordLinkManager;
156
+ get documentprocessing(): DbRecordLinkManager;
153
157
  setRecord(sourceRecord: any): void;
154
158
  /**
155
159
  * Search records with manual pagination control
@@ -422,6 +422,18 @@ class FileDb extends db_provider_1.DbProvider {
422
422
  }
423
423
  return this._yffieldvisitoutcomeform;
424
424
  }
425
+ get document() {
426
+ if (!this._document) {
427
+ this._document = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SchemaModule:File', 'AiModule:Document', 'Document__File');
428
+ }
429
+ return this._document;
430
+ }
431
+ get documentprocessing() {
432
+ if (!this._documentprocessing) {
433
+ this._documentprocessing = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'SchemaModule:File', 'AiModule:DocumentProcessing', 'DocumentProcessing__File');
434
+ }
435
+ return this._documentprocessing;
436
+ }
425
437
  // ============================================
426
438
  // STANDARD METHODS
427
439
  // ============================================