@d19n/youfibre-odin-sdk 2.0.256-beta.2 → 2.0.256-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/dist/api-sdk-v2/CustomerDeviceApi.d.ts +2 -0
- package/dist/api-sdk-v2/CustomerDeviceApi.js +6 -0
- package/dist/api-sdk-v2/OrderItemApi.d.ts +2 -0
- package/dist/api-sdk-v2/OrderItemApi.js +6 -0
- package/dist/db-sdk-v2/CustomerDeviceDb.d.ts +2 -0
- package/dist/db-sdk-v2/CustomerDeviceDb.js +6 -0
- package/dist/db-sdk-v2/OrderItemDb.d.ts +2 -0
- package/dist/db-sdk-v2/OrderItemDb.js +6 -0
- package/dist/entities-v2/CustomerDevice.d.ts +7 -0
- package/dist/entities-v2/CustomerDevice.js +5 -1
- package/dist/entities-v2/OrderItem.d.ts +3 -0
- package/dist/entities-v2/Payment.d.ts +3 -1
- package/dist/entities-v2/Payment.js +2 -0
- package/dist/records-v2/CustomerDeviceRecord.d.ts +20 -0
- package/dist/records-v2/CustomerDeviceRecord.js +33 -0
- package/dist/records-v2/OrderItemRecord.d.ts +20 -0
- package/dist/records-v2/OrderItemRecord.js +33 -0
- package/package.json +1 -1
|
@@ -18,8 +18,10 @@ export declare class CustomerDeviceApi extends ApiProvider {
|
|
|
18
18
|
private readonly entityName;
|
|
19
19
|
private sourceRecord;
|
|
20
20
|
private _fieldservicedispatchedproduct?;
|
|
21
|
+
private _orderitem?;
|
|
21
22
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
22
23
|
get fieldservicedispatchedproduct(): ApiRecordLinkManager;
|
|
24
|
+
get orderitem(): ApiRecordLinkManager;
|
|
23
25
|
setRecord(sourceRecord: any): void;
|
|
24
26
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
25
27
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<CustomerDeviceProperties>>>;
|
|
@@ -39,6 +39,12 @@ class CustomerDeviceApi extends api_provider_1.ApiProvider {
|
|
|
39
39
|
}
|
|
40
40
|
return this._fieldservicedispatchedproduct;
|
|
41
41
|
}
|
|
42
|
+
get orderitem() {
|
|
43
|
+
if (!this._orderitem) {
|
|
44
|
+
this._orderitem = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'ServiceModule:CustomerDevice', 'OrderModule:OrderItem', 'CustomerDevice__OrderItem');
|
|
45
|
+
}
|
|
46
|
+
return this._orderitem;
|
|
47
|
+
}
|
|
42
48
|
// ============================================
|
|
43
49
|
// STANDARD METHODS (Unchanged API)
|
|
44
50
|
// ============================================
|
|
@@ -34,6 +34,7 @@ export declare class OrderItemApi extends ApiProvider {
|
|
|
34
34
|
private _onetouchswitch?;
|
|
35
35
|
private _activity?;
|
|
36
36
|
private _orderitem?;
|
|
37
|
+
private _customerdevice?;
|
|
37
38
|
constructor(authParams?: OauthParams, authToken?: string);
|
|
38
39
|
get file(): ApiRecordLinkManager;
|
|
39
40
|
get note(): ApiRecordLinkManager;
|
|
@@ -52,6 +53,7 @@ export declare class OrderItemApi extends ApiProvider {
|
|
|
52
53
|
get onetouchswitch(): ApiRecordLinkManager;
|
|
53
54
|
get activity(): ApiRecordLinkManager;
|
|
54
55
|
get orderitem(): ApiRecordLinkManager;
|
|
56
|
+
get customerdevice(): ApiRecordLinkManager;
|
|
55
57
|
setRecord(sourceRecord: any): void;
|
|
56
58
|
schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
|
|
57
59
|
search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<OrderItemProperties>>>;
|
|
@@ -135,6 +135,12 @@ class OrderItemApi extends api_provider_1.ApiProvider {
|
|
|
135
135
|
}
|
|
136
136
|
return this._orderitem;
|
|
137
137
|
}
|
|
138
|
+
get customerdevice() {
|
|
139
|
+
if (!this._customerdevice) {
|
|
140
|
+
this._customerdevice = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'OrderModule:OrderItem', 'ServiceModule:CustomerDevice', 'CustomerDevice__OrderItem');
|
|
141
|
+
}
|
|
142
|
+
return this._customerdevice;
|
|
143
|
+
}
|
|
138
144
|
// ============================================
|
|
139
145
|
// STANDARD METHODS (Unchanged API)
|
|
140
146
|
// ============================================
|
|
@@ -22,8 +22,10 @@ export declare class CustomerDeviceDb extends DbProvider {
|
|
|
22
22
|
private readonly entityName;
|
|
23
23
|
private sourceRecord;
|
|
24
24
|
private _fieldservicedispatchedproduct?;
|
|
25
|
+
private _orderitem?;
|
|
25
26
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
26
27
|
get fieldservicedispatchedproduct(): DbRecordLinkManager;
|
|
28
|
+
get orderitem(): DbRecordLinkManager;
|
|
27
29
|
setRecord(sourceRecord: any): void;
|
|
28
30
|
/**
|
|
29
31
|
* Search records with manual pagination control
|
|
@@ -44,6 +44,12 @@ class CustomerDeviceDb extends db_provider_1.DbProvider {
|
|
|
44
44
|
}
|
|
45
45
|
return this._fieldservicedispatchedproduct;
|
|
46
46
|
}
|
|
47
|
+
get orderitem() {
|
|
48
|
+
if (!this._orderitem) {
|
|
49
|
+
this._orderitem = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'ServiceModule:CustomerDevice', 'OrderModule:OrderItem', 'CustomerDevice__OrderItem');
|
|
50
|
+
}
|
|
51
|
+
return this._orderitem;
|
|
52
|
+
}
|
|
47
53
|
// ============================================
|
|
48
54
|
// STANDARD METHODS
|
|
49
55
|
// ============================================
|
|
@@ -38,6 +38,7 @@ export declare class OrderItemDb extends DbProvider {
|
|
|
38
38
|
private _onetouchswitch?;
|
|
39
39
|
private _activity?;
|
|
40
40
|
private _orderitem?;
|
|
41
|
+
private _customerdevice?;
|
|
41
42
|
constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
|
|
42
43
|
get file(): DbRecordLinkManager;
|
|
43
44
|
get note(): DbRecordLinkManager;
|
|
@@ -56,6 +57,7 @@ export declare class OrderItemDb extends DbProvider {
|
|
|
56
57
|
get onetouchswitch(): DbRecordLinkManager;
|
|
57
58
|
get activity(): DbRecordLinkManager;
|
|
58
59
|
get orderitem(): DbRecordLinkManager;
|
|
60
|
+
get customerdevice(): DbRecordLinkManager;
|
|
59
61
|
setRecord(sourceRecord: any): void;
|
|
60
62
|
/**
|
|
61
63
|
* Search records with manual pagination control
|
|
@@ -140,6 +140,12 @@ class OrderItemDb extends db_provider_1.DbProvider {
|
|
|
140
140
|
}
|
|
141
141
|
return this._orderitem;
|
|
142
142
|
}
|
|
143
|
+
get customerdevice() {
|
|
144
|
+
if (!this._customerdevice) {
|
|
145
|
+
this._customerdevice = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'OrderModule:OrderItem', 'ServiceModule:CustomerDevice', 'CustomerDevice__OrderItem');
|
|
146
|
+
}
|
|
147
|
+
return this._customerdevice;
|
|
148
|
+
}
|
|
143
149
|
// ============================================
|
|
144
150
|
// STANDARD METHODS
|
|
145
151
|
// ============================================
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { OdinRecord, OdinLink, LinkedOdinRecord } from '@d19n/odin-types/dist/core';
|
|
14
14
|
import { FieldServiceDispatchedProductProperties } from './FieldServiceDispatchedProduct';
|
|
15
|
+
import { OrderItemProperties } from './OrderItem';
|
|
15
16
|
/**
|
|
16
17
|
* Available types for CustomerDevice records
|
|
17
18
|
*/
|
|
@@ -83,6 +84,8 @@ export declare class CustomerDevice extends OdinRecord<CustomerDeviceProperties>
|
|
|
83
84
|
properties: CustomerDeviceProperties;
|
|
84
85
|
/** Linked FieldServiceDispatchedProduct records (CustomerDevice__FieldServiceDispatchedProduct) */
|
|
85
86
|
FieldServiceDispatchedProduct: OdinLink<LinkedOdinRecord<FieldServiceDispatchedProductProperties>>;
|
|
87
|
+
/** Linked OrderItem records (CustomerDevice__OrderItem) */
|
|
88
|
+
OrderItem: OdinLink<LinkedOdinRecord<OrderItemProperties>>;
|
|
86
89
|
}
|
|
87
90
|
/**
|
|
88
91
|
* RabbitMQ routing keys for CustomerDevice events
|
|
@@ -110,3 +113,7 @@ export declare const ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_DELETED = "ServiceModul
|
|
|
110
113
|
export declare const ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_CREATED = "ServiceModule.CustomerDevice.FieldServiceDispatchedProduct.SubDbRecordAssociationCreated";
|
|
111
114
|
/** Event: CustomerDevice__FieldServiceDispatchedProduct link deleted */
|
|
112
115
|
export declare const ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_DELETED = "ServiceModule.CustomerDevice.FieldServiceDispatchedProduct.SubDbRecordAssociationDeleted";
|
|
116
|
+
/** Event: CustomerDevice__OrderItem link created */
|
|
117
|
+
export declare const ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_CREATED = "ServiceModule.CustomerDevice.OrderItem.SubDbRecordAssociationCreated";
|
|
118
|
+
/** Event: CustomerDevice__OrderItem link deleted */
|
|
119
|
+
export declare const ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_DELETED = "ServiceModule.CustomerDevice.OrderItem.SubDbRecordAssociationDeleted";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Generated from Odin schema definition
|
|
13
13
|
*/
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_DELETED = exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_CREATED = exports.CustomerDevice = exports.CustomerDevicePropertyKeys = exports.CustomerDeviceEntityTypes = void 0;
|
|
15
|
+
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_DELETED = exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_CREATED = exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_DELETED = exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_BATTERY_CREATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_DELETED = exports.ROUTING_KEY_CUSTOMER_DEVICE_UPDATED = exports.ROUTING_KEY_CUSTOMER_DEVICE_CREATED = exports.CustomerDevice = exports.CustomerDevicePropertyKeys = exports.CustomerDeviceEntityTypes = void 0;
|
|
16
16
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
17
|
/**
|
|
18
18
|
* Available types for CustomerDevice records
|
|
@@ -78,3 +78,7 @@ exports.ROUTING_KEY_CUSTOMER_DEVICE_DEFAULT_DELETED = 'ServiceModule.CustomerDev
|
|
|
78
78
|
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_CREATED = 'ServiceModule.CustomerDevice.FieldServiceDispatchedProduct.SubDbRecordAssociationCreated';
|
|
79
79
|
/** Event: CustomerDevice__FieldServiceDispatchedProduct link deleted */
|
|
80
80
|
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_FIELD_SERVICE_DISPATCHED_PRODUCT_DELETED = 'ServiceModule.CustomerDevice.FieldServiceDispatchedProduct.SubDbRecordAssociationDeleted';
|
|
81
|
+
/** Event: CustomerDevice__OrderItem link created */
|
|
82
|
+
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_CREATED = 'ServiceModule.CustomerDevice.OrderItem.SubDbRecordAssociationCreated';
|
|
83
|
+
/** Event: CustomerDevice__OrderItem link deleted */
|
|
84
|
+
exports.ROUTING_KEY_LINK_CUSTOMER_DEVICE_ORDER_ITEM_DELETED = 'ServiceModule.CustomerDevice.OrderItem.SubDbRecordAssociationDeleted';
|
|
@@ -27,6 +27,7 @@ import { SplitOrderProperties } from './SplitOrder';
|
|
|
27
27
|
import { CustomerPhonePortingProperties } from './CustomerPhonePorting';
|
|
28
28
|
import { OneTouchSwitchProperties } from './OneTouchSwitch';
|
|
29
29
|
import { ActivityProperties } from './Activity';
|
|
30
|
+
import { CustomerDeviceProperties } from './CustomerDevice';
|
|
30
31
|
/**
|
|
31
32
|
* Available types for OrderItem records
|
|
32
33
|
*/
|
|
@@ -571,6 +572,8 @@ export declare class OrderItem extends OdinRecord<OrderItemProperties> {
|
|
|
571
572
|
Activity: OdinLink<LinkedOdinRecord<ActivityProperties>>;
|
|
572
573
|
/** Linked OrderItem records (OrderItem__OrderItem) */
|
|
573
574
|
OrderItem: OdinLink<LinkedOdinRecord<OrderItemProperties>>;
|
|
575
|
+
/** Linked CustomerDevice records (CustomerDevice__OrderItem) */
|
|
576
|
+
CustomerDevice: OdinLink<LinkedOdinRecord<CustomerDeviceProperties>>;
|
|
574
577
|
}
|
|
575
578
|
/**
|
|
576
579
|
* RabbitMQ routing keys for OrderItem events
|
|
@@ -91,9 +91,11 @@ export declare enum PaymentCurrency {
|
|
|
91
91
|
*
|
|
92
92
|
* @remarks Available options:
|
|
93
93
|
* - `GLOBALPAY` - global payments
|
|
94
|
+
* - `STRIPE` - stripe
|
|
94
95
|
*/
|
|
95
96
|
export declare enum PaymentMethod {
|
|
96
|
-
GLOBAL_PAYMENTS = "GLOBALPAY"
|
|
97
|
+
GLOBAL_PAYMENTS = "GLOBALPAY",
|
|
98
|
+
STRIPE = "STRIPE"
|
|
97
99
|
}
|
|
98
100
|
/**
|
|
99
101
|
* Property keys for Payment
|
|
@@ -96,10 +96,12 @@ var PaymentCurrency;
|
|
|
96
96
|
*
|
|
97
97
|
* @remarks Available options:
|
|
98
98
|
* - `GLOBALPAY` - global payments
|
|
99
|
+
* - `STRIPE` - stripe
|
|
99
100
|
*/
|
|
100
101
|
var PaymentMethod;
|
|
101
102
|
(function (PaymentMethod) {
|
|
102
103
|
PaymentMethod["GLOBAL_PAYMENTS"] = "GLOBALPAY";
|
|
104
|
+
PaymentMethod["STRIPE"] = "STRIPE";
|
|
103
105
|
})(PaymentMethod = exports.PaymentMethod || (exports.PaymentMethod = {}));
|
|
104
106
|
/**
|
|
105
107
|
* Property keys for Payment
|
|
@@ -25,6 +25,7 @@ import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-man
|
|
|
25
25
|
import { CustomerDeviceProperties, BatteryCustomerDeviceProperties } from '../entities-v2/CustomerDevice';
|
|
26
26
|
import { CreateCustomerDeviceBatteryProperties } from '../actions-v2/CreateCustomerDeviceBatteryDto';
|
|
27
27
|
import { FieldServiceDispatchedProductRecord } from './FieldServiceDispatchedProductRecord';
|
|
28
|
+
import { OrderItemRecord } from './OrderItemRecord';
|
|
28
29
|
/** Valid entity types for CustomerDevice */
|
|
29
30
|
export declare type CustomerDeviceType = 'BATTERY' | 'DEFAULT';
|
|
30
31
|
/**
|
|
@@ -91,6 +92,7 @@ export declare class CustomerDeviceRecord<TProps = CustomerDeviceProperties> {
|
|
|
91
92
|
private _pendingLinks;
|
|
92
93
|
private _preGeneratedId;
|
|
93
94
|
private _fieldServiceDispatchedProducts?;
|
|
95
|
+
private _orderItems?;
|
|
94
96
|
/**
|
|
95
97
|
* Create a record wrapper.
|
|
96
98
|
* @param record - The underlying record, or null for create operations
|
|
@@ -166,6 +168,24 @@ export declare class CustomerDeviceRecord<TProps = CustomerDeviceProperties> {
|
|
|
166
168
|
* ```
|
|
167
169
|
*/
|
|
168
170
|
get fieldServiceDispatchedProducts(): RecordLinkManager<FieldServiceDispatchedProductRecord, typeof CustomerDeviceRecord['fieldServiceDispatchedProductsLabels'][number]>;
|
|
171
|
+
/** Valid labels for OrderItem associations */
|
|
172
|
+
static readonly orderItemsLabels: readonly ["CustomerDevice__OrderItem"];
|
|
173
|
+
/**
|
|
174
|
+
* Access linked OrderItem records
|
|
175
|
+
* @remarks Available labels: CustomerDevice__OrderItem
|
|
176
|
+
* @throws Error if called on a new (unsaved) record
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* // Get all linked OrderItem records
|
|
181
|
+
* const items = await record.orderItems.list();
|
|
182
|
+
* const first = await record.orderItems.first();
|
|
183
|
+
*
|
|
184
|
+
* // Filter by label
|
|
185
|
+
* const specific = await record.orderItems.first({ label: 'CustomerDevice__OrderItem' });
|
|
186
|
+
* ```
|
|
187
|
+
*/
|
|
188
|
+
get orderItems(): RecordLinkManager<OrderItemRecord, typeof CustomerDeviceRecord['orderItemsLabels'][number]>;
|
|
169
189
|
/**
|
|
170
190
|
* Queue a link to be created with the next action.
|
|
171
191
|
* Works for both create and update actions.
|
|
@@ -33,6 +33,7 @@ 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");
|
|
35
35
|
const FieldServiceDispatchedProductRecord_1 = require("./FieldServiceDispatchedProductRecord");
|
|
36
|
+
const OrderItemRecord_1 = require("./OrderItemRecord");
|
|
36
37
|
/**
|
|
37
38
|
* Builder for action execution with dryRun support
|
|
38
39
|
*
|
|
@@ -208,6 +209,36 @@ class CustomerDeviceRecord {
|
|
|
208
209
|
}
|
|
209
210
|
return this._fieldServiceDispatchedProducts;
|
|
210
211
|
}
|
|
212
|
+
/**
|
|
213
|
+
* Access linked OrderItem records
|
|
214
|
+
* @remarks Available labels: CustomerDevice__OrderItem
|
|
215
|
+
* @throws Error if called on a new (unsaved) record
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* // Get all linked OrderItem records
|
|
220
|
+
* const items = await record.orderItems.list();
|
|
221
|
+
* const first = await record.orderItems.first();
|
|
222
|
+
*
|
|
223
|
+
* // Filter by label
|
|
224
|
+
* const specific = await record.orderItems.first({ label: 'CustomerDevice__OrderItem' });
|
|
225
|
+
* ```
|
|
226
|
+
*/
|
|
227
|
+
get orderItems() {
|
|
228
|
+
var _a;
|
|
229
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
230
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
231
|
+
if (!this._orderItems) {
|
|
232
|
+
this._orderItems = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
233
|
+
sourceEntity: 'ServiceModule:CustomerDevice',
|
|
234
|
+
targetEntity: 'OrderModule:OrderItem',
|
|
235
|
+
targetModuleName: 'OrderModule',
|
|
236
|
+
targetEntityName: 'OrderItem',
|
|
237
|
+
labels: ['CustomerDevice__OrderItem'],
|
|
238
|
+
}, OrderItemRecord_1.OrderItemRecord);
|
|
239
|
+
}
|
|
240
|
+
return this._orderItems;
|
|
241
|
+
}
|
|
211
242
|
// ============================================
|
|
212
243
|
// LINK MANAGEMENT
|
|
213
244
|
// ============================================
|
|
@@ -289,6 +320,8 @@ exports.CustomerDeviceRecord = CustomerDeviceRecord;
|
|
|
289
320
|
// ============================================
|
|
290
321
|
/** Valid labels for FieldServiceDispatchedProduct associations */
|
|
291
322
|
CustomerDeviceRecord.fieldServiceDispatchedProductsLabels = ['CustomerDevice__FieldServiceDispatchedProduct'];
|
|
323
|
+
/** Valid labels for OrderItem associations */
|
|
324
|
+
CustomerDeviceRecord.orderItemsLabels = ['CustomerDevice__OrderItem'];
|
|
292
325
|
/** Type guard to check if an object is a CustomerDeviceRecord */
|
|
293
326
|
function isCustomerDeviceRecord(obj) {
|
|
294
327
|
return obj instanceof CustomerDeviceRecord;
|
|
@@ -40,6 +40,7 @@ import { CustomerDeviceRouterRecord } from './CustomerDeviceRouterRecord';
|
|
|
40
40
|
import { CustomerPhonePortingRecord } from './CustomerPhonePortingRecord';
|
|
41
41
|
import { OneTouchSwitchRecord } from './OneTouchSwitchRecord';
|
|
42
42
|
import { ActivityRecord } from './ActivityRecord';
|
|
43
|
+
import { CustomerDeviceRecord } from './CustomerDeviceRecord';
|
|
43
44
|
/**
|
|
44
45
|
* Builder for action execution with dryRun support
|
|
45
46
|
*
|
|
@@ -118,6 +119,7 @@ export declare class OrderItemRecord<TProps = OrderItemProperties> {
|
|
|
118
119
|
private _oneTouchSwitches?;
|
|
119
120
|
private _activities?;
|
|
120
121
|
private _orderItems?;
|
|
122
|
+
private _customerDevices?;
|
|
121
123
|
/**
|
|
122
124
|
* Create a record wrapper.
|
|
123
125
|
* @param record - The underlying record, or null for create operations
|
|
@@ -413,6 +415,24 @@ export declare class OrderItemRecord<TProps = OrderItemProperties> {
|
|
|
413
415
|
* ```
|
|
414
416
|
*/
|
|
415
417
|
get orderItems(): RecordLinkManager<OrderItemRecord, typeof OrderItemRecord['orderItemsLabels'][number]>;
|
|
418
|
+
/** Valid labels for CustomerDevice associations */
|
|
419
|
+
static readonly customerDevicesLabels: readonly ["CustomerDevice__OrderItem"];
|
|
420
|
+
/**
|
|
421
|
+
* Access linked CustomerDevice records
|
|
422
|
+
* @remarks Available labels: CustomerDevice__OrderItem
|
|
423
|
+
* @throws Error if called on a new (unsaved) record
|
|
424
|
+
*
|
|
425
|
+
* @example
|
|
426
|
+
* ```typescript
|
|
427
|
+
* // Get all linked CustomerDevice records
|
|
428
|
+
* const items = await record.customerDevices.list();
|
|
429
|
+
* const first = await record.customerDevices.first();
|
|
430
|
+
*
|
|
431
|
+
* // Filter by label
|
|
432
|
+
* const specific = await record.customerDevices.first({ label: 'CustomerDevice__OrderItem' });
|
|
433
|
+
* ```
|
|
434
|
+
*/
|
|
435
|
+
get customerDevices(): RecordLinkManager<CustomerDeviceRecord, typeof OrderItemRecord['customerDevicesLabels'][number]>;
|
|
416
436
|
/**
|
|
417
437
|
* Queue a link to be created with the next action.
|
|
418
438
|
* Works for both create and update actions.
|
|
@@ -44,6 +44,7 @@ const CustomerDeviceRouterRecord_1 = require("./CustomerDeviceRouterRecord");
|
|
|
44
44
|
const CustomerPhonePortingRecord_1 = require("./CustomerPhonePortingRecord");
|
|
45
45
|
const OneTouchSwitchRecord_1 = require("./OneTouchSwitchRecord");
|
|
46
46
|
const ActivityRecord_1 = require("./ActivityRecord");
|
|
47
|
+
const CustomerDeviceRecord_1 = require("./CustomerDeviceRecord");
|
|
47
48
|
/**
|
|
48
49
|
* Builder for action execution with dryRun support
|
|
49
50
|
*
|
|
@@ -604,6 +605,36 @@ class OrderItemRecord {
|
|
|
604
605
|
}
|
|
605
606
|
return this._orderItems;
|
|
606
607
|
}
|
|
608
|
+
/**
|
|
609
|
+
* Access linked CustomerDevice records
|
|
610
|
+
* @remarks Available labels: CustomerDevice__OrderItem
|
|
611
|
+
* @throws Error if called on a new (unsaved) record
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```typescript
|
|
615
|
+
* // Get all linked CustomerDevice records
|
|
616
|
+
* const items = await record.customerDevices.list();
|
|
617
|
+
* const first = await record.customerDevices.first();
|
|
618
|
+
*
|
|
619
|
+
* // Filter by label
|
|
620
|
+
* const specific = await record.customerDevices.first({ label: 'CustomerDevice__OrderItem' });
|
|
621
|
+
* ```
|
|
622
|
+
*/
|
|
623
|
+
get customerDevices() {
|
|
624
|
+
var _a;
|
|
625
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
626
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
627
|
+
if (!this._customerDevices) {
|
|
628
|
+
this._customerDevices = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
629
|
+
sourceEntity: 'OrderModule:OrderItem',
|
|
630
|
+
targetEntity: 'ServiceModule:CustomerDevice',
|
|
631
|
+
targetModuleName: 'ServiceModule',
|
|
632
|
+
targetEntityName: 'CustomerDevice',
|
|
633
|
+
labels: ['CustomerDevice__OrderItem'],
|
|
634
|
+
}, CustomerDeviceRecord_1.CustomerDeviceRecord);
|
|
635
|
+
}
|
|
636
|
+
return this._customerDevices;
|
|
637
|
+
}
|
|
607
638
|
// ============================================
|
|
608
639
|
// LINK MANAGEMENT
|
|
609
640
|
// ============================================
|
|
@@ -856,6 +887,8 @@ OrderItemRecord.oneTouchSwitchesLabels = ['OneTouchSwitch__OrderItem'];
|
|
|
856
887
|
OrderItemRecord.activitiesLabels = ['OrderItem__Activity'];
|
|
857
888
|
/** Valid labels for OrderItem associations */
|
|
858
889
|
OrderItemRecord.orderItemsLabels = ['OrderItem__OrderItem'];
|
|
890
|
+
/** Valid labels for CustomerDevice associations */
|
|
891
|
+
OrderItemRecord.customerDevicesLabels = ['CustomerDevice__OrderItem'];
|
|
859
892
|
/** Type guard to check if an object is a OrderItemRecord */
|
|
860
893
|
function isOrderItemRecord(obj) {
|
|
861
894
|
return obj instanceof OrderItemRecord;
|