@d19n/youfibre-odin-sdk 2.0.10-beta.2 → 2.0.10-beta.3

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 CHANGED
@@ -352,7 +352,7 @@ This SDK includes **164** entities across **12** modules.
352
352
 
353
353
  ## Actions
354
354
 
355
- This SDK includes **561** actions.
355
+ This SDK includes **562** actions.
356
356
 
357
357
  ### Action Types
358
358
 
@@ -1716,6 +1716,7 @@ This SDK includes **561** actions.
1716
1716
  | Action | Type | Event |
1717
1717
  |--------|------|-------|
1718
1718
  | `NewAppointment` | CREATE | k1.t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Create.NewAppointment |
1719
+ | `UpdateSupplierReference` | UPDATE | k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference |
1719
1720
 
1720
1721
  #### Offer
1721
1722
 
@@ -0,0 +1,71 @@
1
+ /**
2
+ * UpdateSupplierReference Action DTO
3
+ *
4
+ * UpdateSupplierReference
5
+ *
6
+ * @module FieldServiceModule
7
+ * @entity ServiceAppointment
8
+ * @actionKey UpdateSupplierReference
9
+ * @event k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference
10
+ *
11
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
12
+ */
13
+ import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
14
+ /**
15
+ * RabbitMQ message payload for UpdateSupplierReference updated events
16
+ *
17
+ * @event k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference
18
+ */
19
+ export interface UpdateSupplierReferenceMessage extends OdinRecordUpdatedEvent<UpdateSupplierReferenceDto, UpdateSupplierReferenceProperties> {
20
+ }
21
+ /**
22
+ * Properties for UpdateSupplierReference action
23
+ *
24
+ * @property Required fields: 1
25
+ * @property Optional fields: 0
26
+ */
27
+ export interface UpdateSupplierReferenceProperties {
28
+ /**
29
+ * Supplier reference
30
+ *
31
+ * The reservation ID from the wholesale provider
32
+ * @type {TEXT}
33
+ * @required
34
+ */
35
+ SupplierReference: string;
36
+ }
37
+ /**
38
+ * UpdateSupplierReference
39
+ *
40
+ * @actionType UPDATE - Updates an existing ServiceAppointment record
41
+ * @module FieldServiceModule
42
+ * @entity ServiceAppointment
43
+ * @event k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference
44
+ * @permission schema.action.updatesupplierreference.trigger
45
+ * @benchmark This action is tracked for performance benchmarks
46
+ */
47
+ export declare class UpdateSupplierReferenceDto extends OdinRecordUpdateDto<UpdateSupplierReferenceProperties> {
48
+ /** Used by SDK generators to identify action type */
49
+ static readonly ACTION_TYPE = "UPDATE";
50
+ static readonly ACTION_KEY = "UpdateSupplierReference";
51
+ static readonly MODULE_NAME = "FieldServiceModule";
52
+ static readonly ENTITIES: string[];
53
+ static readonly EVENT_NAME = "k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference";
54
+ static readonly PERMISSION = "schema.action.updatesupplierreference.trigger";
55
+ /** Step metadata - entity this action targets */
56
+ static readonly STEP_ENTITY = "FieldServiceModule:ServiceAppointment";
57
+ static readonly STEP_SCHEMA_ID = "a4d7fc69-ad5c-4766-b250-8ad00c7c6a90";
58
+ static readonly STEP_SCHEMA_ACTION_ID = "3791bf45-3f30-4e6b-affe-8bfe431732b3";
59
+ static readonly AUTO_LINK_PARENT = false;
60
+ readonly actionName: string;
61
+ readonly schemaActionId: string;
62
+ readonly entity: string;
63
+ constructor(record: OdinRecord<any> | {
64
+ id: string;
65
+ entity: string;
66
+ type?: string;
67
+ }, properties: UpdateSupplierReferenceProperties, options?: {
68
+ journeyId?: string;
69
+ stageKey?: string;
70
+ });
71
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /**
3
+ * UpdateSupplierReference Action DTO
4
+ *
5
+ * UpdateSupplierReference
6
+ *
7
+ * @module FieldServiceModule
8
+ * @entity ServiceAppointment
9
+ * @actionKey UpdateSupplierReference
10
+ * @event k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.UpdateSupplierReferenceDto = void 0;
16
+ const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * UpdateSupplierReference
19
+ *
20
+ * @actionType UPDATE - Updates an existing ServiceAppointment record
21
+ * @module FieldServiceModule
22
+ * @entity ServiceAppointment
23
+ * @event k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference
24
+ * @permission schema.action.updatesupplierreference.trigger
25
+ * @benchmark This action is tracked for performance benchmarks
26
+ */
27
+ class UpdateSupplierReferenceDto 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 = 'UpdateSupplierReference';
38
+ this.schemaActionId = '3791bf45-3f30-4e6b-affe-8bfe431732b3';
39
+ this.entity = 'FieldServiceModule:ServiceAppointment';
40
+ }
41
+ }
42
+ exports.UpdateSupplierReferenceDto = UpdateSupplierReferenceDto;
43
+ /** Used by SDK generators to identify action type */
44
+ UpdateSupplierReferenceDto.ACTION_TYPE = 'UPDATE';
45
+ UpdateSupplierReferenceDto.ACTION_KEY = 'UpdateSupplierReference';
46
+ UpdateSupplierReferenceDto.MODULE_NAME = 'FieldServiceModule';
47
+ UpdateSupplierReferenceDto.ENTITIES = ['ServiceAppointment'];
48
+ UpdateSupplierReferenceDto.EVENT_NAME = 'k1.t-t-hEOJjsDb.FieldServiceModule.ServiceAppointment.Update.UpdateSupplierReference';
49
+ UpdateSupplierReferenceDto.PERMISSION = 'schema.action.updatesupplierreference.trigger';
50
+ /** Step metadata - entity this action targets */
51
+ UpdateSupplierReferenceDto.STEP_ENTITY = 'FieldServiceModule:ServiceAppointment';
52
+ UpdateSupplierReferenceDto.STEP_SCHEMA_ID = 'a4d7fc69-ad5c-4766-b250-8ad00c7c6a90';
53
+ UpdateSupplierReferenceDto.STEP_SCHEMA_ACTION_ID = '3791bf45-3f30-4e6b-affe-8bfe431732b3';
54
+ UpdateSupplierReferenceDto.AUTO_LINK_PARENT = false;
@@ -22,6 +22,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
22
22
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
23
23
  import { ServiceAppointmentProperties } from '../entities-v2/ServiceAppointment';
