@d19n/youfibre-odin-sdk 2.0.129 → 2.0.130
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 +25 -2
- package/dist/actions-v2/CancelServiceWorkOrderFlowSupplierDto.d.ts +3 -120
- package/dist/actions-v2/CancelServiceWorkOrderFlowSupplierDto.js +2 -64
- package/dist/actions-v2/CompleteServiceWorkOrderFlowSupplierDto.d.ts +68 -0
- package/dist/actions-v2/CompleteServiceWorkOrderFlowSupplierDto.js +60 -0
- package/dist/actions-v2/CreateAgentCallLegDto.d.ts +9 -1
- package/dist/actions-v2/CreateCustomerCallLegDto.d.ts +9 -1
- package/dist/actions-v2/MoveServiceWorkOrderFromEnRouteToPendingSupplierDto.d.ts +65 -0
- package/dist/actions-v2/MoveServiceWorkOrderFromEnRouteToPendingSupplierDto.js +57 -0
- package/dist/actions-v2/MoveServiceWorkOrderFromInProgressToPendingSupplierDto.d.ts +65 -0
- package/dist/actions-v2/MoveServiceWorkOrderFromInProgressToPendingSupplierDto.js +57 -0
- package/dist/actions-v2/MoveServiceWorkOrderFromRemediationRequiredToPendingSupplierDto.d.ts +65 -0
- package/dist/actions-v2/MoveServiceWorkOrderFromRemediationRequiredToPendingSupplierDto.js +57 -0
- package/dist/actions-v2/MoveServiceWorkOrderToEnRouteSupplierDto.d.ts +65 -0
- package/dist/actions-v2/MoveServiceWorkOrderToEnRouteSupplierDto.js +57 -0
- package/dist/actions-v2/MoveServiceWorkOrderToInProgressSupplierDto.d.ts +65 -0
- package/dist/actions-v2/MoveServiceWorkOrderToInProgressSupplierDto.js +57 -0
- package/dist/actions-v2/MoveServiceWorkOrderToRemediationSupplierDto.d.ts +68 -0
- package/dist/actions-v2/MoveServiceWorkOrderToRemediationSupplierDto.js +60 -0
- package/dist/entities-v2/CallLeg.d.ts +8 -1
- package/dist/entities-v2/CallLeg.js +2 -0
- package/dist/records-v2/ChangeReasonRecord.d.ts +29 -29
- package/dist/records-v2/ChangeReasonRecord.js +36 -36
- package/dist/records-v2/WorkOrderRecord.d.ts +183 -70
- package/dist/records-v2/WorkOrderRecord.js +213 -113
- package/package.json +1 -1
|
@@ -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.isWorkOrderRecord = exports.WorkOrderRecord = exports.RescheduleServiceWorkOrderTenantFlowBuilder = exports.RescheduleServiceWorkOrderSupplierFlowBuilder = exports.RescheduleRemediationWorkOrderSupplierFlowBuilder = exports.ReschedulePrePullWorkOrderSupplierFlowBuilder = exports.RescheduleInstallWorkOrderTenantFlowBuilder = exports.RescheduleInspectionWorkOrderSupplierFlowBuilder = exports.RescheduleCollectionWorkOrderTenantFlowBuilder = exports.RescheduleBusinessInstallWorkOrderTenantFlowBuilder = exports.RescheduleBusinessInstallWorkOrderSupplierFlowBuilder = exports.MoveServiceWorkOrderToRemediationFlowBuilder = exports.MoveServiceWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveRemediationWorkOrderToRemediationFlowBuilder = exports.MoveRemediationWorkOrderToInProgressSubstantialFlowBuilder = exports.MovePrePullWorkOrderToRemediationFlowBuilder = exports.MovePrePullWorkOrderToInProgressSubstantialFlowBuilder = exports.MovePrePullWorkOrderToInProgressFlowBuilder = exports.MoveInstallWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveInstallWorkOrderToInProgressFlowBuilder = exports.MoveInspectionWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveInspectionWorkOrderToInProgressFlowBuilder = exports.MoveCollectionWorkOrderFromReceivedToCompleteFlowBuilder = exports.MoveCollectionWorkOrderFromAcceptedToEnRouteFlowBuilder = exports.MoveBusinessInstallToRemediationFlowBuilder = exports.CreateWayleaveWorkOrderFlowFlowBuilder = exports.CreateLinkedWorkOrderFlowFlowBuilder = exports.CreateCollectionAmcoReplacementWorkOrderFromWorkOrderFlowBuilder = exports.CompleteServiceWorkOrderFlowFlowBuilder = exports.CompleteRemediationWorkOrderFlowFlowBuilder = exports.CompletePrePullWorkOrderFlowFlowBuilder = exports.CancelServiceWorkOrderFlowTenantFlowBuilder = exports.
|
|
31
|
+
exports.isWorkOrderRecord = exports.WorkOrderRecord = exports.RescheduleServiceWorkOrderTenantFlowBuilder = exports.RescheduleServiceWorkOrderSupplierFlowBuilder = exports.RescheduleRemediationWorkOrderSupplierFlowBuilder = exports.ReschedulePrePullWorkOrderSupplierFlowBuilder = exports.RescheduleInstallWorkOrderTenantFlowBuilder = exports.RescheduleInspectionWorkOrderSupplierFlowBuilder = exports.RescheduleCollectionWorkOrderTenantFlowBuilder = exports.RescheduleBusinessInstallWorkOrderTenantFlowBuilder = exports.RescheduleBusinessInstallWorkOrderSupplierFlowBuilder = exports.MoveServiceWorkOrderToRemediationFlowBuilder = exports.MoveServiceWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveRemediationWorkOrderToRemediationFlowBuilder = exports.MoveRemediationWorkOrderToInProgressSubstantialFlowBuilder = exports.MovePrePullWorkOrderToRemediationFlowBuilder = exports.MovePrePullWorkOrderToInProgressSubstantialFlowBuilder = exports.MovePrePullWorkOrderToInProgressFlowBuilder = exports.MoveInstallWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveInstallWorkOrderToInProgressFlowBuilder = exports.MoveInspectionWorkOrderToInProgressSubstantialFlowBuilder = exports.MoveInspectionWorkOrderToInProgressFlowBuilder = exports.MoveCollectionWorkOrderFromReceivedToCompleteFlowBuilder = exports.MoveCollectionWorkOrderFromAcceptedToEnRouteFlowBuilder = exports.MoveBusinessInstallToRemediationFlowBuilder = exports.CreateWayleaveWorkOrderFlowFlowBuilder = exports.CreateLinkedWorkOrderFlowFlowBuilder = exports.CreateCollectionAmcoReplacementWorkOrderFromWorkOrderFlowBuilder = exports.CompleteServiceWorkOrderFlowFlowBuilder = exports.CompleteRemediationWorkOrderFlowFlowBuilder = exports.CompletePrePullWorkOrderFlowFlowBuilder = exports.CancelServiceWorkOrderFlowTenantFlowBuilder = exports.CancelRemediationWorkOrderSupplierFlowBuilder = exports.CancelPrePullWorkOrderFlowSupplierFlowBuilder = exports.CancelInstallWorkOrderFlowTenantFlowBuilder = 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");
|
|
@@ -459,111 +459,6 @@ class CancelRemediationWorkOrderSupplierFlowBuilder {
|
|
|
459
459
|
}
|
|
460
460
|
}
|
|
461
461
|
exports.CancelRemediationWorkOrderSupplierFlowBuilder = CancelRemediationWorkOrderSupplierFlowBuilder;
|
|
462
|
-
/**
|
|
463
|
-
* FlowBuilder for CancelServiceWorkOrderFlowSupplier multi-step action
|
|
464
|
-
*
|
|
465
|
-
* Use method chaining to add steps, then call execute() to run the flow.
|
|
466
|
-
* This is a CREATE flow - no existing record required.
|
|
467
|
-
* Transitions to stage: WorkOrderStageCancelled
|
|
468
|
-
*/
|
|
469
|
-
class CancelServiceWorkOrderFlowSupplierFlowBuilder {
|
|
470
|
-
constructor(record, provider, pendingLinks, options) {
|
|
471
|
-
this._groups = [];
|
|
472
|
-
this._steps = [];
|
|
473
|
-
this._record = record;
|
|
474
|
-
this._provider = provider;
|
|
475
|
-
this._pendingLinks = pendingLinks;
|
|
476
|
-
this._options = options;
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Add a group to the main action
|
|
480
|
-
* @param group - Group name to add
|
|
481
|
-
* @returns this (for method chaining)
|
|
482
|
-
*/
|
|
483
|
-
addGroup(group) {
|
|
484
|
-
this._groups.push(group);
|
|
485
|
-
return this;
|
|
486
|
-
}
|
|
487
|
-
/**
|
|
488
|
-
* Add CreateServiceCancelledChangeReasonSupplier step to the flow
|
|
489
|
-
* @param properties - Properties for this step
|
|
490
|
-
* @param options - Optional step settings
|
|
491
|
-
* @returns this (for method chaining)
|
|
492
|
-
*/
|
|
493
|
-
createServiceCancelledChangeReasonSupplier(properties, options) {
|
|
494
|
-
var _a;
|
|
495
|
-
this._steps.push({
|
|
496
|
-
actionName: 'CreateServiceCancelledChangeReasonSupplier',
|
|
497
|
-
properties,
|
|
498
|
-
entity: 'FieldServiceModule:ChangeReason',
|
|
499
|
-
type: 'SA_CANCEL',
|
|
500
|
-
autoLinkParent: true,
|
|
501
|
-
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 }))),
|
|
502
|
-
groups: options === null || options === void 0 ? void 0 : options.groups,
|
|
503
|
-
});
|
|
504
|
-
return this;
|
|
505
|
-
}
|
|
506
|
-
/**
|
|
507
|
-
* Execute the flow
|
|
508
|
-
* @returns The result from the API
|
|
509
|
-
*/
|
|
510
|
-
execute() {
|
|
511
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
512
|
-
const payload = this._buildRequestPayload();
|
|
513
|
-
const result = yield this._provider._applyAction('FieldServiceModule', 'WorkOrder', payload);
|
|
514
|
-
// Clear pending links on the record after execution
|
|
515
|
-
this._record.clearPendingLinks();
|
|
516
|
-
return result;
|
|
517
|
-
});
|
|
518
|
-
}
|
|
519
|
-
/**
|
|
520
|
-
* Returns the request payload without executing (for debugging)
|
|
521
|
-
* @returns The request payload that would be sent to the API
|
|
522
|
-
*/
|
|
523
|
-
dryRun() {
|
|
524
|
-
return this._buildRequestPayload();
|
|
525
|
-
}
|
|
526
|
-
/**
|
|
527
|
-
* Prevents accidental `await flowBuilder` without .execute()
|
|
528
|
-
* Forces developers to explicitly call .execute()
|
|
529
|
-
* @throws Error always - use .execute() or .dryRun() instead
|
|
530
|
-
*/
|
|
531
|
-
then() {
|
|
532
|
-
throw new Error('FlowBuilder cannot be awaited directly. Call .execute() to run the flow or .dryRun() to get the payload.');
|
|
533
|
-
}
|
|
534
|
-
/**
|
|
535
|
-
* Build the request payload for the action
|
|
536
|
-
* @private
|
|
537
|
-
*/
|
|
538
|
-
_buildRequestPayload() {
|
|
539
|
-
const record = this._record.record;
|
|
540
|
-
// Build steps with parent associations
|
|
541
|
-
const stepsWithAssociations = this._steps.map(step => {
|
|
542
|
-
const stepAssociations = [...(step.associations || [])];
|
|
543
|
-
// Auto-add parent association if step requires it and we have a parent record
|
|
544
|
-
if (step.autoLinkParent && (record === null || record === void 0 ? void 0 : record.id)) {
|
|
545
|
-
stepAssociations.push({
|
|
546
|
-
entity: record.entity,
|
|
547
|
-
recordId: record.id,
|
|
548
|
-
linkType: null,
|
|
549
|
-
relationType: 'PARENT',
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
return {
|
|
553
|
-
entity: step.entity,
|
|
554
|
-
type: step.type,
|
|
555
|
-
actionName: step.actionName,
|
|
556
|
-
properties: step.properties,
|
|
557
|
-
title: step.title,
|
|
558
|
-
id: step.id,
|
|
559
|
-
associations: stepAssociations.length > 0 ? stepAssociations : undefined,
|
|
560
|
-
groups: step.groups,
|
|
561
|
-
};
|
|
562
|
-
});
|
|
563
|
-
return Object.assign(Object.assign(Object.assign({}, ((record === null || record === void 0 ? void 0 : record.id) && { id: record.id })), { entity: 'FieldServiceModule:WorkOrder', actionName: 'CancelServiceWorkOrderFlowSupplier', steps: stepsWithAssociations, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, groups: this._groups.length > 0 ? this._groups : undefined, stageKey: 'WorkOrderStageCancelled' }), this._options);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
exports.CancelServiceWorkOrderFlowSupplierFlowBuilder = CancelServiceWorkOrderFlowSupplierFlowBuilder;
|
|
567
462
|
/**
|
|
568
463
|
* FlowBuilder for CancelServiceWorkOrderFlowTenant multi-step action
|
|
569
464
|
*
|
|
@@ -6245,29 +6140,31 @@ class WorkOrderRecord {
|
|
|
6245
6140
|
/**
|
|
6246
6141
|
* CancelServiceWorkOrderFlowSupplier
|
|
6247
6142
|
*
|
|
6248
|
-
*
|
|
6249
|
-
*
|
|
6143
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6144
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6250
6145
|
*
|
|
6251
6146
|
* @remarks Transitions to stage: WorkOrderStageCancelled
|
|
6252
6147
|
*
|
|
6253
6148
|
* @param options - Optional settings
|
|
6254
6149
|
* @param options.journeyId - Associate with a journey
|
|
6255
|
-
* @returns
|
|
6150
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6256
6151
|
* @throws Error if called on a new (unsaved) record
|
|
6257
6152
|
*
|
|
6258
6153
|
* @example
|
|
6259
6154
|
* ```typescript
|
|
6260
6155
|
* const record = await odinClient.workOrders.get(id);
|
|
6261
|
-
* await record.cancelServiceWorkOrderFlowSupplier()
|
|
6262
|
-
*
|
|
6263
|
-
*
|
|
6156
|
+
* await record.cancelServiceWorkOrderFlowSupplier().execute();
|
|
6157
|
+
*
|
|
6158
|
+
* // Dry run (for debugging)
|
|
6159
|
+
* const payload = record.cancelServiceWorkOrderFlowSupplier().dryRun();
|
|
6264
6160
|
* ```
|
|
6265
6161
|
*/
|
|
6266
6162
|
cancelServiceWorkOrderFlowSupplier(options) {
|
|
6267
6163
|
var _a;
|
|
6268
6164
|
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
6269
6165
|
throw new Error('cancelServiceWorkOrderFlowSupplier requires an existing record. Use accessor.get() first.');
|
|
6270
|
-
|
|
6166
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'CancelServiceWorkOrderFlowSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderStageCancelled' }, options);
|
|
6167
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
6271
6168
|
}
|
|
6272
6169
|
/**
|
|
6273
6170
|
* CancelServiceWorkOrderFlowTenant
|
|
@@ -6616,6 +6513,35 @@ class WorkOrderRecord {
|
|
|
6616
6513
|
throw new Error('completeServiceWorkOrderFlow requires an existing record. Use accessor.get() first.');
|
|
6617
6514
|
return new CompleteServiceWorkOrderFlowFlowBuilder(this, this._provider, this._pendingLinks, options);
|
|
6618
6515
|
}
|
|
6516
|
+
/**
|
|
6517
|
+
* CompleteServiceWorkOrderFlowSupplier
|
|
6518
|
+
*
|
|
6519
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
6520
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
6521
|
+
*
|
|
6522
|
+
* @remarks Transitions to stage: WorkOrderStageDone
|
|
6523
|
+
*
|
|
6524
|
+
* @param options - Optional settings
|
|
6525
|
+
* @param options.journeyId - Associate with a journey
|
|
6526
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
6527
|
+
* @throws Error if called on a new (unsaved) record
|
|
6528
|
+
*
|
|
6529
|
+
* @example
|
|
6530
|
+
* ```typescript
|
|
6531
|
+
* const record = await odinClient.workOrders.get(id);
|
|
6532
|
+
* await record.completeServiceWorkOrderFlowSupplier().execute();
|
|
6533
|
+
*
|
|
6534
|
+
* // Dry run (for debugging)
|
|
6535
|
+
* const payload = record.completeServiceWorkOrderFlowSupplier().dryRun();
|
|
6536
|
+
* ```
|
|
6537
|
+
*/
|
|
6538
|
+
completeServiceWorkOrderFlowSupplier(options) {
|
|
6539
|
+
var _a;
|
|
6540
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
6541
|
+
throw new Error('completeServiceWorkOrderFlowSupplier requires an existing record. Use accessor.get() first.');
|
|
6542
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'CompleteServiceWorkOrderFlowSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderStageDone' }, options);
|
|
6543
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
6544
|
+
}
|
|
6619
6545
|
/**
|
|
6620
6546
|
* CreateCollectionAmcoReplacementWorkOrderFromWorkOrder
|
|
6621
6547
|
*
|
|
@@ -9119,6 +9045,35 @@ class WorkOrderRecord {
|
|
|
9119
9045
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromEnRouteToPending', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9120
9046
|
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9121
9047
|
}
|
|
9048
|
+
/**
|
|
9049
|
+
* MoveServiceWorkOrderFromEnRouteToPendingSupplier
|
|
9050
|
+
*
|
|
9051
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9052
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9053
|
+
*
|
|
9054
|
+
* @remarks Transitions to stage: CustomerWorkOrdersStagePending
|
|
9055
|
+
*
|
|
9056
|
+
* @param options - Optional settings
|
|
9057
|
+
* @param options.journeyId - Associate with a journey
|
|
9058
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9059
|
+
* @throws Error if called on a new (unsaved) record
|
|
9060
|
+
*
|
|
9061
|
+
* @example
|
|
9062
|
+
* ```typescript
|
|
9063
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9064
|
+
* await record.moveServiceWorkOrderFromEnRouteToPendingSupplier().execute();
|
|
9065
|
+
*
|
|
9066
|
+
* // Dry run (for debugging)
|
|
9067
|
+
* const payload = record.moveServiceWorkOrderFromEnRouteToPendingSupplier().dryRun();
|
|
9068
|
+
* ```
|
|
9069
|
+
*/
|
|
9070
|
+
moveServiceWorkOrderFromEnRouteToPendingSupplier(options) {
|
|
9071
|
+
var _a;
|
|
9072
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9073
|
+
throw new Error('moveServiceWorkOrderFromEnRouteToPendingSupplier requires an existing record. Use accessor.get() first.');
|
|
9074
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromEnRouteToPendingSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9075
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9076
|
+
}
|
|
9122
9077
|
/**
|
|
9123
9078
|
* MoveServiceWorkOrderFromInProgressToPending
|
|
9124
9079
|
*
|
|
@@ -9148,6 +9103,35 @@ class WorkOrderRecord {
|
|
|
9148
9103
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromInProgressToPending', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9149
9104
|
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9150
9105
|
}
|
|
9106
|
+
/**
|
|
9107
|
+
* MoveServiceWorkOrderFromInProgressToPendingSupplier
|
|
9108
|
+
*
|
|
9109
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9110
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9111
|
+
*
|
|
9112
|
+
* @remarks Transitions to stage: CustomerWorkOrdersStagePending
|
|
9113
|
+
*
|
|
9114
|
+
* @param options - Optional settings
|
|
9115
|
+
* @param options.journeyId - Associate with a journey
|
|
9116
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9117
|
+
* @throws Error if called on a new (unsaved) record
|
|
9118
|
+
*
|
|
9119
|
+
* @example
|
|
9120
|
+
* ```typescript
|
|
9121
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9122
|
+
* await record.moveServiceWorkOrderFromInProgressToPendingSupplier().execute();
|
|
9123
|
+
*
|
|
9124
|
+
* // Dry run (for debugging)
|
|
9125
|
+
* const payload = record.moveServiceWorkOrderFromInProgressToPendingSupplier().dryRun();
|
|
9126
|
+
* ```
|
|
9127
|
+
*/
|
|
9128
|
+
moveServiceWorkOrderFromInProgressToPendingSupplier(options) {
|
|
9129
|
+
var _a;
|
|
9130
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9131
|
+
throw new Error('moveServiceWorkOrderFromInProgressToPendingSupplier requires an existing record. Use accessor.get() first.');
|
|
9132
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromInProgressToPendingSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9133
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9134
|
+
}
|
|
9151
9135
|
/**
|
|
9152
9136
|
* MoveServiceWorkOrderFromRemediationRequiredToPending
|
|
9153
9137
|
*
|
|
@@ -9177,6 +9161,35 @@ class WorkOrderRecord {
|
|
|
9177
9161
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromRemediationRequiredToPending', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9178
9162
|
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9179
9163
|
}
|
|
9164
|
+
/**
|
|
9165
|
+
* MoveServiceWorkOrderFromRemediationRequiredToPendingSupplier
|
|
9166
|
+
*
|
|
9167
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9168
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9169
|
+
*
|
|
9170
|
+
* @remarks Transitions to stage: CustomerWorkOrdersStagePending
|
|
9171
|
+
*
|
|
9172
|
+
* @param options - Optional settings
|
|
9173
|
+
* @param options.journeyId - Associate with a journey
|
|
9174
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9175
|
+
* @throws Error if called on a new (unsaved) record
|
|
9176
|
+
*
|
|
9177
|
+
* @example
|
|
9178
|
+
* ```typescript
|
|
9179
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9180
|
+
* await record.moveServiceWorkOrderFromRemediationRequiredToPendingSupplier().execute();
|
|
9181
|
+
*
|
|
9182
|
+
* // Dry run (for debugging)
|
|
9183
|
+
* const payload = record.moveServiceWorkOrderFromRemediationRequiredToPendingSupplier().dryRun();
|
|
9184
|
+
* ```
|
|
9185
|
+
*/
|
|
9186
|
+
moveServiceWorkOrderFromRemediationRequiredToPendingSupplier(options) {
|
|
9187
|
+
var _a;
|
|
9188
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9189
|
+
throw new Error('moveServiceWorkOrderFromRemediationRequiredToPendingSupplier requires an existing record. Use accessor.get() first.');
|
|
9190
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderFromRemediationRequiredToPendingSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'CustomerWorkOrdersStagePending' }, options);
|
|
9191
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9192
|
+
}
|
|
9180
9193
|
/**
|
|
9181
9194
|
* MoveServiceWorkOrderToCancelled
|
|
9182
9195
|
*
|
|
@@ -9235,6 +9248,35 @@ class WorkOrderRecord {
|
|
|
9235
9248
|
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderToEnRoute', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderStageEnRoute' }, options);
|
|
9236
9249
|
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9237
9250
|
}
|
|
9251
|
+
/**
|
|
9252
|
+
* MoveServiceWorkOrderToEnRouteSupplier
|
|
9253
|
+
*
|
|
9254
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9255
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9256
|
+
*
|
|
9257
|
+
* @remarks Transitions to stage: WorkOrderStageEnRoute
|
|
9258
|
+
*
|
|
9259
|
+
* @param options - Optional settings
|
|
9260
|
+
* @param options.journeyId - Associate with a journey
|
|
9261
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9262
|
+
* @throws Error if called on a new (unsaved) record
|
|
9263
|
+
*
|
|
9264
|
+
* @example
|
|
9265
|
+
* ```typescript
|
|
9266
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9267
|
+
* await record.moveServiceWorkOrderToEnRouteSupplier().execute();
|
|
9268
|
+
*
|
|
9269
|
+
* // Dry run (for debugging)
|
|
9270
|
+
* const payload = record.moveServiceWorkOrderToEnRouteSupplier().dryRun();
|
|
9271
|
+
* ```
|
|
9272
|
+
*/
|
|
9273
|
+
moveServiceWorkOrderToEnRouteSupplier(options) {
|
|
9274
|
+
var _a;
|
|
9275
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9276
|
+
throw new Error('moveServiceWorkOrderToEnRouteSupplier requires an existing record. Use accessor.get() first.');
|
|
9277
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderToEnRouteSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderStageEnRoute' }, options);
|
|
9278
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9279
|
+
}
|
|
9238
9280
|
/**
|
|
9239
9281
|
* MoveServiceWorkOrderToInProgress
|
|
9240
9282
|
*
|
|
@@ -9291,6 +9333,35 @@ class WorkOrderRecord {
|
|
|
9291
9333
|
throw new Error('moveServiceWorkOrderToInProgressSubstantial requires an existing record. Use accessor.get() first.');
|
|
9292
9334
|
return new MoveServiceWorkOrderToInProgressSubstantialFlowBuilder(this, this._provider, this._pendingLinks, options);
|
|
9293
9335
|
}
|
|
9336
|
+
/**
|
|
9337
|
+
* MoveServiceWorkOrderToInProgressSupplier
|
|
9338
|
+
*
|
|
9339
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9340
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9341
|
+
*
|
|
9342
|
+
* @remarks Transitions to stage: WorkOrderStageInProgress
|
|
9343
|
+
*
|
|
9344
|
+
* @param options - Optional settings
|
|
9345
|
+
* @param options.journeyId - Associate with a journey
|
|
9346
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9347
|
+
* @throws Error if called on a new (unsaved) record
|
|
9348
|
+
*
|
|
9349
|
+
* @example
|
|
9350
|
+
* ```typescript
|
|
9351
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9352
|
+
* await record.moveServiceWorkOrderToInProgressSupplier().execute();
|
|
9353
|
+
*
|
|
9354
|
+
* // Dry run (for debugging)
|
|
9355
|
+
* const payload = record.moveServiceWorkOrderToInProgressSupplier().dryRun();
|
|
9356
|
+
* ```
|
|
9357
|
+
*/
|
|
9358
|
+
moveServiceWorkOrderToInProgressSupplier(options) {
|
|
9359
|
+
var _a;
|
|
9360
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9361
|
+
throw new Error('moveServiceWorkOrderToInProgressSupplier requires an existing record. Use accessor.get() first.');
|
|
9362
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderToInProgressSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderStageInProgress' }, options);
|
|
9363
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9364
|
+
}
|
|
9294
9365
|
/**
|
|
9295
9366
|
* MoveServiceWorkOrderToRemediation
|
|
9296
9367
|
*
|
|
@@ -9319,6 +9390,35 @@ class WorkOrderRecord {
|
|
|
9319
9390
|
throw new Error('moveServiceWorkOrderToRemediation requires an existing record. Use accessor.get() first.');
|
|
9320
9391
|
return new MoveServiceWorkOrderToRemediationFlowBuilder(this, this._provider, this._pendingLinks, options);
|
|
9321
9392
|
}
|
|
9393
|
+
/**
|
|
9394
|
+
* MoveServiceWorkOrderToRemediationSupplier
|
|
9395
|
+
*
|
|
9396
|
+
* Transitions this WorkOrder record to a new pipeline stage.
|
|
9397
|
+
* Returns an ActionBuilder - call .execute() to transition or .dryRun() for debugging.
|
|
9398
|
+
*
|
|
9399
|
+
* @remarks Transitions to stage: WorkOrderRemediationRequired
|
|
9400
|
+
*
|
|
9401
|
+
* @param options - Optional settings
|
|
9402
|
+
* @param options.journeyId - Associate with a journey
|
|
9403
|
+
* @returns ActionBuilder - call .execute() to transition or .dryRun() for payload
|
|
9404
|
+
* @throws Error if called on a new (unsaved) record
|
|
9405
|
+
*
|
|
9406
|
+
* @example
|
|
9407
|
+
* ```typescript
|
|
9408
|
+
* const record = await odinClient.workOrders.get(id);
|
|
9409
|
+
* await record.moveServiceWorkOrderToRemediationSupplier().execute();
|
|
9410
|
+
*
|
|
9411
|
+
* // Dry run (for debugging)
|
|
9412
|
+
* const payload = record.moveServiceWorkOrderToRemediationSupplier().dryRun();
|
|
9413
|
+
* ```
|
|
9414
|
+
*/
|
|
9415
|
+
moveServiceWorkOrderToRemediationSupplier(options) {
|
|
9416
|
+
var _a;
|
|
9417
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
9418
|
+
throw new Error('moveServiceWorkOrderToRemediationSupplier requires an existing record. Use accessor.get() first.');
|
|
9419
|
+
const payload = Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'MoveServiceWorkOrderToRemediationSupplier', associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined, stageKey: 'WorkOrderRemediationRequired' }, options);
|
|
9420
|
+
return new ActionBuilder(this._provider, 'FieldServiceModule', 'WorkOrder', payload, () => { this._pendingLinks = []; });
|
|
9421
|
+
}
|
|
9322
9422
|
/**
|
|
9323
9423
|
* MoveWayleaveWorkOrderToAwaitingPtd
|
|
9324
9424
|
*
|