@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.createAccountCredit({ ... }).execute();
|
|
15
15
|
* ```
|
|
16
16
|
*
|
|
17
|
+
* Entity Types: DEFAULT
|
|
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,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
29
31
|
exports.isAccountCreditRecord = exports.AccountCreditRecord = 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 ContactRecord_1 = require("./ContactRecord");
|
|
36
|
+
const InvoiceRecord_1 = require("./InvoiceRecord");
|
|
32
37
|
/**
|
|
33
38
|
* Builder for action execution with dryRun support
|
|
34
39
|
*
|
|
@@ -140,6 +145,85 @@ class AccountCreditRecord {
|
|
|
140
145
|
/** Access the underlying OdinRecord (null for new records) */
|
|
141
146
|
get record() { return this._record; }
|
|
142
147
|
// ============================================
|
|
148
|
+
// TYPE GUARDS (with TypeScript type predicates)
|
|
149
|
+
// ============================================
|
|
150
|
+
/**
|
|
151
|
+
* Type guard: check if this record is of type DEFAULT
|
|
152
|
+
*
|
|
153
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
154
|
+
* giving you access to DEFAULT-specific properties.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```typescript
|
|
158
|
+
* if (record.isDefault()) {
|
|
159
|
+
* // TypeScript knows record.properties is AccountCreditProperties
|
|
160
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
161
|
+
* }
|
|
162
|
+
* ```
|
|
163
|
+
* @remarks This is the default record type
|
|
164
|
+
*/
|
|
165
|
+
isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
|
|
166
|
+
/**
|
|
167
|
+
* Access linked Contact records
|
|
168
|
+
* @remarks Available labels: Contact__AccountCredit
|
|
169
|
+
* @throws Error if called on a new (unsaved) record
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // Get all linked Contact records
|
|
174
|
+
* const items = await record.contacts.list();
|
|
175
|
+
* const first = await record.contacts.first();
|
|
176
|
+
*
|
|
177
|
+
* // Filter by label
|
|
178
|
+
* const specific = await record.contacts.first({ label: 'Contact__AccountCredit' });
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
get contacts() {
|
|
182
|
+
var _a;
|
|
183
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
184
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
185
|
+
if (!this._contacts) {
|
|
186
|
+
this._contacts = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
187
|
+
sourceEntity: 'BillingModule:AccountCredit',
|
|
188
|
+
targetEntity: 'CrmModule:Contact',
|
|
189
|
+
targetModuleName: 'CrmModule',
|
|
190
|
+
targetEntityName: 'Contact',
|
|
191
|
+
labels: ['Contact__AccountCredit'],
|
|
192
|
+
}, ContactRecord_1.ContactRecord);
|
|
193
|
+
}
|
|
194
|
+
return this._contacts;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Access linked Invoice records
|
|
198
|
+
* @remarks Available labels: AccountCredit__Invoice
|
|
199
|
+
* @throws Error if called on a new (unsaved) record
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* // Get all linked Invoice records
|
|
204
|
+
* const items = await record.invoices.list();
|
|
205
|
+
* const first = await record.invoices.first();
|
|
206
|
+
*
|
|
207
|
+
* // Filter by label
|
|
208
|
+
* const specific = await record.invoices.first({ label: 'AccountCredit__Invoice' });
|
|
209
|
+
* ```
|
|
210
|
+
*/
|
|
211
|
+
get invoices() {
|
|
212
|
+
var _a;
|
|
213
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
214
|
+
throw new Error('Cannot access links on a new (unsaved) record');
|
|
215
|
+
if (!this._invoices) {
|
|
216
|
+
this._invoices = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
|
|
217
|
+
sourceEntity: 'BillingModule:AccountCredit',
|
|
218
|
+
targetEntity: 'BillingModule:Invoice',
|
|
219
|
+
targetModuleName: 'BillingModule',
|
|
220
|
+
targetEntityName: 'Invoice',
|
|
221
|
+
labels: ['AccountCredit__Invoice'],
|
|
222
|
+
}, InvoiceRecord_1.InvoiceRecord);
|
|
223
|
+
}
|
|
224
|
+
return this._invoices;
|
|
225
|
+
}
|
|
226
|
+
// ============================================
|
|
143
227
|
// LINK MANAGEMENT
|
|
144
228
|
// ============================================
|
|
145
229
|
/**
|
|
@@ -255,6 +339,13 @@ class AccountCreditRecord {
|
|
|
255
339
|
}
|
|
256
340
|
}
|
|
257
341
|
exports.AccountCreditRecord = AccountCreditRecord;
|
|
342
|
+
// ============================================
|
|
343
|
+
// TYPED LINK ACCESSORS
|
|
344
|
+
// ============================================
|
|
345
|
+
/** Valid labels for Contact associations */
|
|
346
|
+
AccountCreditRecord.contactsLabels = ['Contact__AccountCredit'];
|
|
347
|
+
/** Valid labels for Invoice associations */
|
|
348
|
+
AccountCreditRecord.invoicesLabels = ['AccountCredit__Invoice'];
|
|
258
349
|
/** Type guard to check if an object is a AccountCreditRecord */
|
|
259
350
|
function isAccountCreditRecord(obj) {
|
|
260
351
|
return obj instanceof AccountCreditRecord;
|
|
@@ -13,13 +13,16 @@
|
|
|
13
13
|
* await record.createAccount({ ... }).execute();
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
|
+
* Entity Types: BUSINESS, MULTIPLE, PRIMARY, RESELLER, SERVICE
|
|
17
|
+
*
|
|
16
18
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
17
19
|
*/
|
|
18
20
|
import { OdinRecord, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
|
|
19
21
|
import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
|
|
20
22
|
import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
|
|
21
23
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
22
|
-
import {
|
|
24
|
+
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
25
|
+
import { AccountProperties, BusinessAccountProperties, MultipleAccountProperties, PrimaryAccountProperties, ResellerAccountProperties, ServiceAccountProperties } from '../entities-v2/Account';
|
|
23
26
|
import { ChangeBillingModeProperties } from '../actions-v2/ChangeBillingModeDto';
|
|
24
27
|
import { CreateAccountFromBrskProperties } from '../actions-v2/CreateAccountFromBrskDto';
|
|
25
28
|
import { CreateBusinessAccountProperties } from '../actions-v2/CreateBusinessAccountDto';
|
|
@@ -28,6 +31,18 @@ import { CreateResellerAccountProperties } from '../actions-v2/CreateResellerAcc
|
|
|
28
31
|
import { UpdateBusinessAccountProperties } from '../actions-v2/UpdateBusinessAccountDto';
|
|
29
32
|
import { UpdatePrimaryAccountProperties } from '../actions-v2/UpdatePrimaryAccountDto';
|
|
30
33
|
import { UpdateResellerAccountProperties } from '../actions-v2/UpdateResellerAccountDto';
|
|
34
|
+
import { WorkOrderRecord } from './WorkOrderRecord';
|
|
35
|
+
import { NoteRecord } from './NoteRecord';
|
|
36
|
+
import { OneTouchSwitchRecord } from './OneTouchSwitchRecord';
|
|
37
|
+
import { OrderRecord } from './OrderRecord';
|
|
38
|
+
import { InvoiceRecord } from './InvoiceRecord';
|
|
39
|
+
import { AddressRecord } from './AddressRecord';
|
|
40
|
+
import { CaseRecord } from './CaseRecord';
|
|
41
|
+
import { PaymentRecord } from './PaymentRecord';
|
|
42
|
+
import { ContactRecord } from './ContactRecord';
|
|
43
|
+
import { FileRecord } from './FileRecord';
|
|
44
|
+
/** Valid entity types for Account */
|
|
45
|
+
export declare type AccountType = 'BUSINESS' | 'MULTIPLE' | 'PRIMARY' | 'RESELLER' | 'SERVICE';
|
|
31
46
|
/**
|
|
32
47
|
* Builder for action execution with dryRun support
|
|
33
48
|
*
|
|
@@ -91,6 +106,17 @@ export declare class AccountRecord<TProps = AccountProperties> {
|
|
|
91
106
|
private _provider;
|
|
92
107
|
private _pendingLinks;
|
|
93
108
|
private _preGeneratedId;
|
|
109
|
+
private _workOrders?;
|
|
110
|
+
private _notes?;
|
|
111
|
+
private _oneTouchSwitches?;
|
|
112
|
+
private _orders?;
|
|
113
|
+
private _invoices?;
|
|
114
|
+
private _accounts?;
|
|
115
|
+
private _addresses?;
|
|
116
|
+
private _cases?;
|
|
117
|
+
private _payments?;
|
|
118
|
+
private _contacts?;
|
|
119
|
+
private _files?;
|
|
94
120
|
/**
|
|
95
121
|
* Create a record wrapper.
|
|
96
122
|
* @param record - The underlying record, or null for create operations
|
|
@@ -103,7 +129,7 @@ export declare class AccountRecord<TProps = AccountProperties> {
|
|
|
103
129
|
/** Record ID - always available (pre-generated for new records) */
|
|
104
130
|
get id(): string;
|
|
105
131
|
get entity(): string;
|
|
106
|
-
get type():
|
|
132
|
+
get type(): AccountType | undefined;
|
|
107
133
|
/** Record properties - empty object for new (unsaved) records */
|
|
108
134
|
get properties(): TProps;
|
|
109
135
|
get title(): string | undefined;
|
|
@@ -116,6 +142,284 @@ export declare class AccountRecord<TProps = AccountProperties> {
|
|
|
116
142
|
get groups(): string[];
|
|
117
143
|
/** Access the underlying OdinRecord (null for new records) */
|
|
118
144
|
get record(): OdinRecord<TProps> | null;
|
|
145
|
+
/**
|
|
146
|
+
* Type guard: check if this record is of type BUSINESS
|
|
147
|
+
*
|
|
148
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
149
|
+
* giving you access to BUSINESS-specific properties.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
152
|
+
* ```typescript
|
|
153
|
+
* if (record.isBusiness()) {
|
|
154
|
+
* // TypeScript knows record.properties is BusinessAccountProperties
|
|
155
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
156
|
+
* }
|
|
157
|
+
* ```
|
|
158
|
+
* @remarks Business accounts
|
|
159
|
+
*/
|
|
160
|
+
isBusiness(): this is AccountRecord<BusinessAccountProperties>;
|
|
161
|
+
/**
|
|
162
|
+
* Type guard: check if this record is of type MULTIPLE
|
|
163
|
+
*
|
|
164
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
165
|
+
* giving you access to MULTIPLE-specific properties.
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* ```typescript
|
|
169
|
+
* if (record.isMultiple()) {
|
|
170
|
+
* // TypeScript knows record.properties is MultipleAccountProperties
|
|
171
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
172
|
+
* }
|
|
173
|
+
* ```
|
|
174
|
+
* @remarks Multiple accounts are for customers who want to purchase multiple services at many addresses
|
|
175
|
+
*/
|
|
176
|
+
isMultiple(): this is AccountRecord<MultipleAccountProperties>;
|
|
177
|
+
/**
|
|
178
|
+
* Type guard: check if this record is of type PRIMARY
|
|
179
|
+
*
|
|
180
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
181
|
+
* giving you access to PRIMARY-specific properties.
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* if (record.isPrimary()) {
|
|
186
|
+
* // TypeScript knows record.properties is PrimaryAccountProperties
|
|
187
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
188
|
+
* }
|
|
189
|
+
* ```
|
|
190
|
+
* @remarks Primary account
|
|
191
|
+
*/
|
|
192
|
+
isPrimary(): this is AccountRecord<PrimaryAccountProperties>;
|
|
193
|
+
/**
|
|
194
|
+
* Type guard: check if this record is of type RESELLER
|
|
195
|
+
*
|
|
196
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
197
|
+
* giving you access to RESELLER-specific properties.
|
|
198
|
+
*
|
|
199
|
+
* @example
|
|
200
|
+
* ```typescript
|
|
201
|
+
* if (record.isReseller()) {
|
|
202
|
+
* // TypeScript knows record.properties is ResellerAccountProperties
|
|
203
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
204
|
+
* }
|
|
205
|
+
* ```
|
|
206
|
+
* @remarks Reseller
|
|
207
|
+
*/
|
|
208
|
+
isReseller(): this is AccountRecord<ResellerAccountProperties>;
|
|
209
|
+
/**
|
|
210
|
+
* Type guard: check if this record is of type SERVICE
|
|
211
|
+
*
|
|
212
|
+
* When this returns true, TypeScript automatically narrows the type,
|
|
213
|
+
* giving you access to SERVICE-specific properties.
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* ```typescript
|
|
217
|
+
* if (record.isService()) {
|
|
218
|
+
* // TypeScript knows record.properties is ServiceAccountProperties
|
|
219
|
+
* console.log(record.properties.SomeTypeSpecificField);
|
|
220
|
+
* }
|
|
221
|
+
* ```
|
|
222
|
+
* @remarks This is the account where service is being delivered
|
|
223
|
+
*/
|
|
224
|
+
isService(): this is AccountRecord<ServiceAccountProperties>;
|
|
225
|
+
/** Valid labels for WorkOrder associations */
|
|
226
|
+
static readonly workOrdersLabels: readonly ["Account__WorkOrder"];
|
|
227
|
+
/**
|
|
228
|
+
* Access linked WorkOrder records
|
|
229
|
+
* @remarks Available labels: Account__WorkOrder
|
|
230
|
+
* @throws Error if called on a new (unsaved) record
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* // Get all linked WorkOrder records
|
|
235
|
+
* const items = await record.workOrders.list();
|
|
236
|
+
* const first = await record.workOrders.first();
|
|
237
|
+
*
|
|
238
|
+
* // Filter by label
|
|
239
|
+
* const specific = await record.workOrders.first({ label: 'Account__WorkOrder' });
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
get workOrders(): RecordLinkManager<WorkOrderRecord, typeof AccountRecord['workOrdersLabels'][number]>;
|
|
243
|
+
/** Valid labels for Note associations */
|
|
244
|
+
static readonly notesLabels: readonly ["Account__Note"];
|
|
245
|
+
/**
|
|
246
|
+
* Access linked Note records
|
|
247
|
+
* @remarks Available labels: Account__Note
|
|
248
|
+
* @throws Error if called on a new (unsaved) record
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```typescript
|
|
252
|
+
* // Get all linked Note records
|
|
253
|
+
* const items = await record.notes.list();
|
|
254
|
+
* const first = await record.notes.first();
|
|
255
|
+
*
|
|
256
|
+
* // Filter by label
|
|
257
|
+
* const specific = await record.notes.first({ label: 'Account__Note' });
|
|
258
|
+
* ```
|
|
259
|
+
*/
|
|
260
|
+
get notes(): RecordLinkManager<NoteRecord, typeof AccountRecord['notesLabels'][number]>;
|
|
261
|
+
/** Valid labels for OneTouchSwitch associations */
|
|
262
|
+
static readonly oneTouchSwitchesLabels: readonly ["Account__OneTouchSwitch"];
|
|
263
|
+
/**
|
|
264
|
+
* Access linked OneTouchSwitch records
|
|
265
|
+
* @remarks Available labels: Account__OneTouchSwitch
|
|
266
|
+
* @throws Error if called on a new (unsaved) record
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* ```typescript
|
|
270
|
+
* // Get all linked OneTouchSwitch records
|
|
271
|
+
* const items = await record.oneTouchSwitches.list();
|
|
272
|
+
* const first = await record.oneTouchSwitches.first();
|
|
273
|
+
*
|
|
274
|
+
* // Filter by label
|
|
275
|
+
* const specific = await record.oneTouchSwitches.first({ label: 'Account__OneTouchSwitch' });
|
|
276
|
+
* ```
|
|
277
|
+
*/
|
|
278
|
+
get oneTouchSwitches(): RecordLinkManager<OneTouchSwitchRecord, typeof AccountRecord['oneTouchSwitchesLabels'][number]>;
|
|
279
|
+
/** Valid labels for Order associations */
|
|
280
|
+
static readonly ordersLabels: readonly ["Account__Order"];
|
|
281
|
+
/**
|
|
282
|
+
* Access linked Order records
|
|
283
|
+
* @remarks Available labels: Account__Order
|
|
284
|
+
* @throws Error if called on a new (unsaved) record
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* // Get all linked Order records
|
|
289
|
+
* const items = await record.orders.list();
|
|
290
|
+
* const first = await record.orders.first();
|
|
291
|
+
*
|
|
292
|
+
* // Filter by label
|
|
293
|
+
* const specific = await record.orders.first({ label: 'Account__Order' });
|
|
294
|
+
* ```
|
|
295
|
+
*/
|
|
296
|
+
get orders(): RecordLinkManager<OrderRecord, typeof AccountRecord['ordersLabels'][number]>;
|
|
297
|
+
/** Valid labels for Invoice associations */
|
|
298
|
+
static readonly invoicesLabels: readonly ["Account__Invoice"];
|
|
299
|
+
/**
|
|
300
|
+
* Access linked Invoice records
|
|
301
|
+
* @remarks Available labels: Account__Invoice
|
|
302
|
+
* @throws Error if called on a new (unsaved) record
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```typescript
|
|
306
|
+
* // Get all linked Invoice records
|
|
307
|
+
* const items = await record.invoices.list();
|
|
308
|
+
* const first = await record.invoices.first();
|
|
309
|
+
*
|
|
310
|
+
* // Filter by label
|
|
311
|
+
* const specific = await record.invoices.first({ label: 'Account__Invoice' });
|
|
312
|
+
* ```
|
|
313
|
+
*/
|
|
314
|
+
get invoices(): RecordLinkManager<InvoiceRecord, typeof AccountRecord['invoicesLabels'][number]>;
|
|
315
|
+
/** Valid labels for Account associations */
|
|
316
|
+
static readonly accountsLabels: readonly ["Account_Account"];
|
|
317
|
+
/**
|
|
318
|
+
* Access linked Account records
|
|
319
|
+
* @remarks Available labels: Account_Account
|
|
320
|
+
* @throws Error if called on a new (unsaved) record
|
|
321
|
+
*
|
|
322
|
+
* @example
|
|
323
|
+
* ```typescript
|
|
324
|
+
* // Get all linked Account records
|
|
325
|
+
* const items = await record.accounts.list();
|
|
326
|
+
* const first = await record.accounts.first();
|
|
327
|
+
*
|
|
328
|
+
* // Filter by label
|
|
329
|
+
* const specific = await record.accounts.first({ label: 'Account_Account' });
|
|
330
|
+
* ```
|
|
331
|
+
*/
|
|
332
|
+
get accounts(): RecordLinkManager<AccountRecord, typeof AccountRecord['accountsLabels'][number]>;
|
|
333
|
+
/** Valid labels for Address associations */
|
|
334
|
+
static readonly addressesLabels: readonly ["BillingAddress"];
|
|
335
|
+
/**
|
|
336
|
+
* Access linked Address records
|
|
337
|
+
* @remarks Available labels: BillingAddress
|
|
338
|
+
* @throws Error if called on a new (unsaved) record
|
|
339
|
+
*
|
|
340
|
+
* @example
|
|
341
|
+
* ```typescript
|
|
342
|
+
* // Get all linked Address records
|
|
343
|
+
* const items = await record.addresses.list();
|
|
344
|
+
* const first = await record.addresses.first();
|
|
345
|
+
*
|
|
346
|
+
* // Filter by label
|
|
347
|
+
* const specific = await record.addresses.first({ label: 'BillingAddress' });
|
|
348
|
+
* ```
|
|
349
|
+
*/
|
|
350
|
+
get addresses(): RecordLinkManager<AddressRecord, typeof AccountRecord['addressesLabels'][number]>;
|
|
351
|
+
/** Valid labels for Case associations */
|
|
352
|
+
static readonly casesLabels: readonly ["Account__Case"];
|
|
353
|
+
/**
|
|
354
|
+
* Access linked Case records
|
|
355
|
+
* @remarks Available labels: Account__Case
|
|
356
|
+
* @throws Error if called on a new (unsaved) record
|
|
357
|
+
*
|
|
358
|
+
* @example
|
|
359
|
+
* ```typescript
|
|
360
|
+
* // Get all linked Case records
|
|
361
|
+
* const items = await record.cases.list();
|
|
362
|
+
* const first = await record.cases.first();
|
|
363
|
+
*
|
|
364
|
+
* // Filter by label
|
|
365
|
+
* const specific = await record.cases.first({ label: 'Account__Case' });
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
get cases(): RecordLinkManager<CaseRecord, typeof AccountRecord['casesLabels'][number]>;
|
|
369
|
+
/** Valid labels for Payment associations */
|
|
370
|
+
static readonly paymentsLabels: readonly ["Account_Payment"];
|
|
371
|
+
/**
|
|
372
|
+
* Access linked Payment records
|
|
373
|
+
* @remarks Available labels: Account_Payment
|
|
374
|
+
* @throws Error if called on a new (unsaved) record
|
|
375
|
+
*
|
|
376
|
+
* @example
|
|
377
|
+
* ```typescript
|
|
378
|
+
* // Get all linked Payment records
|
|
379
|
+
* const items = await record.payments.list();
|
|
380
|
+
* const first = await record.payments.first();
|
|
381
|
+
*
|
|
382
|
+
* // Filter by label
|
|
383
|
+
* const specific = await record.payments.first({ label: 'Account_Payment' });
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
get payments(): RecordLinkManager<PaymentRecord, typeof AccountRecord['paymentsLabels'][number]>;
|
|
387
|
+
/** Valid labels for Contact associations */
|
|
388
|
+
static readonly contactsLabels: readonly ["BillingContact"];
|
|
389
|
+
/**
|
|
390
|
+
* Access linked Contact records
|
|
391
|
+
* @remarks Available labels: BillingContact
|
|
392
|
+
* @throws Error if called on a new (unsaved) record
|
|
393
|
+
*
|
|
394
|
+
* @example
|
|
395
|
+
* ```typescript
|
|
396
|
+
* // Get all linked Contact records
|
|
397
|
+
* const items = await record.contacts.list();
|
|
398
|
+
* const first = await record.contacts.first();
|
|
399
|
+
*
|
|
400
|
+
* // Filter by label
|
|
401
|
+
* const specific = await record.contacts.first({ label: 'BillingContact' });
|
|
402
|
+
* ```
|
|
403
|
+
*/
|
|
404
|
+
get contacts(): RecordLinkManager<ContactRecord, typeof AccountRecord['contactsLabels'][number]>;
|
|
405
|
+
/** Valid labels for File associations */
|
|
406
|
+
static readonly filesLabels: readonly ["Account__File"];
|
|
407
|
+
/**
|
|
408
|
+
* Access linked File records
|
|
409
|
+
* @remarks Available labels: Account__File
|
|
410
|
+
* @throws Error if called on a new (unsaved) record
|
|
411
|
+
*
|
|
412
|
+
* @example
|
|
413
|
+
* ```typescript
|
|
414
|
+
* // Get all linked File records
|
|
415
|
+
* const items = await record.files.list();
|
|
416
|
+
* const first = await record.files.first();
|
|
417
|
+
*
|
|
418
|
+
* // Filter by label
|
|
419
|
+
* const specific = await record.files.first({ label: 'Account__File' });
|
|
420
|
+
* ```
|
|
421
|
+
*/
|
|
422
|
+
get files(): RecordLinkManager<FileRecord, typeof AccountRecord['filesLabels'][number]>;
|
|
119
423
|
/**
|
|
120
424
|
* Queue a link to be created with the next action.
|
|
121
425
|
* Works for both create and update actions.
|