@d19n/youfibre-odin-sdk 1.0.272 → 1.0.273

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.
@@ -0,0 +1,72 @@
1
+ /**
2
+ * UpdateProductData Action DTO
3
+ *
4
+ * UpdateProductData
5
+ *
6
+ * @module FieldServiceModule
7
+ * @entity WorkOrderStatusUpdate
8
+ * @actionKey UpdateProductData
9
+ * @event UpdateProductData
10
+ *
11
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
12
+ */
13
+ import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
14
+ /**
15
+ * Properties for UpdateProductData action
16
+ *
17
+ * @property Required fields: 0
18
+ * @property Optional fields: 1
19
+ */
20
+ export interface UpdateProductDataProperties {
21
+ /**
22
+ * ProductData
23
+ *
24
+ * Product Data (Field Operations - WorkOrderStatusUpdate)
25
+ * @type {JSON}
26
+ */
27
+ ProductData?: string;
28
+ }
29
+ /**
30
+ * UpdateProductData
31
+ *
32
+ * @actionType UPDATE - Updates an existing WorkOrderStatusUpdate record
33
+ * @module FieldServiceModule
34
+ * @entity WorkOrderStatusUpdate
35
+ * @event UpdateProductData
36
+ * @permission schema.action.updateproductdata.trigger
37
+ * @benchmark This action is tracked for performance benchmarks
38
+ */
39
+ export declare class UpdateProductDataDto extends OdinRecordUpdateDto<UpdateProductDataProperties> {
40
+ /** Used by SDK generators to identify action type */
41
+ static readonly ACTION_TYPE = "UPDATE";
42
+ static readonly ACTION_KEY = "UpdateProductData";
43
+ static readonly MODULE_NAME = "FieldServiceModule";
44
+ static readonly ENTITIES: string[];
45
+ static readonly EVENT_NAME = "UpdateProductData";
46
+ static readonly PERMISSION = "schema.action.updateproductdata.trigger";
47
+ readonly actionName: string;
48
+ readonly schemaActionId: string;
49
+ readonly entity: string;
50
+ constructor(record: OdinRecord<any> | {
51
+ id: string;
52
+ entity: string;
53
+ type?: string;
54
+ }, properties: UpdateProductDataProperties, options?: {
55
+ journeyId?: string;
56
+ stageKey?: string;
57
+ });
58
+ }
59
+ /**
60
+ * RabbitMQ message payload for UpdateProductData updated events
61
+ *
62
+ * @event UpdateProductData
63
+ */
64
+ export interface UpdateProductDataMessage extends OdinRecordUpdatedEvent<UpdateProductDataDto, UpdateProductDataProperties> {
65
+ }
66
+ /**
67
+ * RabbitMQ routing key for UpdateProductData events
68
+ *
69
+ * Subscribe to this key to receive notifications when this action completes.
70
+ * @event UpdateProductData
71
+ */
72
+ export declare const ROUTING_KEY_UPDATE_PRODUCT_DATA = "UpdateProductData";
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ /**
3
+ * UpdateProductData Action DTO
4
+ *
5
+ * UpdateProductData
6
+ *
7
+ * @module FieldServiceModule
8
+ * @entity WorkOrderStatusUpdate
9
+ * @actionKey UpdateProductData
10
+ * @event UpdateProductData
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.ROUTING_KEY_UPDATE_PRODUCT_DATA = exports.UpdateProductDataDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * UpdateProductData
19
+ *
20
+ * @actionType UPDATE - Updates an existing WorkOrderStatusUpdate record
21
+ * @module FieldServiceModule
22
+ * @entity WorkOrderStatusUpdate
23
+ * @event UpdateProductData
24
+ * @permission schema.action.updateproductdata.trigger
25
+ * @benchmark This action is tracked for performance benchmarks
26
+ */
27
+ class UpdateProductDataDto extends core_1.OdinRecordUpdateDto {
28
+ constructor(record, properties, options) {
29
+ super({
30
+ id: record.id,
31
+ entity: record.entity,
32
+ type: record.type,
33
+ properties,
34
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
35
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
36
+ });
37
+ this.actionName = 'UpdateProductData';
38
+ this.schemaActionId = '8f95fd98-6696-4a30-80b6-d1a4201969df';
39
+ this.entity = 'FieldServiceModule:WorkOrderStatusUpdate';
40
+ }
41
+ }
42
+ exports.UpdateProductDataDto = UpdateProductDataDto;
43
+ /** Used by SDK generators to identify action type */
44
+ UpdateProductDataDto.ACTION_TYPE = 'UPDATE';
45
+ UpdateProductDataDto.ACTION_KEY = 'UpdateProductData';
46
+ UpdateProductDataDto.MODULE_NAME = 'FieldServiceModule';
47
+ UpdateProductDataDto.ENTITIES = ['WorkOrderStatusUpdate'];
48
+ UpdateProductDataDto.EVENT_NAME = 'UpdateProductData';
49
+ UpdateProductDataDto.PERMISSION = 'schema.action.updateproductdata.trigger';
50
+ /**
51
+ * RabbitMQ routing key for UpdateProductData events
52
+ *
53
+ * Subscribe to this key to receive notifications when this action completes.
54
+ * @event UpdateProductData
55
+ */
56
+ exports.ROUTING_KEY_UPDATE_PRODUCT_DATA = 'UpdateProductData';
@@ -21,6 +21,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
21
21
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
22
22
  import { WorkOrderStatusUpdateProperties } from '../entities-v2/WorkOrderStatusUpdate';
