@d19n/youfibre-odin-sdk 2.0.233-beta.6 → 2.0.233-beta.7
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
|
@@ -1501,7 +1501,7 @@ This SDK includes **746** actions.
|
|
|
1501
1501
|
| `CreateModifyServiceRequest` | CREATE | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Create.CreateModifyServiceRequest |
|
|
1502
1502
|
| `MoveMsrToComplete` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1503
1503
|
| `MoveMsrToFailed` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1504
|
-
| `MoveMsrToHeld` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.
|
|
1504
|
+
| `MoveMsrToHeld` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1505
1505
|
| `MoveMsrToInProgress` | STAGE_TRANSITION | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1506
1506
|
| `UpdateModifyServiceRequest` | UPDATE | k1.t-hEOJjsDb.ServiceModule.ModifyServiceRequest.Update.UpdateModifyServiceRequest |
|
|
1507
1507
|
|
|
@@ -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 = "c33f6215-f398-4d02-a35a-ebcde2ee2669";
|
|
93
|
+
static readonly STEP_SCHEMA_ACTION_ID = "f4fb3994-062a-46f6-ad1b-badfa0bf3afa";
|
|
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 MoveMsrToHeld
|
|
18
112
|
*/
|
|
@@ -109,7 +203,7 @@ export declare class MoveMsrToHeldDto extends OdinRecordUpdateDto<Record<string,
|
|
|
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 MoveMsrToHeldDto.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.MoveMsrToHeldDto = exports.MoveMsrToHeldSteps = void 0;
|
|
16
|
+
exports.MoveMsrToHeldDto = exports.MoveMsrToHeldSteps = 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 = 'f4fb3994-062a-46f6-ad1b-badfa0bf3afa';
|
|
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 = 'c33f6215-f398-4d02-a35a-ebcde2ee2669';
|
|
54
|
+
UpdateModifyServiceRequestDto.STEP_SCHEMA_ACTION_ID = 'f4fb3994-062a-46f6-ad1b-badfa0bf3afa';
|
|
55
|
+
UpdateModifyServiceRequestDto.AUTO_LINK_PARENT = false;
|
|
18
56
|
/**
|
|
19
57
|
* Type-safe step keys for MoveMsrToHeld
|
|
20
58
|
*/
|
|
@@ -69,12 +107,12 @@ MoveMsrToHeldDto.HAS_STEP_LINKS = false;
|
|
|
69
107
|
MoveMsrToHeldDto.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
|
MoveMsrToHeldDto.Steps = exports.MoveMsrToHeldSteps;
|
|
79
117
|
/** Step classes that can be used with this action */
|
|
80
|
-
MoveMsrToHeldDto.stepClasses = [];
|
|
118
|
+
MoveMsrToHeldDto.stepClasses = ['UpdateModifyServiceRequestDto'];
|
|
@@ -212,6 +212,68 @@ export declare class MoveMsrToFailedFlowBuilder {
|
|
|
212
212
|
private _buildRequestPayload;
|
|
213
213
|
}
|
|
214
214
|
/** Options for a flow step */
|
|
215
|
+
export interface MoveMsrToHeldFlowBuilderStepOptions {
|
|
216
|
+
/** Associations to create with this step */
|
|
217
|
+
associations?: Array<{
|
|
218
|
+
recordId?: string;
|
|
219
|
+
entity?: string;
|
|
220
|
+
}>;
|
|
221
|
+
/** Groups for this step */
|
|
222
|
+
groups?: string[];
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* FlowBuilder for MoveMsrToHeld multi-step action
|
|
226
|
+
*
|
|
227
|
+
* Use method chaining to add steps, then call execute() to run the flow.
|
|
228
|
+
* Transitions to stage: ModifyServiceRequestStateStageHeld
|
|
229
|
+
*/
|
|
230
|
+
export declare class MoveMsrToHeldFlowBuilder {
|
|
231
|
+
private _record;
|
|
232
|
+
private _provider;
|
|
233
|
+
private _pendingLinks;
|
|
234
|
+
private _options?;
|
|
235
|
+
private _groups;
|
|
236
|
+
private _steps;
|
|
237
|
+
constructor(record: ModifyServiceRequestRecord<any>, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
238
|
+
journeyId?: string;
|
|
239
|
+
});
|
|
240
|
+
/**
|
|
241
|
+
* Add a group to the main action
|
|
242
|
+
* @param group - Group name to add
|
|
243
|
+
* @returns this (for method chaining)
|
|
244
|
+
*/
|
|
245
|
+
addGroup(group: string): this;
|
|
246
|
+
/**
|
|
247
|
+
* Add UpdateModifyServiceRequest step to the flow
|
|
248
|
+
* @param id - ID of the record to update
|
|
249
|
+
* @param properties - Properties for this step
|
|
250
|
+
* @param options - Optional step settings
|
|
251
|
+
* @returns this (for method chaining)
|
|
252
|
+
*/
|
|
253
|
+
updateModifyServiceRequest(id: string, properties: UpdateModifyServiceRequestProperties, options?: MoveMsrToHeldFlowBuilderStepOptions): this;
|
|
254
|
+
/**
|
|
255
|
+
* Execute the flow
|
|
256
|
+
* @returns The result from the API
|
|
257
|
+
*/
|
|
258
|
+
execute(): Promise<IDbRecordCreateUpdateRes[]>;
|
|
259
|
+
/**
|
|
260
|
+
* Returns the request payload without executing (for debugging)
|
|
261
|
+
* @returns The request payload that would be sent to the API
|
|
262
|
+
*/
|
|
263
|
+
dryRun(): Record<string, any>;
|
|
264
|
+
/**
|
|
265
|
+
* Prevents accidental `await flowBuilder` without .execute()
|
|
266
|
+
* Forces developers to explicitly call .execute()
|
|
267
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
268
|
+
*/
|
|
269
|
+
then(): never;
|
|
270
|
+
/**
|
|
271
|
+
* Build the request payload for the action
|
|
272
|
+
* @private
|
|
273
|
+
*/
|
|
274
|
+
private _buildRequestPayload;
|
|
275
|
+
}
|
|
276
|
+
/** Options for a flow step */
|
|
215
277
|
export interface MoveMsrToInProgressFlowBuilderStepOptions {
|
|
216
278
|
/** Associations to create with this step */
|
|
217
279
|
associations?: Array<{
|
|
@@ -484,28 +546,27 @@ export declare class ModifyServiceRequestRecord<TProps = ModifyServiceRequestPro
|
|
|
484
546
|
/**
|
|
485
547
|
* MoveMsrToHeld
|
|
486
548
|
*
|
|
487
|
-
*
|
|
488
|
-
*
|
|
549
|
+
* Starts a stage transition flow on this ModifyServiceRequest record.
|
|
550
|
+
* Chain step methods and call .execute() to run the flow.
|
|
489
551
|
*
|
|
490
552
|
* @remarks Transitions to stage: ModifyServiceRequestStateStageHeld
|
|
491
553
|
*
|
|
492
554
|
* @param options - Optional settings
|
|
493
555
|
* @param options.journeyId - Associate with a journey
|
|
494
|
-
* @returns
|
|
556
|
+
* @returns FlowBuilder for chaining step methods
|
|
495
557
|
* @throws Error if called on a new (unsaved) record
|
|
496
558
|
*
|
|
497
559
|
* @example
|
|
498
560
|
* ```typescript
|
|
499
561
|
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
500
|
-
* await record.moveMsrToHeld()
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
* const payload = record.moveMsrToHeld().dryRun();
|
|
562
|
+
* await record.moveMsrToHeld()
|
|
563
|
+
* .updateModifyServiceRequest(recordId, { ... })
|
|
564
|
+
* .execute();
|
|
504
565
|
* ```
|
|
505
566
|
*/
|
|
506
567
|
moveMsrToHeld(options?: {
|
|
507
568
|
journeyId?: string;
|
|
508
|
-
}):
|
|
569
|
+
}): MoveMsrToHeldFlowBuilder;
|
|
509
570
|
/**
|
|
510
571
|
* MoveMsrToInProgress
|
|
511
572
|
*
|
|
@@ -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.MoveMsrToFailedFlowBuilder = exports.MoveMsrToCompleteFlowBuilder = void 0;
|
|
31
|
+
exports.isModifyServiceRequestRecord = exports.ModifyServiceRequestRecord = exports.MoveMsrToInProgressFlowBuilder = exports.MoveMsrToHeldFlowBuilder = exports.MoveMsrToFailedFlowBuilder = exports.MoveMsrToCompleteFlowBuilder = 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");
|
|
@@ -324,6 +324,113 @@ class MoveMsrToFailedFlowBuilder {
|
|
|
324
324
|
}
|
|
325
325
|
}
|
|
326
326
|
exports.MoveMsrToFailedFlowBuilder = MoveMsrToFailedFlowBuilder;
|
|
327
|
+
/**
|
|
328
|
+
* FlowBuilder for MoveMsrToHeld multi-step action
|
|
329
|
+
*
|
|
330
|
+
* Use method chaining to add steps, then call execute() to run the flow.
|
|
331
|
+
* Transitions to stage: ModifyServiceRequestStateStageHeld
|
|
332
|
+
*/
|
|
333
|
+
class MoveMsrToHeldFlowBuilder {
|
|
334
|
+
constructor(record, provider, pendingLinks, options) {
|
|
335
|
+
this._groups = [];
|
|
336
|
+
this._steps = [];
|
|
337
|
+
this._record = record;
|
|
338
|
+
this._provider = provider;
|
|
339
|
+
this._pendingLinks = pendingLinks;
|
|
340
|
+
this._options = options;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Add a group to the main action
|
|
344
|
+
* @param group - Group name to add
|
|
345
|
+
* @returns this (for method chaining)
|
|
346
|
+
*/
|
|
347
|
+
addGroup(group) {
|
|
348
|
+
this._groups.push(group);
|
|
349
|
+
return this;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Add UpdateModifyServiceRequest step to the flow
|
|
353
|
+
* @param id - ID of the record to update
|
|
354
|
+
* @param properties - Properties for this step
|
|
355
|
+
* @param options - Optional step settings
|
|
356
|
+
* @returns this (for method chaining)
|
|
357
|
+
*/
|
|
358
|
+
updateModifyServiceRequest(id, properties, options) {
|
|
359
|
+
var _a;
|
|
360
|
+
this._steps.push({
|
|
361
|
+
actionName: 'UpdateModifyServiceRequest',
|
|
362
|
+
properties,
|
|
363
|
+
id,
|
|
364
|
+
entity: 'ServiceModule:ModifyServiceRequest',
|
|
365
|
+
autoLinkParent: false,
|
|
366
|
+
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 }))),
|
|
367
|
+
groups: options === null || options === void 0 ? void 0 : options.groups,
|
|
368
|
+
});
|
|
369
|
+
return this;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Execute the flow
|
|
373
|
+
* @returns The result from the API
|
|
374
|
+
*/
|
|
375
|
+
execute() {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
const payload = this._buildRequestPayload();
|
|
378
|
+
const result = yield this._provider._applyAction('ServiceModule', 'ModifyServiceRequest', payload);
|
|
379
|
+
// Clear pending links on the record after execution
|
|
380
|
+
this._record.clearPendingLinks();
|
|
381
|
+
return result;
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Returns the request payload without executing (for debugging)
|
|
386
|
+
* @returns The request payload that would be sent to the API
|
|
387
|
+
*/
|
|
388
|
+
dryRun() {
|
|
389
|
+
return this._buildRequestPayload();
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Prevents accidental `await flowBuilder` without .execute()
|
|
393
|
+
* Forces developers to explicitly call .execute()
|
|
394
|
+
* @throws Error always - use .execute() or .dryRun() instead
|
|
395
|
+
*/
|
|
396
|
+
then() {
|
|
397
|
+
throw new Error('FlowBuilder cannot be awaited directly. Call .execute() to run the flow or .dryRun() to get the payload.');
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Build the request payload for the action
|
|
401
|
+
* @private
|
|
402
|
+
*/
|
|
403
|
+
_buildRequestPayload() {
|
|
404
|
+
const record = this._record.record;
|
|
405
|
+
if (!(record === null || record === void 0 ? void 0 : record.id))
|
|
406
|
+
throw new Error('Cannot execute flow on unsaved record');
|
|
407
|
+
// Build steps with parent associations
|
|
408
|
+
const stepsWithAssociations = this._steps.map(step => {
|
|
409
|
+
const stepAssociations = [...(step.associations || [])];
|
|
410
|
+
// Auto-add parent association if step requires it
|
|
411
|
+
if (step.autoLinkParent) {
|
|
412
|
+
stepAssociations.push({
|
|
413
|
+
entity: record.entity,
|
|
414
|
+
recordId: record.id,
|
|
415
|
+
linkType: null,
|
|
416
|
+
relationType: 'PARENT',
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
return {
|
|
420
|
+
entity: step.entity,
|
|
421
|
+
type: step.type,
|
|
422
|
+
actionName: step.actionName,
|
|
423
|
+
properties: step.properties,
|
|
424
|
+
title: step.title,
|
|
425
|
+
id: step.id,
|
|
426
|
+
associations: stepAssociations.length > 0 ? stepAssociations : undefined,
|
|
427
|
+
groups: step.groups,
|
|
428
|
+
};
|
|
429
|
+
});
|
|
430
|
+
return Object.assign({ id: record.id, entity: record.entity, type: record.type, actionName: 'MoveMsrToHeld', steps: stepsWithAssociations, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined, stageKey: 'ModifyServiceRequestStateStageHeld' }, this._options);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
exports.MoveMsrToHeldFlowBuilder = MoveMsrToHeldFlowBuilder;
|
|
327
434
|
/**
|
|
328
435
|
* FlowBuilder for MoveMsrToInProgress multi-step action
|
|
329
436
|
*
|
|
@@ -715,31 +822,29 @@ class ModifyServiceRequestRecord {
|
|
|
715
822
|
/**
|
|
716
823
|
* MoveMsrToHeld
|
|
717
824
|
*
|
|
718
|
-
*
|
|
719
|
-
*
|
|
825
|
+
* Starts a stage transition flow on this ModifyServiceRequest record.
|
|
826
|
+
* Chain step methods and call .execute() to run the flow.
|
|
720
827
|
*
|
|
721
828
|
* @remarks Transitions to stage: ModifyServiceRequestStateStageHeld
|
|
722
829
|
*
|
|
723
830
|
* @param options - Optional settings
|
|
724
831
|
* @param options.journeyId - Associate with a journey
|
|
725
|
-
* @returns
|
|
832
|
+
* @returns FlowBuilder for chaining step methods
|
|
726
833
|
* @throws Error if called on a new (unsaved) record
|
|
727
834
|
*
|
|
728
835
|
* @example
|
|
729
836
|
* ```typescript
|
|
730
837
|
* const record = await odinClient.modifyServiceRequests.get(id);
|
|
731
|
-
* await record.moveMsrToHeld()
|
|
732
|
-
*
|
|
733
|
-
*
|
|
734
|
-
* const payload = record.moveMsrToHeld().dryRun();
|
|
838
|
+
* await record.moveMsrToHeld()
|
|
839
|
+
* .updateModifyServiceRequest(recordId, { ... })
|
|
840
|
+
* .execute();
|
|
735
841
|
* ```
|
|
736
842
|
*/
|
|
737
843
|
moveMsrToHeld(options) {
|
|
738
844
|
var _a;
|
|
739
845
|
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
740
846
|
throw new Error('moveMsrToHeld requires an existing record. Use accessor.get() first.');
|
|
741
|
-
|
|
742
|
-
return new ActionBuilder(this._provider, 'ServiceModule', 'ModifyServiceRequest', payload, () => { this._pendingLinks = []; });
|
|
847
|
+
return new MoveMsrToHeldFlowBuilder(this, this._provider, this._pendingLinks, options);
|
|
743
848
|
}
|
|
744
849
|
/**
|
|
745
850
|
* MoveMsrToInProgress
|