24
24
  import { NewAppointmentProperties } from '../actions-v2/NewAppointmentDto';
25
+ import { UpdateSupplierReferenceProperties } from '../actions-v2/UpdateSupplierReferenceDto';
25
26
  import { NoteRecord } from './NoteRecord';
26
27
  import { ServiceAppointmentConfigRecord } from './ServiceAppointmentConfigRecord';
27
28
  import { FileRecord } from './FileRecord';
@@ -239,6 +240,32 @@ export declare class ServiceAppointmentRecord<TProps = ServiceAppointmentPropert
239
240
  journeyId?: string;
240
241
  stageKey?: string;
241
242
  }): ActionBuilder;
243
+ /**
244
+ * UpdateSupplierReference
245
+ *
246
+ * Updates this ServiceAppointment record with the specified properties.
247
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
248
+ *
249
+ * @param properties - Required properties for this action
250
+ * @param options - Optional settings
251
+ * @param options.journeyId - Associate with a journey
252
+ * @param options.stageKey - Transition to pipeline stage
253
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
254
+ * @throws Error if called on a new (unsaved) record
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * const record = await odinClient.serviceAppointments.get(id);
259
+ * await record.updateSupplierReference({ ... }).execute();
260
+ *
261
+ * // Dry run (for debugging)
262
+ * const payload = record.updateSupplierReference({ ... }).dryRun();
263
+ * ```
264
+ */
265
+ updateSupplierReference(properties: UpdateSupplierReferenceProperties, options?: {
266
+ journeyId?: string;
267
+ stageKey?: string;
268
+ }): ActionBuilder;
242
269
  }
243
270
  /** Type guard to check if an object is a ServiceAppointmentRecord */
244
271
  export declare function isServiceAppointmentRecord(obj: any): obj is ServiceAppointmentRecord;
@@ -338,6 +338,38 @@ class ServiceAppointmentRecord {
338
338
  };
339
339
  return new ActionBuilder(this._provider, 'FieldServiceModule', 'ServiceAppointment', payload, () => { this._pendingLinks = []; });
340
340
  }
341
+ // ============================================
342
+ // UPDATE ACTIONS (require existing record)
343
+ // ============================================
344
+ /**
345
+ * UpdateSupplierReference
346
+ *
347
+ * Updates this ServiceAppointment record with the specified properties.
348
+ * Returns an ActionBuilder - call .execute() to update or .dryRun() for debugging.
349
+ *
350
+ * @param properties - Required properties for this action
351
+ * @param options - Optional settings
352
+ * @param options.journeyId - Associate with a journey
353
+ * @param options.stageKey - Transition to pipeline stage
354
+ * @returns ActionBuilder - call .execute() to update or .dryRun() for payload
355
+ * @throws Error if called on a new (unsaved) record
356
+ *
357
+ * @example
358
+ * ```typescript
359
+ * const record = await odinClient.serviceAppointments.get(id);
360
+ * await record.updateSupplierReference({ ... }).execute();
361
+ *
362
+ * // Dry run (for debugging)
363
+ * const payload = record.updateSupplierReference({ ... }).dryRun();
364
+ * ```
365
+ */
366
+ updateSupplierReference(properties, options) {
367
+ var _a;
368
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
369
+ throw new Error('updateSupplierReference requires an existing record. Use accessor.get() first.');
370
+ const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateSupplierReference', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, options);
371
+ return new ActionBuilder(this._provider, 'FieldServiceModule', 'ServiceAppointment', payload, () => { this._pendingLinks = []; });
372
+ }
341
373
  }
342
374
  exports.ServiceAppointmentRecord = ServiceAppointmentRecord;
343
375
  // ============================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.10-beta.2",
3
+ "version": "2.0.10-beta.3",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",