23
23
  import { CreateWorkOrderStatusUpdateProperties } from '../actions-v2/CreateWorkOrderStatusUpdateDto';
24
+ import { UpdateProductDataProperties } from '../actions-v2/UpdateProductDataDto';
24
25
  import { WorkOrderRecord } from './WorkOrderRecord';
25
26
  /** Valid entity types for WorkOrderStatusUpdate */
26
27
  export declare type WorkOrderStatusUpdateType = 'AMCO_UPDATE' | 'DEFAULT' | 'ROYAL_MAIL_UPDATE';
@@ -130,6 +131,29 @@ export declare class WorkOrderStatusUpdateRecord {
130
131
  journeyId?: string;
131
132
  stageKey?: string;
132
133
  }): Promise<IDbRecordCreateUpdateRes[]>;
134
+ /**
135
+ * UpdateProductData
136
+ *
137
+ * Updates this WorkOrderStatusUpdate record.
138
+ *
139
+ * @param propertiesOrOptions - Properties to update, or options object
140
+ * @param options - Optional settings (journeyId, stageKey)
141
+ * @returns The updated record(s)
142
+ * @throws Error if called on a new (unsaved) record
143
+ *
144
+ * @example
145
+ * ```typescript
146
+ * const record = await odinClient.workOrderStatusUpdates.get(id);
147
+ * await record.updateProductData({ ... });
148
+ * ```
149
+ */
150
+ updateProductData(propertiesOrOptions?: UpdateProductDataProperties | {
151
+ journeyId?: string;
152
+ stageKey?: string;
153
+ }, options?: {
154
+ journeyId?: string;
155
+ stageKey?: string;
156
+ }): Promise<IDbRecordCreateUpdateRes[]>;
133
157
  }
134
158
  /** Type guard to check if an object is a WorkOrderStatusUpdateRecord */
135
159
  export declare function isWorkOrderStatusUpdateRecord(obj: any): obj is WorkOrderStatusUpdateRecord;
@@ -187,6 +187,45 @@ class WorkOrderStatusUpdateRecord {
187
187
  return result;
188
188
  });
189
189
  }
190
+ // ============================================
191
+ // UPDATE ACTIONS (require existing record)
192
+ // ============================================
193
+ /**
194
+ * UpdateProductData
195
+ *
196
+ * Updates this WorkOrderStatusUpdate record.
197
+ *
198
+ * @param propertiesOrOptions - Properties to update, or options object
199
+ * @param options - Optional settings (journeyId, stageKey)
200
+ * @returns The updated record(s)
201
+ * @throws Error if called on a new (unsaved) record
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * const record = await odinClient.workOrderStatusUpdates.get(id);
206
+ * await record.updateProductData({ ... });
207
+ * ```
208
+ */
209
+ updateProductData(propertiesOrOptions, options) {
210
+ var _a;
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
213
+ throw new Error('updateProductData requires an existing record. Use accessor.get() first.');
214
+ let properties = {};
215
+ let opts = options;
216
+ if (propertiesOrOptions) {
217
+ if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
218
+ opts = propertiesOrOptions;
219
+ }
220
+ else {
221
+ properties = propertiesOrOptions;
222
+ }
223
+ }
224
+ const result = yield this._provider._applyAction('FieldServiceModule', 'WorkOrderStatusUpdate', Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateProductData', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts));
225
+ this._pendingLinks = [];
226
+ return result;
227
+ });
228
+ }
190
229
  }
191
230
  exports.WorkOrderStatusUpdateRecord = WorkOrderStatusUpdateRecord;
192
231
  /** Type guard to check if an object is a WorkOrderStatusUpdateRecord */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "1.0.272",
3
+ "version": "1.0.273",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",