@d19n/youfibre-odin-sdk 2.0.13-beta.1 → 2.0.13
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 +11 -10
- package/dist/actions-v2/CreateOrderFromBrskDto.d.ts +75 -0
- package/dist/actions-v2/CreateOrderItemFromBrskDto.d.ts +191 -0
- package/dist/actions-v2/CreateOrderItemFromBrskDto.js +52 -0
- package/dist/entities-v2/Order.d.ts +7 -0
- package/dist/entities-v2/Order.js +2 -0
- package/dist/entities-v2/OrderItem.d.ts +7 -0
- package/dist/entities-v2/OrderItem.js +2 -0
- package/dist/entities-v2/Product.d.ts +0 -42
- package/dist/entities-v2/Product.js +0 -2
- package/dist/records-v2/AccountCreditRecord.d.ts +62 -1
- package/dist/records-v2/AccountCreditRecord.js +91 -0
- package/dist/records-v2/AccountRecord.d.ts +306 -2
- package/dist/records-v2/AccountRecord.js +451 -0
- package/dist/records-v2/ActivityLogRecord.d.ts +122 -1
- package/dist/records-v2/ActivityLogRecord.js +190 -0
- package/dist/records-v2/ActivityRecord.d.ts +255 -2
- package/dist/records-v2/ActivityRecord.js +387 -0
- package/dist/records-v2/AddressRecord.d.ts +321 -0
- package/dist/records-v2/AddressRecord.js +532 -0
- package/dist/records-v2/AffiliateCodeRecord.d.ts +102 -1
- package/dist/records-v2/AffiliateCodeRecord.js +157 -0
- package/dist/records-v2/AppointmentRecord.d.ts +141 -0
- package/dist/records-v2/AppointmentRecord.js +235 -0
- package/dist/records-v2/BillingAdjustmentRecord.d.ts +81 -0
- package/dist/records-v2/BillingAdjustmentRecord.js +136 -0
- package/dist/records-v2/BillingRequestRecord.d.ts +178 -2
- package/dist/records-v2/BillingRequestRecord.js +271 -0
- package/dist/records-v2/BlockageA55Record.d.ts +103 -2
- package/dist/records-v2/BlockageA55Record.js +157 -0
- package/dist/records-v2/BrskEntityMigrationErrorRecord.d.ts +21 -1
- package/dist/records-v2/BrskEntityMigrationErrorRecord.js +21 -0
- package/dist/records-v2/CallEventRecord.d.ts +82 -1
- package/dist/records-v2/CallEventRecord.js +124 -0
- package/dist/records-v2/CallLegRecord.d.ts +82 -1
- package/dist/records-v2/CallLegRecord.js +124 -0
- package/dist/records-v2/CallRecord.d.ts +202 -1
- package/dist/records-v2/CallRecord.js +322 -0
- package/dist/records-v2/CallTransferRecord.d.ts +102 -1
- package/dist/records-v2/CallTransferRecord.js +157 -0
- package/dist/records-v2/CampaignRecord.d.ts +83 -2
- package/dist/records-v2/CampaignRecord.js +124 -0
- package/dist/records-v2/CaseRecord.d.ts +418 -2
- package/dist/records-v2/CaseRecord.js +667 -0
- package/dist/records-v2/ChangeReasonRecord.d.ts +171 -2
- package/dist/records-v2/ChangeReasonRecord.js +238 -0
- package/dist/records-v2/ChurnRequestRecord.d.ts +62 -1
- package/dist/records-v2/ChurnRequestRecord.js +91 -0
- package/dist/records-v2/ContactRecord.d.ts +560 -0
- package/dist/records-v2/ContactRecord.js +927 -0
- package/dist/records-v2/ContractBuyOutRecord.d.ts +162 -1
- package/dist/records-v2/ContractBuyOutRecord.js +256 -0
- package/dist/records-v2/ConversationFeedbackRecord.d.ts +102 -1
- package/dist/records-v2/ConversationFeedbackRecord.js +157 -0
- package/dist/records-v2/ConversationRecord.d.ts +102 -1
- package/dist/records-v2/ConversationRecord.js +157 -0
- package/dist/records-v2/CreditNoteRecord.d.ts +81 -0
- package/dist/records-v2/CreditNoteRecord.js +136 -0
- package/dist/records-v2/CrmDatasetRecord.d.ts +191 -2
- package/dist/records-v2/CrmDatasetRecord.js +271 -0
- package/dist/records-v2/CustomerDeviceAtaRecord.d.ts +21 -0
- package/dist/records-v2/CustomerDeviceAtaRecord.js +37 -0
- package/dist/records-v2/CustomerDeviceConfigurationRecord.d.ts +62 -1
- package/dist/records-v2/CustomerDeviceConfigurationRecord.js +91 -0
- package/dist/records-v2/CustomerDeviceOntRecord.d.ts +181 -0
- package/dist/records-v2/CustomerDeviceOntRecord.js +301 -0
- package/dist/records-v2/CustomerDeviceRouterRecord.d.ts +141 -0
- package/dist/records-v2/CustomerDeviceRouterRecord.js +235 -0
- package/dist/records-v2/CustomerPhonePortingRecord.d.ts +21 -0
- package/dist/records-v2/CustomerPhonePortingRecord.js +37 -0
- package/dist/records-v2/DiscountRecord.d.ts +121 -0
- package/dist/records-v2/DiscountRecord.js +202 -0
- package/dist/records-v2/EmailRecord.d.ts +230 -2
- package/dist/records-v2/EmailRecord.js +336 -0
- package/dist/records-v2/EmailSenderRecord.d.ts +42 -1
- package/dist/records-v2/EmailSenderRecord.js +58 -0
- package/dist/records-v2/EmailTemplateRecord.d.ts +21 -1
- package/dist/records-v2/EmailTemplateRecord.js +21 -0
- package/dist/records-v2/FieldServiceDispatchedProductRecord.d.ts +135 -2
- package/dist/records-v2/FieldServiceDispatchedProductRecord.js +189 -0
- package/dist/records-v2/FieldServiceProductRecord.d.ts +115 -2
- package/dist/records-v2/FieldServiceProductRecord.js +156 -0
- package/dist/records-v2/FileRecord.d.ts +1211 -2
- package/dist/records-v2/FileRecord.js +1902 -0
- package/dist/records-v2/ImpersonationTrackerRecord.d.ts +62 -1
- package/dist/records-v2/ImpersonationTrackerRecord.js +91 -0
- package/dist/records-v2/InternalInstallAuditRecord.d.ts +83 -2
- package/dist/records-v2/InternalInstallAuditRecord.js +124 -0
- package/dist/records-v2/InvoiceItemRecord.d.ts +40 -0
- package/dist/records-v2/InvoiceItemRecord.js +69 -0
- package/dist/records-v2/InvoiceRecord.d.ts +399 -2
- package/dist/records-v2/InvoiceRecord.js +635 -0
- package/dist/records-v2/KnowledgeArticleRecord.d.ts +98 -2
- package/dist/records-v2/KnowledgeArticleRecord.js +139 -0
- package/dist/records-v2/LeadRecord.d.ts +261 -0
- package/dist/records-v2/LeadRecord.js +433 -0
- package/dist/records-v2/MessageRecord.d.ts +99 -2
- package/dist/records-v2/MessageRecord.js +140 -0
- package/dist/records-v2/NetworkDeviceRecord.d.ts +43 -2
- package/dist/records-v2/NetworkDeviceRecord.js +58 -0
- package/dist/records-v2/NoteRecord.d.ts +1121 -1
- package/dist/records-v2/NoteRecord.js +1839 -0
- package/dist/records-v2/OfferRecord.d.ts +154 -2
- package/dist/records-v2/OfferRecord.js +221 -0
- package/dist/records-v2/OhAuditOfInstallationRecord.d.ts +83 -2
- package/dist/records-v2/OhAuditOfInstallationRecord.js +124 -0
- package/dist/records-v2/OhExternalAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhExternalAuditRecord.js +124 -0
- package/dist/records-v2/OhInProgressAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhInProgressAuditRecord.js +124 -0
- package/dist/records-v2/OhInstallationAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhInstallationAuditRecord.js +124 -0
- package/dist/records-v2/OhRetroAuditRecord.d.ts +83 -2
- package/dist/records-v2/OhRetroAuditRecord.js +124 -0
- package/dist/records-v2/OneTouchSwitchRecord.d.ts +255 -2
- package/dist/records-v2/OneTouchSwitchRecord.js +387 -0
- package/dist/records-v2/OntReplacementApprovalRecord.d.ts +62 -1
- package/dist/records-v2/OntReplacementApprovalRecord.js +91 -0
- package/dist/records-v2/OrderCheckRecord.d.ts +21 -0
- package/dist/records-v2/OrderCheckRecord.js +37 -0
- package/dist/records-v2/OrderItemRecord.d.ts +309 -0
- package/dist/records-v2/OrderItemRecord.js +501 -0
- package/dist/records-v2/OrderKciRecord.d.ts +42 -1
- package/dist/records-v2/OrderKciRecord.js +58 -0
- package/dist/records-v2/OrderRecord.d.ts +620 -0
- package/dist/records-v2/OrderRecord.js +1026 -0
- package/dist/records-v2/OutageRecord.d.ts +42 -1
- package/dist/records-v2/OutageRecord.js +58 -0
- package/dist/records-v2/OverlayRealA55Record.d.ts +83 -2
- package/dist/records-v2/OverlayRealA55Record.js +124 -0
- package/dist/records-v2/PICRequestRecord.d.ts +62 -1
- package/dist/records-v2/PICRequestRecord.js +91 -0
- package/dist/records-v2/PaymentMethodRecord.d.ts +121 -0
- package/dist/records-v2/PaymentMethodRecord.js +202 -0
- package/dist/records-v2/PaymentMethodRefundRecord.d.ts +181 -0
- package/dist/records-v2/PaymentMethodRefundRecord.js +301 -0
- package/dist/records-v2/PaymentRecord.d.ts +82 -1
- package/dist/records-v2/PaymentRecord.js +124 -0
- package/dist/records-v2/PermissionToFailRecord.d.ts +61 -0
- package/dist/records-v2/PermissionToFailRecord.js +103 -0
- package/dist/records-v2/PgAccountValidationRecord.d.ts +21 -1
- package/dist/records-v2/PgAccountValidationRecord.js +21 -0
- package/dist/records-v2/PgContactRecord.d.ts +62 -1
- package/dist/records-v2/PgContactRecord.js +91 -0
- package/dist/records-v2/PgDirectDebitFileRecord.d.ts +95 -2
- package/dist/records-v2/PgDirectDebitFileRecord.js +123 -0
- package/dist/records-v2/PgDisputeRecord.d.ts +62 -1
- package/dist/records-v2/PgDisputeRecord.js +91 -0
- package/dist/records-v2/PgFileAllocationRecord.d.ts +115 -2
- package/dist/records-v2/PgFileAllocationRecord.js +156 -0
- package/dist/records-v2/PgLogRecord.d.ts +21 -1
- package/dist/records-v2/PgLogRecord.js +21 -0
- package/dist/records-v2/PgPaymentMethodRecord.d.ts +102 -1
- package/dist/records-v2/PgPaymentMethodRecord.js +157 -0
- package/dist/records-v2/PgSortCodeSubstitutionRecord.d.ts +21 -1
- package/dist/records-v2/PgSortCodeSubstitutionRecord.js +21 -0
- package/dist/records-v2/PgTransactionRecord.d.ts +135 -2
- package/dist/records-v2/PgTransactionRecord.js +189 -0
- package/dist/records-v2/PgVocalinkRecord.d.ts +21 -1
- package/dist/records-v2/PgVocalinkRecord.js +21 -0
- package/dist/records-v2/PgWebhookAttemptRecord.d.ts +42 -1
- package/dist/records-v2/PgWebhookAttemptRecord.js +58 -0
- package/dist/records-v2/PgWebhookRecord.d.ts +122 -1
- package/dist/records-v2/PgWebhookRecord.js +190 -0
- package/dist/records-v2/PhoneNumberRecord.d.ts +41 -0
- package/dist/records-v2/PhoneNumberRecord.js +70 -0
- package/dist/records-v2/PriceBookRecord.d.ts +21 -0
- package/dist/records-v2/PriceBookRecord.js +37 -0
- package/dist/records-v2/ProductRecord.d.ts +258 -2
- package/dist/records-v2/ProductRecord.js +351 -0
- package/dist/records-v2/PushNotificationRecord.d.ts +162 -1
- package/dist/records-v2/PushNotificationRecord.js +256 -0
- package/dist/records-v2/ReferralRecord.d.ts +143 -2
- package/dist/records-v2/ReferralRecord.js +223 -0
- package/dist/records-v2/RemediationOutcomeFormRecord.d.ts +83 -2
- package/dist/records-v2/RemediationOutcomeFormRecord.js +124 -0
- package/dist/records-v2/RemediationRequiredReasonRecord.d.ts +103 -2
- package/dist/records-v2/RemediationRequiredReasonRecord.js +157 -0
- package/dist/records-v2/ReturnsRecord.d.ts +62 -1
- package/dist/records-v2/ReturnsRecord.js +91 -0
- package/dist/records-v2/RewardRecord.d.ts +123 -2
- package/dist/records-v2/RewardRecord.js +190 -0
- package/dist/records-v2/SalesTerritoryRecord.d.ts +79 -2
- package/dist/records-v2/SalesTerritoryRecord.js +107 -0
- package/dist/records-v2/ScheduleSlotRecord.d.ts +42 -1
- package/dist/records-v2/ScheduleSlotRecord.js +58 -0
- package/dist/records-v2/ServiceAppointmentConfigRecord.d.ts +287 -2
- package/dist/records-v2/ServiceAppointmentConfigRecord.js +367 -0
- package/dist/records-v2/ServiceAppointmentRecord.d.ts +81 -0
- package/dist/records-v2/ServiceAppointmentRecord.js +136 -0
- package/dist/records-v2/ServiceRecord.d.ts +40 -0
- package/dist/records-v2/ServiceRecord.js +69 -0
- package/dist/records-v2/ServiceVisitAuditRecord.d.ts +83 -2
- package/dist/records-v2/ServiceVisitAuditRecord.js +124 -0
- package/dist/records-v2/SiteSpecificRiskAssessmentOutcomeFormRecord.d.ts +83 -2
- package/dist/records-v2/SiteSpecificRiskAssessmentOutcomeFormRecord.js +124 -0
- package/dist/records-v2/SmsMessageRecord.d.ts +175 -2
- package/dist/records-v2/SmsMessageRecord.js +255 -0
- package/dist/records-v2/SweeperMaintenanceAuditRecord.d.ts +83 -2
- package/dist/records-v2/SweeperMaintenanceAuditRecord.js +124 -0
- package/dist/records-v2/TeamRecord.d.ts +101 -0
- package/dist/records-v2/TeamRecord.js +169 -0
- package/dist/records-v2/TestEntityForVisualBuilderRecord.d.ts +115 -2
- package/dist/records-v2/TestEntityForVisualBuilderRecord.js +156 -0
- package/dist/records-v2/TimeSlotRecord.d.ts +21 -0
- package/dist/records-v2/TimeSlotRecord.js +37 -0
- package/dist/records-v2/TransactionRecord.d.ts +181 -1
- package/dist/records-v2/TransactionRecord.js +288 -0
- package/dist/records-v2/TwilioUserUpdateRecord.d.ts +42 -1
- package/dist/records-v2/TwilioUserUpdateRecord.js +58 -0
- package/dist/records-v2/UgAuditOfInstallationRecord.d.ts +83 -2
- package/dist/records-v2/UgAuditOfInstallationRecord.js +124 -0
- package/dist/records-v2/UgExternalAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgExternalAuditRecord.js +124 -0
- package/dist/records-v2/UgInProgressAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgInProgressAuditRecord.js +124 -0
- package/dist/records-v2/UgInstallationAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgInstallationAuditRecord.js +124 -0
- package/dist/records-v2/UgRetroAuditRecord.d.ts +83 -2
- package/dist/records-v2/UgRetroAuditRecord.js +124 -0
- package/dist/records-v2/UserRecord.d.ts +400 -0
- package/dist/records-v2/UserRecord.js +663 -0
- package/dist/records-v2/VisitRecord.d.ts +121 -0
- package/dist/records-v2/VisitRecord.js +202 -0
- package/dist/records-v2/VoiceConfigurationRecord.d.ts +21 -0
- package/dist/records-v2/VoiceConfigurationRecord.js +37 -0
- package/dist/records-v2/WayleaveAuditRecord.d.ts +83 -2
- package/dist/records-v2/WayleaveAuditRecord.js +124 -0
- package/dist/records-v2/WorkOrderRecord.d.ts +1226 -2
- package/dist/records-v2/WorkOrderRecord.js +1865 -0
- package/dist/records-v2/WorkOrderStatusUpdateRecord.d.ts +75 -2
- package/dist/records-v2/WorkOrderStatusUpdateRecord.js +90 -0
- package/dist/records-v2/YfFieldServiceVisitRecord.d.ts +83 -2
- package/dist/records-v2/YfFieldServiceVisitRecord.js +124 -0
- package/dist/records-v2/YfStockAuditRecord.d.ts +103 -2
- package/dist/records-v2/YfStockAuditRecord.js +157 -0
- package/dist/records-v2/index.d.ts +1 -1
- package/dist/records-v2/index.js +5 -5
- package/package.json +1 -1
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
* await record.createServiceAppointmentConfig({ ... }).execute();
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
+
* Entity Types: FINANCE, INSPECTION, INSTALL, INSTALL_SERVICE, NETWORK_ADJUSTMENT, PLANNING, PRE_PULL, REMEDIATION, SERVICE, WAYLEAVE
|
|
18
|
+
*
|
|
17
19
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
18
20
|
*/
|
|
19
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
@@ -29,6 +31,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
31
|
exports.isServiceAppointmentConfigRecord = exports.ServiceAppointmentConfigRecord = void 0;
|
|
30
32
|
const uuid_1 = require("uuid");
|
|
31
33
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
34
|
+
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
35
|
+
const UserRecord_1 = require("./UserRecord");
|
|
36
|
+
const NoteRecord_1 = require("./NoteRecord");
|
|
37
|
+
const ServiceAppointmentRecord_1 = require("./ServiceAppointmentRecord");
|
|
38
|
+
const ChangeReasonRecord_1 = require("./ChangeReasonRecord");
|
|
39
|
+
const WorkOrderRecord_1 = require("./WorkOrderRecord");
|
|
40
|
+
const ScheduleSlotRecord_1 = require("./ScheduleSlotRecord");
|
|
32
41
|
/**
|
|
33
42
|
* Builder for action execution with dryRun support
|
|
34
43
|
*
|
|
@@ -140,6 +149,349 @@ class ServiceAppointmentConfigRecord {
|
|
|
140
149
|
/** Access the underlying OdinRecord (null for new records) */
|
|
141
150
|
get record() { return this._record; }
|
|
142
151
|
// ============================================
|
|
152
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
153
|
+
// ============================================
|
|
154
|
+
/**
|
|
155
|
+
* Type guard: check if this record is of type FINANCE
|
|
156
|
+
*
|
|
157
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
158
|
+
* giving you access to FINANCE-specific properties.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* ```typescript
|
|
162
|
+
* if (record.isFinance()) {
|
|
163
|
+
* // TypeScript knows record.properties is FinanceServiceAppointmentConfigProperties
|
|
164
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
* @remarks Finance schedule
|
|
168
|
+
*/
|
|
169
|
+
isFinance() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'FINANCE'; }
|
|
170
|
+
/**
|
|
171
|
+
* Type guard: check if this record is of type INSPECTION
|
|
172
|
+
*
|
|
173
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
174
|
+
* giving you access to INSPECTION-specific properties.
|
|
175
|
+
*
|
|
176
|
+
* @example
|
|
177
|
+
* ```typescript
|
|
178
|
+
* if (record.isInspection()) {
|
|
179
|
+
* // TypeScript knows record.properties is InspectionServiceAppointmentConfigProperties
|
|
180
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
181
|
+
* }
|
|
182
|
+
* ```
|
|
183
|
+
* @remarks Inspection
|
|
184
|
+
*/
|
|
185
|
+
isInspection() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'INSPECTION'; }
|
|
186
|
+
/**
|
|
187
|
+
* Type guard: check if this record is of type INSTALL
|
|
188
|
+
*
|
|
189
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
190
|
+
* giving you access to INSTALL-specific properties.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* if (record.isInstall()) {
|
|
195
|
+
* // TypeScript knows record.properties is InstallServiceAppointmentConfigProperties
|
|
196
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
197
|
+
* }
|
|
198
|
+
* ```
|
|
199
|
+
* @remarks install appointments
|
|
200
|
+
*/
|
|
201
|
+
isInstall() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'INSTALL'; }
|
|
202
|
+
/**
|
|
203
|
+
* Type guard: check if this record is of type INSTALL_SERVICE
|
|
204
|
+
*
|
|
205
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
206
|
+
* giving you access to INSTALL_SERVICE-specific properties.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```typescript
|
|
210
|
+
* if (record.isInstallService()) {
|
|
211
|
+
* // TypeScript knows record.properties is InstallServiceServiceAppointmentConfigProperties
|
|
212
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
213
|
+
* }
|
|
214
|
+
* ```
|
|
215
|
+
* @remarks schedules allowing both install and service bookings
|
|
216
|
+
*/
|
|
217
|
+
isInstallService() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'INSTALL_SERVICE'; }
|
|
218
|
+
/**
|
|
219
|
+
* Type guard: check if this record is of type NETWORK_ADJUSTMENT
|
|
220
|
+
*
|
|
221
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
222
|
+
* giving you access to NETWORK_ADJUSTMENT-specific properties.
|
|
223
|
+
*
|
|
224
|
+
* @example
|
|
225
|
+
* ```typescript
|
|
226
|
+
* if (record.isNetworkAdjustment()) {
|
|
227
|
+
* // TypeScript knows record.properties is NetworkAdjustmentServiceAppointmentConfigProperties
|
|
228
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
229
|
+
* }
|
|
230
|
+
* ```
|
|
231
|
+
* @remarks Network adjustment schedule
|
|
232
|
+
*/
|
|
233
|
+
isNetworkAdjustment() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'NETWORK_ADJUSTMENT'; }
|
|
234
|
+
/**
|
|
235
|
+
* Type guard: check if this record is of type PLANNING
|
|
236
|
+
*
|
|
237
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
238
|
+
* giving you access to PLANNING-specific properties.
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* ```typescript
|
|
242
|
+
* if (record.isPlanning()) {
|
|
243
|
+
* // TypeScript knows record.properties is PlanningServiceAppointmentConfigProperties
|
|
244
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
245
|
+
* }
|
|
246
|
+
* ```
|
|
247
|
+
* @remarks Planning schedule
|
|
248
|
+
*/
|
|
249
|
+
isPlanning() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'PLANNING'; }
|
|
250
|
+
/**
|
|
251
|
+
* Type guard: check if this record is of type PRE_PULL
|
|
252
|
+
*
|
|
253
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
254
|
+
* giving you access to PRE_PULL-specific properties.
|
|
255
|
+
*
|
|
256
|
+
* @example
|
|
257
|
+
* ```typescript
|
|
258
|
+
* if (record.isPrePull()) {
|
|
259
|
+
* // TypeScript knows record.properties is PrePullServiceAppointmentConfigProperties
|
|
260
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
261
|
+
* }
|
|
262
|
+
* ```
|
|
263
|
+
* @remarks Pre-pull schedule type
|
|
264
|
+
*/
|
|
265
|
+
isPrePull() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'PRE_PULL'; }
|
|
266
|
+
/**
|
|
267
|
+
* Type guard: check if this record is of type REMEDIATION
|
|
268
|
+
*
|
|
269
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
270
|
+
* giving you access to REMEDIATION-specific properties.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* ```typescript
|
|
274
|
+
* if (record.isRemediation()) {
|
|
275
|
+
* // TypeScript knows record.properties is RemediationServiceAppointmentConfigProperties
|
|
276
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
277
|
+
* }
|
|
278
|
+
* ```
|
|
279
|
+
* @remarks Remediation
|
|
280
|
+
*/
|
|
281
|
+
isRemediation() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'REMEDIATION'; }
|
|
282
|
+
/**
|
|
283
|
+
* Type guard: check if this record is of type SERVICE
|
|
284
|
+
*
|
|
285
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
286
|
+
* giving you access to SERVICE-specific properties.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```typescript
|
|
290
|
+
* if (record.isService()) {
|
|
291
|
+
* // TypeScript knows record.properties is ServiceServiceAppointmentConfigProperties
|
|
292
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
293
|
+
* }
|
|
294
|
+
* ```
|
|
295
|
+
* @remarks service appointments
|
|
296
|
+
*/
|
|
297
|
+
isService() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'SERVICE'; }
|
|
298
|
+
/**
|
|
299
|
+
* Type guard: check if this record is of type WAYLEAVE
|
|
300
|
+
*
|
|
301
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
302
|
+
* giving you access to WAYLEAVE-specific properties.
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* if (record.isWayleave()) {
|
|
307
|
+
* // TypeScript knows record.properties is WayleaveServiceAppointmentConfigProperties
|
|
308
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
309
|
+
* }
|
|
310
|
+
* ```
|
|
311
|
+
* @remarks Wayleave schedule
|
|
312
|
+
*/
|
|
313
|
+
isWayleave() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'WAYLEAVE'; }
|
|
314
|
+
/**
|
|
315
|
+
* Access linked User records
|
|
316
|
+
* @remarks Available labels: Engineers, Manager, Supervisor
|
|
317
|
+
* @throws Error if called on a new (unsaved) record
|
|
318
|
+
*
|
|
319
|
+
* @example
|
|
320
|
+
* ```typescript
|
|
321
|
+
* // Get all linked User records
|
|
322
|
+
* const items = await record.users.list();
|
|
323
|
+
* const first = await record.users.first();
|
|
324
|
+
*
|
|
325
|
+
* // Filter by label
|
|
326
|
+
* const specific = await record.users.first({ label: 'Engineers' });
|
|
327
|
+
* ```
|
|
328
|
+
*/
|
|
329
|
+
get users() {
|
|
330
|
+
var _a;
|
|
331
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
332
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
333
|
+
if (!this._users) {
|
|
334
|
+
this._users = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
335
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
336
|
+
targetEntity: 'IdentityModule:User',
|
|
337
|
+
targetModuleName: 'IdentityModule',
|
|
338
|
+
targetEntityName: 'User',
|
|
339
|
+
labels: ['Engineers', 'Manager', 'Supervisor'],
|
|
340
|
+
}, UserRecord_1.UserRecord);
|
|
341
|
+
}
|
|
342
|
+
return this._users;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Access linked Note records
|
|
346
|
+
* @remarks Available labels: ServiceAppointmentConfig__Note
|
|
347
|
+
* @throws Error if called on a new (unsaved) record
|
|
348
|
+
*
|
|
349
|
+
* @example
|
|
350
|
+
* ```typescript
|
|
351
|
+
* // Get all linked Note records
|
|
352
|
+
* const items = await record.notes.list();
|
|
353
|
+
* const first = await record.notes.first();
|
|
354
|
+
*
|
|
355
|
+
* // Filter by label
|
|
356
|
+
* const specific = await record.notes.first({ label: 'ServiceAppointmentConfig__Note' });
|
|
357
|
+
* ```
|
|
358
|
+
*/
|
|
359
|
+
get notes() {
|
|
360
|
+
var _a;
|
|
361
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
362
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
363
|
+
if (!this._notes) {
|
|
364
|
+
this._notes = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
365
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
366
|
+
targetEntity: 'SupportModule:Note',
|
|
367
|
+
targetModuleName: 'SupportModule',
|
|
368
|
+
targetEntityName: 'Note',
|
|
369
|
+
labels: ['ServiceAppointmentConfig__Note'],
|
|
370
|
+
}, NoteRecord_1.NoteRecord);
|
|
371
|
+
}
|
|
372
|
+
return this._notes;
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Access linked ServiceAppointment records
|
|
376
|
+
* @remarks Available labels: ServiceAppointmentConfig__ServiceAppointment
|
|
377
|
+
* @throws Error if called on a new (unsaved) record
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* // Get all linked ServiceAppointment records
|
|
382
|
+
* const items = await record.serviceAppointments.list();
|
|
383
|
+
* const first = await record.serviceAppointments.first();
|
|
384
|
+
*
|
|
385
|
+
* // Filter by label
|
|
386
|
+
* const specific = await record.serviceAppointments.first({ label: 'ServiceAppointmentConfig__ServiceAppointment' });
|
|
387
|
+
* ```
|
|
388
|
+
*/
|
|
389
|
+
get serviceAppointments() {
|
|
390
|
+
var _a;
|
|
391
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
392
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
393
|
+
if (!this._serviceAppointments) {
|
|
394
|
+
this._serviceAppointments = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
395
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
396
|
+
targetEntity: 'FieldServiceModule:ServiceAppointment',
|
|
397
|
+
targetModuleName: 'FieldServiceModule',
|
|
398
|
+
targetEntityName: 'ServiceAppointment',
|
|
399
|
+
labels: ['ServiceAppointmentConfig__ServiceAppointment'],
|
|
400
|
+
}, ServiceAppointmentRecord_1.ServiceAppointmentRecord);
|
|
401
|
+
}
|
|
402
|
+
return this._serviceAppointments;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Access linked ChangeReason records
|
|
406
|
+
* @remarks Available labels: ChangeReason__ServiceAppointmentConfig
|
|
407
|
+
* @throws Error if called on a new (unsaved) record
|
|
408
|
+
*
|
|
409
|
+
* @example
|
|
410
|
+
* ```typescript
|
|
411
|
+
* // Get all linked ChangeReason records
|
|
412
|
+
* const items = await record.changeReasons.list();
|
|
413
|
+
* const first = await record.changeReasons.first();
|
|
414
|
+
*
|
|
415
|
+
* // Filter by label
|
|
416
|
+
* const specific = await record.changeReasons.first({ label: 'ChangeReason__ServiceAppointmentConfig' });
|
|
417
|
+
* ```
|
|
418
|
+
*/
|
|
419
|
+
get changeReasons() {
|
|
420
|
+
var _a;
|
|
421
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
422
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
423
|
+
if (!this._changeReasons) {
|
|
424
|
+
this._changeReasons = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
425
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
426
|
+
targetEntity: 'FieldServiceModule:ChangeReason',
|
|
427
|
+
targetModuleName: 'FieldServiceModule',
|
|
428
|
+
targetEntityName: 'ChangeReason',
|
|
429
|
+
labels: ['ChangeReason__ServiceAppointmentConfig'],
|
|
430
|
+
}, ChangeReasonRecord_1.ChangeReasonRecord);
|
|
431
|
+
}
|
|
432
|
+
return this._changeReasons;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Access linked WorkOrder records
|
|
436
|
+
* @remarks Available labels: WorkOrder__ServiceAppointmentConfig
|
|
437
|
+
* @throws Error if called on a new (unsaved) record
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* ```typescript
|
|
441
|
+
* // Get all linked WorkOrder records
|
|
442
|
+
* const items = await record.workOrders.list();
|
|
443
|
+
* const first = await record.workOrders.first();
|
|
444
|
+
*
|
|
445
|
+
* // Filter by label
|
|
446
|
+
* const specific = await record.workOrders.first({ label: 'WorkOrder__ServiceAppointmentConfig' });
|
|
447
|
+
* ```
|
|
448
|
+
*/
|
|
449
|
+
get workOrders() {
|
|
450
|
+
var _a;
|
|
451
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
452
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
453
|
+
if (!this._workOrders) {
|
|
454
|
+
this._workOrders = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
455
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
456
|
+
targetEntity: 'FieldServiceModule:WorkOrder',
|
|
457
|
+
targetModuleName: 'FieldServiceModule',
|
|
458
|
+
targetEntityName: 'WorkOrder',
|
|
459
|
+
labels: ['WorkOrder__ServiceAppointmentConfig'],
|
|
460
|
+
}, WorkOrderRecord_1.WorkOrderRecord);
|
|
461
|
+
}
|
|
462
|
+
return this._workOrders;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Access linked ScheduleSlot records
|
|
466
|
+
* @remarks Available labels: ServiceAppointmentConfig__ScheduleSlot
|
|
467
|
+
* @throws Error if called on a new (unsaved) record
|
|
468
|
+
*
|
|
469
|
+
* @example
|
|
470
|
+
* ```typescript
|
|
471
|
+
* // Get all linked ScheduleSlot records
|
|
472
|
+
* const items = await record.scheduleSlots.list();
|
|
473
|
+
* const first = await record.scheduleSlots.first();
|
|
474
|
+
*
|
|
475
|
+
* // Filter by label
|
|
476
|
+
* const specific = await record.scheduleSlots.first({ label: 'ServiceAppointmentConfig__ScheduleSlot' });
|
|
477
|
+
* ```
|
|
478
|
+
*/
|
|
479
|
+
get scheduleSlots() {
|
|
480
|
+
var _a;
|
|
481
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
482
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
483
|
+
if (!this._scheduleSlots) {
|
|
484
|
+
this._scheduleSlots = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
485
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
486
|
+
targetEntity: 'FieldServiceModule:ScheduleSlot',
|
|
487
|
+
targetModuleName: 'FieldServiceModule',
|
|
488
|
+
targetEntityName: 'ScheduleSlot',
|
|
489
|
+
labels: ['ServiceAppointmentConfig__ScheduleSlot'],
|
|
490
|
+
}, ScheduleSlotRecord_1.ScheduleSlotRecord);
|
|
491
|
+
}
|
|
492
|
+
return this._scheduleSlots;
|
|
493
|
+
}
|
|
494
|
+
// ============================================
|
|
143
495
|
// LINK MANAGEMENT
|
|
144
496
|
// ============================================
|
|
145
497
|
/**
|
|
@@ -616,6 +968,21 @@ class ServiceAppointmentConfigRecord {
|
|
|
616
968
|
}
|
|
617
969
|
}
|
|
618
970
|
exports.ServiceAppointmentConfigRecord = ServiceAppointmentConfigRecord;
|
|
971
|
+
// ============================================
|
|
972
|
+
// TYPED LINK ACCESSORS
|
|
973
|
+
// ============================================
|
|
974
|
+
/** Valid labels for User associations */
|
|
975
|
+
ServiceAppointmentConfigRecord.usersLabels = ['Engineers', 'Manager', 'Supervisor'];
|
|
976
|
+
/** Valid labels for Note associations */
|
|
977
|
+
ServiceAppointmentConfigRecord.notesLabels = ['ServiceAppointmentConfig__Note'];
|
|
978
|
+
/** Valid labels for ServiceAppointment associations */
|
|
979
|
+
ServiceAppointmentConfigRecord.serviceAppointmentsLabels = ['ServiceAppointmentConfig__ServiceAppointment'];
|
|
980
|
+
/** Valid labels for ChangeReason associations */
|
|
981
|
+
ServiceAppointmentConfigRecord.changeReasonsLabels = ['ChangeReason__ServiceAppointmentConfig'];
|
|
982
|
+
/** Valid labels for WorkOrder associations */
|
|
983
|
+
ServiceAppointmentConfigRecord.workOrdersLabels = ['WorkOrder__ServiceAppointmentConfig'];
|
|
984
|
+
/** Valid labels for ScheduleSlot associations */
|
|
985
|
+
ServiceAppointmentConfigRecord.scheduleSlotsLabels = ['ServiceAppointmentConfig__ScheduleSlot'];
|
|
619
986
|
/** Type guard to check if an object is a ServiceAppointmentConfigRecord */
|
|
620
987
|
function isServiceAppointmentConfigRecord(obj) {
|
|
621
988
|
return obj instanceof ServiceAppointmentConfigRecord;
|
|
@@ -19,9 +19,14 @@ import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
|
19
19
|
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
20
20
|
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
21
21
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
22
|
+
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
22
23
|
import { ServiceAppointmentProperties } from '../entities-v2/ServiceAppointment';
|
|
23
24
|
import { NewAppointmentProperties } from '../actions-v2/NewAppointmentDto';
|
|
24
25
|
import { UpdateSupplierReferenceProperties } from '../actions-v2/UpdateSupplierReferenceDto';
|
|
26
|
+
import { NoteRecord } from './NoteRecord';
|
|
27
|
+
import { ServiceAppointmentConfigRecord } from './ServiceAppointmentConfigRecord';
|
|
28
|
+
import { FileRecord } from './FileRecord';
|
|
29
|
+
import { WorkOrderRecord } from './WorkOrderRecord';
|
|
25
30
|
/**
|
|
26
31
|
* Builder for action execution with dryRun support
|
|
27
32
|
*
|
|
@@ -85,6 +90,10 @@ export declare class ServiceAppointmentRecord<TProps = ServiceAppointmentPropert
|
|
|
85
90
|
private _provider;
|
|
86
91
|
private _pendingLinks;
|
|
87
92
|
private _preGeneratedId;
|
|
93
|
+
private _notes?;
|
|
94
|
+
private _serviceAppointmentConfigs?;
|
|
95
|
+
private _files?;
|
|
96
|
+
private _workOrders?;
|
|
88
97
|
/**
|
|
89
98
|
* Create a record wrapper.
|
|
90
99
|
* @param record - The underlying record, or null for create operations
|
|
@@ -110,6 +119,78 @@ export declare class ServiceAppointmentRecord<TProps = ServiceAppointmentPropert
|
|
|
110
119
|
get groups(): string[];
|
|
111
120
|
/** Access the underlying OdinRecord (null for new records) */
|
|
112
121
|
get record(): OdinRecord<TProps> | null;
|
|
122
|
+
/** Valid labels for Note associations */
|
|
123
|
+
static readonly notesLabels: readonly ["ServiceAppointment__Note"];
|
|
124
|
+
/**
|
|
125
|
+
* Access linked Note records
|
|
126
|
+
* @remarks Available labels: ServiceAppointment__Note
|
|
127
|
+
* @throws Error if called on a new (unsaved) record
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* // Get all linked Note records
|
|
132
|
+
* const items = await record.notes.list();
|
|
133
|
+
* const first = await record.notes.first();
|
|
134
|
+
*
|
|
135
|
+
* // Filter by label
|
|
136
|
+
* const specific = await record.notes.first({ label: 'ServiceAppointment__Note' });
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
get notes(): RecordLinkManager<NoteRecord, typeof ServiceAppointmentRecord['notesLabels'][number]>;
|
|
140
|
+
/** Valid labels for ServiceAppointmentConfig associations */
|
|
141
|
+
static readonly serviceAppointmentConfigsLabels: readonly ["ServiceAppointmentConfig__ServiceAppointment"];
|
|
142
|
+
/**
|
|
143
|
+
* Access linked ServiceAppointmentConfig records
|
|
144
|
+
* @remarks Available labels: ServiceAppointmentConfig__ServiceAppointment
|
|
145
|
+
* @throws Error if called on a new (unsaved) record
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* // Get all linked ServiceAppointmentConfig records
|
|
150
|
+
* const items = await record.serviceAppointmentConfigs.list();
|
|
151
|
+
* const first = await record.serviceAppointmentConfigs.first();
|
|
152
|
+
*
|
|
153
|
+
* // Filter by label
|
|
154
|
+
* const specific = await record.serviceAppointmentConfigs.first({ label: 'ServiceAppointmentConfig__ServiceAppointment' });
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
get serviceAppointmentConfigs(): RecordLinkManager<ServiceAppointmentConfigRecord, typeof ServiceAppointmentRecord['serviceAppointmentConfigsLabels'][number]>;
|
|
158
|
+
/** Valid labels for File associations */
|
|
159
|
+
static readonly filesLabels: readonly ["ServiceAppointment__File"];
|
|
160
|
+
/**
|
|
161
|
+
* Access linked File records
|
|
162
|
+
* @remarks Available labels: ServiceAppointment__File
|
|
163
|
+
* @throws Error if called on a new (unsaved) record
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* // Get all linked File records
|
|
168
|
+
* const items = await record.files.list();
|
|
169
|
+
* const first = await record.files.first();
|
|
170
|
+
*
|
|
171
|
+
* // Filter by label
|
|
172
|
+
* const specific = await record.files.first({ label: 'ServiceAppointment__File' });
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
get files(): RecordLinkManager<FileRecord, typeof ServiceAppointmentRecord['filesLabels'][number]>;
|
|
176
|
+
/** Valid labels for WorkOrder associations */
|
|
177
|
+
static readonly workOrdersLabels: readonly ["WorkOrder_ServiceAppointment"];
|
|
178
|
+
/**
|
|
179
|
+
* Access linked WorkOrder records
|
|
180
|
+
* @remarks Available labels: WorkOrder_ServiceAppointment
|
|
181
|
+
* @throws Error if called on a new (unsaved) record
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* // Get all linked WorkOrder records
|
|
186
|
+
* const items = await record.workOrders.list();
|
|
187
|
+
* const first = await record.workOrders.first();
|
|
188
|
+
*
|
|
189
|
+
* // Filter by label
|
|
190
|
+
* const specific = await record.workOrders.first({ label: 'WorkOrder_ServiceAppointment' });
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
get workOrders(): RecordLinkManager<WorkOrderRecord, typeof ServiceAppointmentRecord['workOrdersLabels'][number]>;
|
|
113
194
|
/**
|
|
114
195
|
* Queue a link to be created with the next action.
|
|
115
196
|
* Works for both create and update actions.
|
|
@@ -29,6 +29,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
29
|
exports.isServiceAppointmentRecord = exports.ServiceAppointmentRecord = void 0;
|
|
30
30
|
const uuid_1 = require("uuid");
|
|
31
31
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
32
|
+
const record_link_manager_1 = require("@d19n/odin-sdk-generator/dist/record-link-manager");
|
|
33
|
+
const NoteRecord_1 = require("./NoteRecord");
|
|
34
|
+
const ServiceAppointmentConfigRecord_1 = require("./ServiceAppointmentConfigRecord");
|
|
35
|
+
const FileRecord_1 = require("./FileRecord");
|
|
36
|
+
const WorkOrderRecord_1 = require("./WorkOrderRecord");
|
|
32
37
|
/**
|
|
33
38
|
* Builder for action execution with dryRun support
|
|
34
39
|
*
|
|
@@ -139,6 +144,126 @@ class ServiceAppointmentRecord {
|
|
|
139
144
|
get groups() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.groups) || []; }
|
|
140
145
|
/** Access the underlying OdinRecord (null for new records) */
|
|
141
146
|
get record() { return this._record; }
|
|
147
|
+
/**
|
|
148
|
+
* Access linked Note records
|
|
149
|
+
* @remarks Available labels: ServiceAppointment__Note
|
|
150
|
+
* @throws Error if called on a new (unsaved) record
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```typescript
|
|
154
|
+
* // Get all linked Note records
|
|
155
|
+
* const items = await record.notes.list();
|
|
156
|
+
* const first = await record.notes.first();
|
|
157
|
+
*
|
|
158
|
+
* // Filter by label
|
|
159
|
+
* const specific = await record.notes.first({ label: 'ServiceAppointment__Note' });
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
get notes() {
|
|
163
|
+
var _a;
|
|
164
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
165
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
166
|
+
if (!this._notes) {
|
|
167
|
+
this._notes = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
168
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointment',
|
|
169
|
+
targetEntity: 'SupportModule:Note',
|
|
170
|
+
targetModuleName: 'SupportModule',
|
|
171
|
+
targetEntityName: 'Note',
|
|
172
|
+
labels: ['ServiceAppointment__Note'],
|
|
173
|
+
}, NoteRecord_1.NoteRecord);
|
|
174
|
+
}
|
|
175
|
+
return this._notes;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Access linked ServiceAppointmentConfig records
|
|
179
|
+
* @remarks Available labels: ServiceAppointmentConfig__ServiceAppointment
|
|
180
|
+
* @throws Error if called on a new (unsaved) record
|
|
181
|
+
*
|
|
182
|
+
* @example
|
|
183
|
+
* ```typescript
|
|
184
|
+
* // Get all linked ServiceAppointmentConfig records
|
|
185
|
+
* const items = await record.serviceAppointmentConfigs.list();
|
|
186
|
+
* const first = await record.serviceAppointmentConfigs.first();
|
|
187
|
+
*
|
|
188
|
+
* // Filter by label
|
|
189
|
+
* const specific = await record.serviceAppointmentConfigs.first({ label: 'ServiceAppointmentConfig__ServiceAppointment' });
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
get serviceAppointmentConfigs() {
|
|
193
|
+
var _a;
|
|
194
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
195
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
196
|
+
if (!this._serviceAppointmentConfigs) {
|
|
197
|
+
this._serviceAppointmentConfigs = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
198
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointment',
|
|
199
|
+
targetEntity: 'FieldServiceModule:ServiceAppointmentConfig',
|
|
200
|
+
targetModuleName: 'FieldServiceModule',
|
|
201
|
+
targetEntityName: 'ServiceAppointmentConfig',
|
|
202
|
+
labels: ['ServiceAppointmentConfig__ServiceAppointment'],
|
|
203
|
+
}, ServiceAppointmentConfigRecord_1.ServiceAppointmentConfigRecord);
|
|
204
|
+
}
|
|
205
|
+
return this._serviceAppointmentConfigs;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Access linked File records
|
|
209
|
+
* @remarks Available labels: ServiceAppointment__File
|
|
210
|
+
* @throws Error if called on a new (unsaved) record
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* // Get all linked File records
|
|
215
|
+
* const items = await record.files.list();
|
|
216
|
+
* const first = await record.files.first();
|
|
217
|
+
*
|
|
218
|
+
* // Filter by label
|
|
219
|
+
* const specific = await record.files.first({ label: 'ServiceAppointment__File' });
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
get files() {
|
|
223
|
+
var _a;
|
|
224
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
225
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
226
|
+
if (!this._files) {
|
|
227
|
+
this._files = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
228
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointment',
|
|
229
|
+
targetEntity: 'SchemaModule:File',
|
|
230
|
+
targetModuleName: 'SchemaModule',
|
|
231
|
+
targetEntityName: 'File',
|
|
232
|
+
labels: ['ServiceAppointment__File'],
|
|
233
|
+
}, FileRecord_1.FileRecord);
|
|
234
|
+
}
|
|
235
|
+
return this._files;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Access linked WorkOrder records
|
|
239
|
+
* @remarks Available labels: WorkOrder_ServiceAppointment
|
|
240
|
+
* @throws Error if called on a new (unsaved) record
|
|
241
|
+
*
|
|
242
|
+
* @example
|
|
243
|
+
* ```typescript
|
|
244
|
+
* // Get all linked WorkOrder records
|
|
245
|
+
* const items = await record.workOrders.list();
|
|
246
|
+
* const first = await record.workOrders.first();
|
|
247
|
+
*
|
|
248
|
+
* // Filter by label
|
|
249
|
+
* const specific = await record.workOrders.first({ label: 'WorkOrder_ServiceAppointment' });
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
get workOrders() {
|
|
253
|
+
var _a;
|
|
254
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
255
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
256
|
+
if (!this._workOrders) {
|
|
257
|
+
this._workOrders = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
258
|
+
sourceEntity: 'FieldServiceModule:ServiceAppointment',
|
|
259
|
+
targetEntity: 'FieldServiceModule:WorkOrder',
|
|
260
|
+
targetModuleName: 'FieldServiceModule',
|
|
261
|
+
targetEntityName: 'WorkOrder',
|
|
262
|
+
labels: ['WorkOrder_ServiceAppointment'],
|
|
263
|
+
}, WorkOrderRecord_1.WorkOrderRecord);
|
|
264
|
+
}
|
|
265
|
+
return this._workOrders;
|
|
266
|
+
}
|
|
142
267
|
// ============================================
|
|
143
268
|
// LINK MANAGEMENT
|
|
144
269
|
// ============================================
|
|
@@ -247,6 +372,17 @@ class ServiceAppointmentRecord {
|
|
|
247
372
|
}
|
|
248
373
|
}
|
|
249
374
|
exports.ServiceAppointmentRecord = ServiceAppointmentRecord;
|
|
375
|
+
// ============================================
|
|
376
|
+
// TYPED LINK ACCESSORS
|
|
377
|
+
// ============================================
|
|
378
|
+
/** Valid labels for Note associations */
|
|
379
|
+
ServiceAppointmentRecord.notesLabels = ['ServiceAppointment__Note'];
|
|
380
|
+
/** Valid labels for ServiceAppointmentConfig associations */
|
|
381
|
+
ServiceAppointmentRecord.serviceAppointmentConfigsLabels = ['ServiceAppointmentConfig__ServiceAppointment'];
|
|
382
|
+
/** Valid labels for File associations */
|
|
383
|
+
ServiceAppointmentRecord.filesLabels = ['ServiceAppointment__File'];
|
|
384
|
+
/** Valid labels for WorkOrder associations */
|
|
385
|
+
ServiceAppointmentRecord.workOrdersLabels = ['WorkOrder_ServiceAppointment'];
|
|
250
386
|
/** Type guard to check if an object is a ServiceAppointmentRecord */
|
|
251
387
|
function isServiceAppointmentRecord(obj) {
|
|
252
388
|
return obj instanceof ServiceAppointmentRecord;
|