@d19n/youfibre-odin-sdk 2.0.247 → 2.0.248
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
|
@@ -1500,7 +1500,7 @@ This SDK includes **737** actions.
|
|
|
1500
1500
|
| Action | Type | Event |
|
|
1501
1501
|
|--------|------|-------|
|
|
1502
1502
|
| `CreateModifyServiceRequest` | CREATE | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Create.CreateModifyServiceRequest |
|
|
1503
|
-
| `MoveMsrToCancelled` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.
|
|
1503
|
+
| `MoveMsrToCancelled` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1504
1504
|
| `MoveMsrToComplete` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1505
1505
|
| `MoveMsrToFailed` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1506
1506
|
| `MoveMsrToHeld` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
@@ -12,7 +12,101 @@
|
|
|
12
12
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
13
|
*/
|
|
14
14
|
import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Properties for UpdateModifyServiceRequest action
|
|
17
|
+
*
|
|
18
|
+
* @property Required fields: 0
|
|
19
|
+
* @property Optional fields: 7
|
|
20
|
+
*/
|
|
21
|
+
export interface UpdateModifyServiceRequestProperties {
|
|
22
|
+
/**
|
|
23
|
+
* Service ID
|
|
24
|
+
*
|
|
25
|
+
* The ID of the service being modified
|
|
26
|
+
* @type {TEXT}
|
|
27
|
+
*/
|
|
28
|
+
ServiceId?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* SKU Previous
|
|
31
|
+
*
|
|
32
|
+
* The previous SKU being modified from (Used for Line Profile mapping)
|
|
33
|
+
* @type {TEXT}
|
|
34
|
+
*/
|
|
35
|
+
SkuPrevious?: string | null;
|
|
36
|
+
/**
|
|
37
|
+
* SKU Next
|
|
38
|
+
*
|
|
39
|
+
* The next SKU being modified to (Used for Line Profile mapping)
|
|
40
|
+
* @type {TEXT}
|
|
41
|
+
*/
|
|
42
|
+
SkuNext?: string | null;
|
|
43
|
+
/**
|
|
44
|
+
* FNO Modify Status
|
|
45
|
+
*
|
|
46
|
+
* FNO Modify Status
|
|
47
|
+
* @type {ENUM}
|
|
48
|
+
*/
|
|
49
|
+
FnoModifyStatus?: string | null;
|
|
50
|
+
/**
|
|
51
|
+
* FNO Comment
|
|
52
|
+
*
|
|
53
|
+
* FNO Comment
|
|
54
|
+
* @type {TEXT_LONG}
|
|
55
|
+
*/
|
|
56
|
+
FnoComment?: string | null;
|
|
57
|
+
/**
|
|
58
|
+
* ISP Modify Status
|
|
59
|
+
*
|
|
60
|
+
* ISP Modify Status
|
|
61
|
+
* @type {ENUM}
|
|
62
|
+
*/
|
|
63
|
+
IspModifyStatus?: string | null;
|
|
64
|
+
/**
|
|
65
|
+
* ISP Comment
|
|
66
|
+
*
|
|
67
|
+
* ISP Comment
|
|
68
|
+
* @type {TEXT_LONG}
|
|
69
|
+
*/
|
|
70
|
+
IspComment?: string | null;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* UpdateModifyServiceRequest
|
|
74
|
+
*
|
|
75
|
+
* @actionType UPDATE - Updates an existing ModifyServiceRequest record
|
|
76
|
+
* @module ServiceModule
|
|
77
|
+
* @entity ModifyServiceRequest
|
|
78
|
+
* @event k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest
|
|
79
|
+
* @permission schema.action.updatemodifyservicerequest.trigger
|
|
80
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
81
|
+
*/
|
|
82
|
+
export declare class UpdateModifyServiceRequestDto extends OdinRecordUpdateDto<UpdateModifyServiceRequestProperties> {
|
|
83
|
+
/** Used by SDK generators to identify action type */
|
|
84
|
+
static readonly ACTION_TYPE = "UPDATE";
|
|
85
|
+
static readonly ACTION_KEY = "UpdateModifyServiceRequest";
|
|
86
|
+
static readonly MODULE_NAME = "ServiceModule";
|
|
87
|
+
static readonly ENTITIES: string[];
|
|
88
|
+
static readonly EVENT_NAME = "k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest";
|
|
89
|
+
static readonly PERMISSION = "schema.action.updatemodifyservicerequest.trigger";
|
|
90
|
+
/** Step metadata - entity this action targets */
|
|
91
|
+
static readonly STEP_ENTITY = "ServiceModule:ModifyServiceRequest";
|
|
92
|
+
static readonly STEP_SCHEMA_ID = "e3ee21c4-f2bf-4931-867d-e02e70699221";
|
|
93
|
+
static readonly STEP_SCHEMA_ACTION_ID = "1065703e-e4d3-4010-bab0-4b0c08534c1d";
|
|
94
|
+
static readonly AUTO_LINK_PARENT = false;
|
|
95
|
+
readonly actionName: string;
|
|
96
|
+
readonly schemaActionId: string;
|
|
97
|
+
readonly entity: string;
|
|
98
|
+
constructor(record: OdinRecord<any> | {
|
|
99
|
+
id: string;
|
|
100
|
+
entity: string;
|
|
101
|
+
type?: string;
|
|
102
|
+
}, properties: UpdateModifyServiceRequestProperties, options?: {
|
|
103
|
+
journeyId?: string;
|
|
104
|
+
stageKey?: string;
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
declare type StepClassMap = {
|
|
108
|
+
UpdateModifyServiceRequestDto: UpdateModifyServiceRequestDto;
|
|
109
|
+
};
|
|
16
110
|
/**
|
|
17
111
|
* Link definition for connecting steps in MoveMsrToCancelled
|
|
18
112
|
*/
|
|
@@ -109,7 +203,7 @@ export declare class MoveMsrToCancelledDto extends OdinRecordUpdateDto<Record<st
|
|
|
109
203
|
journeyId?: string;
|
|
110
204
|
});
|
|
111
205
|
/** Step classes that can be used with this action */
|
|
112
|
-
static readonly stepClasses: readonly [];
|
|
206
|
+
static readonly stepClasses: readonly ["UpdateModifyServiceRequestDto"];
|
|
113
207
|
steps: StepClassMap[(typeof MoveMsrToCancelledDto.stepClasses)[number]][];
|
|
114
208
|
}
|
|
115
209
|
export {};
|
|
@@ -13,8 +13,46 @@
|
|
|
13
13
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.MoveMsrToCancelledDto = exports.MoveMsrToCancelledSteps = void 0;
|
|
16
|
+
exports.MoveMsrToCancelledDto = exports.MoveMsrToCancelledSteps = exports.UpdateModifyServiceRequestDto = void 0;
|
|
17
17
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
18
|
+
/**
|
|
19
|
+
* UpdateModifyServiceRequest
|
|
20
|
+
*
|
|
21
|
+
* @actionType UPDATE - Updates an existing ModifyServiceRequest record
|
|
22
|
+
* @module ServiceModule
|
|
23
|
+
* @entity ModifyServiceRequest
|
|
24
|
+
* @event k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest
|
|
25
|
+
* @permission schema.action.updatemodifyservicerequest.trigger
|
|
26
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
27
|
+
*/
|
|
28
|
+
class UpdateModifyServiceRequestDto extends core_1.OdinRecordUpdateDto {
|
|
29
|
+
constructor(record, properties, options) {
|
|
30
|
+
super({
|
|
31
|
+
id: record.id,
|
|
32
|
+
entity: record.entity,
|
|
33
|
+
type: record.type,
|
|
34
|
+
properties,
|
|
35
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
36
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
37
|
+
});
|
|
38
|
+
this.actionName = 'UpdateModifyServiceRequest';
|
|
39
|
+
this.schemaActionId = '1065703e-e4d3-4010-bab0-4b0c08534c1d';
|
|
40
|
+
this.entity = 'ServiceModule:ModifyServiceRequest';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.UpdateModifyServiceRequestDto = UpdateModifyServiceRequestDto;
|
|
44
|
+
/** Used by SDK generators to identify action type */
|
|
45
|
+
UpdateModifyServiceRequestDto.ACTION_TYPE = 'UPDATE';
|
|
46
|
+
UpdateModifyServiceRequestDto.ACTION_KEY = 'UpdateModifyServiceRequest';
|
|
47
|
+
UpdateModifyServiceRequestDto.MODULE_NAME = 'ServiceModule';
|
|
48
|
+
UpdateModifyServiceRequestDto.ENTITIES = ['ModifyServiceRequest'];
|
|
49
|
+
UpdateModifyServiceRequestDto.EVENT_NAME = 'k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest';
|
|
50
|
+
UpdateModifyServiceRequestDto.PERMISSION = 'schema.action.updatemodifyservicerequest.trigger';
|
|
51
|
+
/** Step metadata - entity this action targets */
|
|
52
|
+
UpdateModifyServiceRequestDto.STEP_ENTITY = 'ServiceModule:ModifyServiceRequest';
|
|
53
|
+
UpdateModifyServiceRequestDto.STEP_SCHEMA_ID = 'e3ee21c4-f2bf-4931-867d-e02e70699221';
|
|
54
|
+
UpdateModifyServiceRequestDto.STEP_SCHEMA_ACTION_ID = '1065703e-e4d3-4010-bab0-4b0c08534c1d';
|
|
55
|
+
UpdateModifyServiceRequestDto.AUTO_LINK_PARENT = false;
|
|
18
56
|
/**
|
|
19
57
|
* Type-safe step keys for MoveMsrToCancelled
|
|
20
58
|
*/
|
|
@@ -69,12 +107,12 @@ MoveMsrToCancelledDto.HAS_STEP_LINKS = false;
|
|
|
69
107
|
MoveMsrToCancelledDto.stepDefinitions = [
|
|
70
108
|
{
|
|
71
109
|
stepKey: 'step_1',
|
|
72
|
-
dtoClass: '
|
|
73
|
-
entity: '
|
|
110
|
+
dtoClass: 'UpdateModifyServiceRequestDto',
|
|
111
|
+
entity: 'ServiceModule:ModifyServiceRequest',
|
|
74
112
|
linksTo: null
|
|
75
113
|
}
|
|
76
114
|
];
|
|
77
115
|
/** Type-safe step key accessor */
|
|
78
116
|
MoveMsrToCancelledDto.Steps = exports.MoveMsrToCancelledSteps;
|
|
79
117
|
/** Step classes that can be used with this action */
|
|
80
|
-
MoveMsrToCancelledDto.stepClasses = [];
|
|
118
|
+
MoveMsrToCancelledDto.stepClasses = ['UpdateModifyServiceRequestDto'];
|
|
@@ -24,7 +24,7 @@ import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
|
24
24
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
25
|
import { ModifyServiceRequestProperties } from '../entities-v2/ModifyServiceRequest';
|
|
26
26
|
import { CreateModifyServiceRequestProperties } from '../actions-v2/CreateModifyServiceRequestDto';
|
|
27
|
-
import { UpdateModifyServiceRequestProperties } from '../actions-v2/
|
|
27
|
+
import { UpdateModifyServiceRequestProperties } from '../actions-v2/MoveMsrToCancelledDto';
|
|
28
28
|
import { OrderRecord } from './OrderRecord';
|
|
29
29
|
import { OrderKciRecord } from './OrderKciRecord';
|
|
30
30
|
/** Valid entity types for ModifyServiceRequest */
|
|
@@ -88,6 +88,68 @@ declare class ActionBuilder<T = IDbRecordCreateUpdateRes[]> {
|
|
|
88
88
|
then(): never;
|
|
89
89
|
}
|
|
90
90
|
/** Options for a flow step */
|
|
91
|
+
export interface MoveMsrToCancelledFlowBuilderStepOptions {
|
|
92
|
+
/** Associations to create with this step */
|
|
93
|
+
associations?: Array<{
|
|
94
|
+
recordId?: string;
|
|
95
|
+
entity?: string;
|
|
96
|
+
}>;
|
|
97
|
+
/** Groups for this step */
|
|
98
|
+
groups?: string[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* FlowBuilder for MoveMsrToCancelled multi-step action
|
|
102
|
+
*
|
|
103
|
+
* Use method chaining to add steps, then call execute() to run the flow.
|
|
104
|
+
* Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
105
|
+
*/
|
|
106
|
+
export declare class MoveMsrToCancelledFlowBuilder {
|
|
107
|
+
private _record;
|
|
108
|
+
private _provider;
|
|
109
|
+
private _pendingLinks;
|
|
110
|
+
private _options?;
|
|
111
|
+
private _groups;
|
|
112
|
+
private _steps;
|
|
113
|
+
constructor(record: ModifyServiceRequestRecord<any>, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
114
|
+
journeyId?: string;
|
|
115
|
+
});
|
|
116
|
+
/**
|
|
117
|
+
* Add a group to the main action
|
|
118
|
+
* @param group - Group name to add
|
|
119
|
+
* @returns this (for method chaining)
|
|
120
|
+
*/
|
|
121
|
+
addGroup(group: string): this;
|
|
122
|
+
/**
|
|
123
|
+
* Add UpdateModifyServiceRequest step to the flow
|
|
124
|
+
* @param id - ID of the record to update
|
|
125
|
+
* @param properties - Properties for this step
|
|
126
|
+
* @param options - Optional step settings
|
|
127
|
+
* @returns this (for method chaining)
|
|
128
|
+
*/
|
|
129
|
+
updateModifyServiceRequest(id: string, properties: UpdateModifyServiceRequestProperties, options?: MoveMsrToCancelledFlowBuilderStepOptions): this;
|
|
130
|
+
/**
|
|
131
|
+
* Execute the flow
|
|
132
|
+
* @returns The result from the API
|
|
133
|
+
*/
|
|
134
|
+
execute(): Promise<IDbRecordCreateUpdateRes[]>;
|
|
135
|
+
/**
|
|
136
|
+
* Returns the request payload without executing (for debugging)
|
|
137
|
+
* @returns The request payload that would be sent to the API
|
|
138
|
+
*/
|
|
139
|
+
dryRun(): Record<string, any>;
|
|
140
|
+
/**
|
|
141
|
+
* Prevents accidental `await flowBuilder` without .execute()
|
|
142
|
+
* Forces developers to explicitly call .execute()
|
|
143
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
144
|
+
*/
|
|
145
|
+
then(): never;
|
|
146
|
+
/**
|
|
147
|
+
* Build the request payload for the action
|
|
148
|
+
* @private
|
|
149
|
+
*/
|
|
150
|
+
private _buildRequestPayload;
|
|
151
|
+
}
|
|
152
|
+
/** Options for a flow step */
|
|
91
153
|
export interface MoveMsrToCompleteFlowBuilderStepOptions {
|
|
92
154
|
/** Associations to create with this step */
|
|
93
155
|
associations?: Array<{
|
|
@@ -468,31 +530,6 @@ export declare class ModifyServiceRequestRecord<TProps = ModifyServiceRequestPro
|
|
|
468
530
|
journeyId?: string;
|
|
469
531
|
stageKey?: string;
|
|
470
532
|
}): ActionBuilder;
|
|
471
|
-
/**
|
|
472
|
-
* MoveMsrToCancelled
|
|
473
|
-
*
|
|
474
|
-
* Transitions this ModifyServiceRequest record to a new pipeline stage.
|
|
475
|
-
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
476
|
-
*
|
|
477
|
-
* @remarks Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
478
|
-
*
|
|
479
|
-
* @param options - Optional settings
|
|
480
|
-
* @param options.journeyId - Associate with a journey
|
|
481
|
-
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
482
|
-
* @throws Error if called on a new (unsaved) record
|
|
483
|
-
*
|
|
484
|
-
* @example
|
|
485
|
-
* ```typescript
|
|
486
|
-
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
487
|
-
* await record.moveMsrToCancelled().execute();
|
|
488
|
-
*
|
|
489
|
-
* // Dry run (for debugging)
|
|
490
|
-
* const payload = record.moveMsrToCancelled().dryRun();
|
|
491
|
-
* ```
|
|
492
|
-
*/
|
|
493
|
-
moveMsrToCancelled(options?: {
|
|
494
|
-
journeyId?: string;
|
|
495
|
-
}): ActionBuilder;
|
|
496
533
|
/**
|
|
497
534
|
* UpdateModifyServiceRequest
|
|
498
535
|
*
|
|
@@ -520,6 +557,30 @@ export declare class ModifyServiceRequestRecord<TProps = ModifyServiceRequestPro
|
|
|
520
557
|
journeyId?: string;
|
|
521
558
|
stageKey?: string;
|
|
522
559
|
}): ActionBuilder;
|
|
560
|
+
/**
|
|
561
|
+
* MoveMsrToCancelled
|
|
562
|
+
*
|
|
563
|
+
* Starts a stage transition flow on this ModifyServiceRequest record.
|
|
564
|
+
* Chain step methods and call .execute() to run the flow.
|
|
565
|
+
*
|
|
566
|
+
* @remarks Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
567
|
+
*
|
|
568
|
+
* @param options - Optional settings
|
|
569
|
+
* @param options.journeyId - Associate with a journey
|
|
570
|
+
* @returns FlowBuilder for chaining step methods
|
|
571
|
+
* @throws Error if called on a new (unsaved) record
|
|
572
|
+
*
|
|
573
|
+
* @example
|
|
574
|
+
* ```typescript
|
|
575
|
+
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
576
|
+
* await record.moveMsrToCancelled()
|
|
577
|
+
* .updateModifyServiceRequest(recordId, { ... })
|
|
578
|
+
* .execute();
|
|
579
|
+
* ```
|
|
580
|
+
*/
|
|
581
|
+
moveMsrToCancelled(options?: {
|
|
582
|
+
journeyId?: string;
|
|
583
|
+
}): MoveMsrToCancelledFlowBuilder;
|
|
523
584
|
/**
|
|
524
585
|
* MoveMsrToComplete
|
|
525
586
|
*
|
|
@@ -28,7 +28,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
30
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
-
exports.isModifyServiceRequestRecord = exports.ModifyServiceRequestRecord = exports.MoveMsrToInProgressFlowBuilder = exports.MoveMsrToHeldFlowBuilder = exports.MoveMsrToFailedFlowBuilder = exports.MoveMsrToCompleteFlowBuilder = void 0;
|
|
31
|
+
exports.isModifyServiceRequestRecord = exports.ModifyServiceRequestRecord = exports.MoveMsrToInProgressFlowBuilder = exports.MoveMsrToHeldFlowBuilder = exports.MoveMsrToFailedFlowBuilder = exports.MoveMsrToCompleteFlowBuilder = exports.MoveMsrToCancelledFlowBuilder = void 0;
|
|
32
32
|
const uuid_1 = require("uuid");
|
|
33
33
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
34
34
|
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
@@ -110,6 +110,113 @@ class ActionBuilder {
|
|
|
110
110
|
throw new Error('ActionBuilder cannot be awaited directly. Call .execute() to run the action or .dryRun() to get the payload.');
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* FlowBuilder for MoveMsrToCancelled multi-step action
|
|
115
|
+
*
|
|
116
|
+
* Use method chaining to add steps, then call execute() to run the flow.
|
|
117
|
+
* Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
118
|
+
*/
|
|
119
|
+
class MoveMsrToCancelledFlowBuilder {
|
|
120
|
+
constructor(record, provider, pendingLinks, options) {
|
|
121
|
+
this._groups = [];
|
|
122
|
+
this._steps = [];
|
|
123
|
+
this._record = record;
|
|
124
|
+
this._provider = provider;
|
|
125
|
+
this._pendingLinks = pendingLinks;
|
|
126
|
+
this._options = options;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Add a group to the main action
|
|
130
|
+
* @param group - Group name to add
|
|
131
|
+
* @returns this (for method chaining)
|
|
132
|
+
*/
|
|
133
|
+
addGroup(group) {
|
|
134
|
+
this._groups.push(group);
|
|
135
|
+
return this;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Add UpdateModifyServiceRequest step to the flow
|
|
139
|
+
* @param id - ID of the record to update
|
|
140
|
+
* @param properties - Properties for this step
|
|
141
|
+
* @param options - Optional step settings
|
|
142
|
+
* @returns this (for method chaining)
|
|
143
|
+
*/
|
|
144
|
+
updateModifyServiceRequest(id, properties, options) {
|
|
145
|
+
var _a;
|
|
146
|
+
this._steps.push({
|
|
147
|
+
actionName: 'UpdateModifyServiceRequest',
|
|
148
|
+
properties,
|
|
149
|
+
id,
|
|
150
|
+
entity: 'ServiceModule:ModifyServiceRequest',
|
|
151
|
+
autoLinkParent: false,
|
|
152
|
+
associations: (_a = options === null || options === void 0 ? void 0 : options.associations) === null || _a === void 0 ? void 0 : _a.map(a => (Object.assign(Object.assign({}, a), { linkType: null, relationType: undefined }))),
|
|
153
|
+
groups: options === null || options === void 0 ? void 0 : options.groups,
|
|
154
|
+
});
|
|
155
|
+
return this;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Execute the flow
|
|
159
|
+
* @returns The result from the API
|
|
160
|
+
*/
|
|
161
|
+
execute() {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
const payload = this._buildRequestPayload();
|
|
164
|
+
const result = yield this._provider._applyAction('ServiceModule', 'ModifyServiceRequest', payload);
|
|
165
|
+
// Clear pending links on the record after execution
|
|
166
|
+
this._record.clearPendingLinks();
|
|
167
|
+
return result;
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Returns the request payload without executing (for debugging)
|
|
172
|
+
* @returns The request payload that would be sent to the API
|
|
173
|
+
*/
|
|
174
|
+
dryRun() {
|
|
175
|
+
return this._buildRequestPayload();
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Prevents accidental `await flowBuilder` without .execute()
|
|
179
|
+
* Forces developers to explicitly call .execute()
|
|
180
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
181
|
+
*/
|
|
182
|
+
then() {
|
|
183
|
+
throw new Error('FlowBuilder cannot be awaited directly. Call .execute() to run the flow or .dryRun() to get the payload.');
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Build the request payload for the action
|
|
187
|
+
* @private
|
|
188
|
+
*/
|
|
189
|
+
_buildRequestPayload() {
|
|
190
|
+
const record = this._record.record;
|
|
191
|
+
if (!(record === null || record === void 0 ? void 0 : record.id))
|
|
192
|
+
throw new Error('Cannot execute flow on unsaved record');
|
|
193
|
+
// Build steps with parent associations
|
|
194
|
+
const stepsWithAssociations = this._steps.map(step => {
|
|
195
|
+
const stepAssociations = [...(step.associations || [])];
|
|
196
|
+
// Auto-add parent association if step requires it
|
|
197
|
+
if (step.autoLinkParent) {
|
|
198
|
+
stepAssociations.push({
|
|
199
|
+
entity: record.entity,
|
|
200
|
+
recordId: record.id,
|
|
201
|
+
linkType: null,
|
|
202
|
+
relationType: 'PARENT',
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
entity: step.entity,
|
|
207
|
+
type: step.type,
|
|
208
|
+
actionName: step.actionName,
|
|
209
|
+
properties: step.properties,
|
|
210
|
+
title: step.title,
|
|
211
|
+
id: step.id,
|
|
212
|
+
associations: stepAssociations.length > 0 ? stepAssociations : undefined,
|
|
213
|
+
groups: step.groups,
|
|
214
|
+
};
|
|
215
|
+
});
|
|
216
|
+
return Object.assign({ id: record.id, entity: record.entity, type: record.type, actionName: 'MoveMsrToCancelled', steps: stepsWithAssociations, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined, stageKey: 'ModifyServiceRequestStateStageCancelled' }, this._options);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
exports.MoveMsrToCancelledFlowBuilder = MoveMsrToCancelledFlowBuilder;
|
|
113
220
|
/**
|
|
114
221
|
* FlowBuilder for MoveMsrToComplete multi-step action
|
|
115
222
|
*
|
|
@@ -728,35 +835,6 @@ class ModifyServiceRequestRecord {
|
|
|
728
835
|
// ============================================
|
|
729
836
|
// UPDATE ACTIONS (require existing record)
|
|
730
837
|
// ============================================
|
|
731
|
-
/**
|
|
732
|
-
* MoveMsrToCancelled
|
|
733
|
-
*
|
|
734
|
-
* Transitions this ModifyServiceRequest record to a new pipeline stage.
|
|
735
|
-
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
736
|
-
*
|
|
737
|
-
* @remarks Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
738
|
-
*
|
|
739
|
-
* @param options - Optional settings
|
|
740
|
-
* @param options.journeyId - Associate with a journey
|
|
741
|
-
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
742
|
-
* @throws Error if called on a new (unsaved) record
|
|
743
|
-
*
|
|
744
|
-
* @example
|
|
745
|
-
* ```typescript
|
|
746
|
-
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
747
|
-
* await record.moveMsrToCancelled().execute();
|
|
748
|
-
*
|
|
749
|
-
* // Dry run (for debugging)
|
|
750
|
-
* const payload = record.moveMsrToCancelled().dryRun();
|
|
751
|
-
* ```
|
|
752
|
-
*/
|
|
753
|
-
moveMsrToCancelled(options) {
|
|
754
|
-
var _a;
|
|
755
|
-
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
756
|
-
throw new Error('moveMsrToCancelled requires an existing record. Use accessor.get() first.');
|
|
757
|
-
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveMsrToCancelled', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'ModifyServiceRequestStateStageCancelled' }, options);
|
|
758
|
-
return new ActionBuilder(this._provider, 'ServiceModule', 'ModifyServiceRequest', payload, () => { this._pendingLinks = []; });
|
|
759
|
-
}
|
|
760
838
|
/**
|
|
761
839
|
* UpdateModifyServiceRequest
|
|
762
840
|
*
|
|
@@ -794,6 +872,33 @@ class ModifyServiceRequestRecord {
|
|
|
794
872
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'UpdateModifyServiceRequest', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts);
|
|
795
873
|
return new ActionBuilder(this._provider, 'ServiceModule', 'ModifyServiceRequest', payload, () => { this._pendingLinks = []; });
|
|
796
874
|
}
|
|
875
|
+
/**
|
|
876
|
+
* MoveMsrToCancelled
|
|
877
|
+
*
|
|
878
|
+
* Starts a stage transition flow on this ModifyServiceRequest record.
|
|
879
|
+
* Chain step methods and call .execute() to run the flow.
|
|
880
|
+
*
|
|
881
|
+
* @remarks Transitions to stage: ModifyServiceRequestStateStageCancelled
|
|
882
|
+
*
|
|
883
|
+
* @param options - Optional settings
|
|
884
|
+
* @param options.journeyId - Associate with a journey
|
|
885
|
+
* @returns FlowBuilder for chaining step methods
|
|
886
|
+
* @throws Error if called on a new (unsaved) record
|
|
887
|
+
*
|
|
888
|
+
* @example
|
|
889
|
+
* ```typescript
|
|
890
|
+
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
891
|
+
* await record.moveMsrToCancelled()
|
|
892
|
+
* .updateModifyServiceRequest(recordId, { ... })
|
|
893
|
+
* .execute();
|
|
894
|
+
* ```
|
|
895
|
+
*/
|
|
896
|
+
moveMsrToCancelled(options) {
|
|
897
|
+
var _a;
|
|
898
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
899
|
+
throw new Error('moveMsrToCancelled requires an existing record. Use accessor.get() first.');
|
|
900
|
+
return new MoveMsrToCancelledFlowBuilder(this, this._provider, this._pendingLinks, options);
|
|
901
|
+
}
|
|
797
902
|
/**
|
|
798
903
|
* MoveMsrToComplete
|
|
799
904
|
*
|