@d19n/youfibre-odin-sdk 1.0.240 → 1.0.242

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.
Files changed (36) hide show
  1. package/dist/actions-v2/CreatePaymentMethodRefundDto.d.ts +8 -1
  2. package/dist/entities-v2/BillingAdjustment.d.ts +72 -72
  3. package/dist/entities-v2/BillingAdjustment.js +45 -45
  4. package/dist/records-v2/AddressRecord.d.ts +46 -12
  5. package/dist/records-v2/AddressRecord.js +60 -23
  6. package/dist/records-v2/CaseRecord.d.ts +281 -72
  7. package/dist/records-v2/CaseRecord.js +386 -161
  8. package/dist/records-v2/ChurnRequestRecord.d.ts +38 -10
  9. package/dist/records-v2/ChurnRequestRecord.js +51 -23
  10. package/dist/records-v2/ContactRecord.d.ts +38 -12
  11. package/dist/records-v2/ContactRecord.js +50 -23
  12. package/dist/records-v2/ContractBuyOutRecord.d.ts +75 -20
  13. package/dist/records-v2/ContractBuyOutRecord.js +102 -46
  14. package/dist/records-v2/OntReplacementApprovalRecord.d.ts +37 -12
  15. package/dist/records-v2/OntReplacementApprovalRecord.js +50 -23
  16. package/dist/records-v2/OrderRecord.d.ts +299 -86
  17. package/dist/records-v2/OrderRecord.js +405 -184
  18. package/dist/records-v2/PICRequestRecord.d.ts +38 -10
  19. package/dist/records-v2/PICRequestRecord.js +51 -23
  20. package/dist/records-v2/PaymentMethodRefundRecord.d.ts +38 -10
  21. package/dist/records-v2/PaymentMethodRefundRecord.js +51 -23
  22. package/dist/records-v2/WorkOrderRecord.d.ts +1745 -440
  23. package/dist/records-v2/WorkOrderRecord.js +2394 -969
  24. package/package.json +2 -2
  25. package/src/actions-v2/CreatePaymentMethodRefundDto.ts +8 -1
  26. package/src/entities-v2/BillingAdjustment.ts +71 -71
  27. package/src/records-v2/AddressRecord.ts +83 -35
  28. package/src/records-v2/CaseRecord.ts +536 -251
  29. package/src/records-v2/ChurnRequestRecord.ts +72 -36
  30. package/src/records-v2/ContactRecord.ts +71 -35
  31. package/src/records-v2/ContractBuyOutRecord.ts +144 -72
  32. package/src/records-v2/OntReplacementApprovalRecord.ts +70 -35
  33. package/src/records-v2/OrderRecord.ts +575 -285
  34. package/src/records-v2/PICRequestRecord.ts +72 -36
  35. package/src/records-v2/PaymentMethodRefundRecord.ts +72 -36
  36. package/src/records-v2/WorkOrderRecord.ts +6039 -4224
@@ -14,7 +14,7 @@ import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/di
14
14
  * Properties for CreatePaymentMethodRefund action
15
15
  *
16
16
  * @property Required fields: 2
17
- * @property Optional fields: 1
17
+ * @property Optional fields: 2
18
18
  */
19
19
  export interface CreatePaymentMethodRefundProperties {
20
20
  /**
@@ -40,6 +40,13 @@ export interface CreatePaymentMethodRefundProperties {
40
40
  * @type {TEXT}
41
41
  */
42
42
  AuthorizedBy?: string;
43
+ /**
44
+ * OrderRef
45
+ *
46
+ * Reference identifier for PaymentMethodRefund relationships. Used for data integrity.
47
+ * @type {LOOKUP}
48
+ */
49
+ OrderRef?: string;
43
50
  }
44
51
  /**
45
52
  * CreatePaymentMethodRefund
@@ -22,6 +22,32 @@ export declare enum BillingAdjustmentEntityTypes {
22
22
  /** Default record type */
23
23
  DEFAULT = "DEFAULT"
24
24
  }
25
+ /**
26
+ * Valid values for BillingAdjustment.DiscountType
27
+ *
28
+ * the type of discount (Sales - BillingAdjustment)
29
+ *
30
+ * @remarks Available options:
31
+ * - `AMOUNT` - Amount
32
+ * - `PERCENT` - Percent
33
+ */
34
+ export declare enum BillingAdjustmentDiscountType {
35
+ AMOUNT = "AMOUNT",
36
+ PERCENT = "PERCENT"
37
+ }
38
+ /**
39
+ * Valid values for BillingAdjustment.ProrationType
40
+ *
41
+ * proration type charge or credit (Sales - BillingAdjustment)
42
+ *
43
+ * @remarks Available options:
44
+ * - `CHARGE` - Charge
45
+ * - `CREDIT` - Credit
46
+ */
47
+ export declare enum BillingAdjustmentProrationType {
48
+ CHARGE = "CHARGE",
49
+ CREDIT = "CREDIT"
50
+ }
25
51
  /**
26
52
  * Valid values for BillingAdjustment.Reason
27
53
  *
@@ -57,65 +83,39 @@ export declare enum BillingAdjustmentReason {
57
83
  SALES_MISSELLING_ADJUSTMENT = "SALES_MISSELLING_ADJUSTMENT",
58
84
  OUTAGE_COMPENSATION = "OUTAGE_COMPENSATION"
59
85
  }
60
- /**
61
- * Valid values for BillingAdjustment.DiscountType
62
- *
63
- * the type of discount (Sales - BillingAdjustment)
64
- *
65
- * @remarks Available options:
66
- * - `AMOUNT` - Amount
67
- * - `PERCENT` - Percent
68
- */
69
- export declare enum BillingAdjustmentDiscountType {
70
- AMOUNT = "AMOUNT",
71
- PERCENT = "PERCENT"
72
- }
73
- /**
74
- * Valid values for BillingAdjustment.ProrationType
75
- *
76
- * proration type charge or credit (Sales - BillingAdjustment)
77
- *
78
- * @remarks Available options:
79
- * - `CHARGE` - Charge
80
- * - `CREDIT` - Credit
81
- */
82
- export declare enum BillingAdjustmentProrationType {
83
- CHARGE = "CHARGE",
84
- CREDIT = "CREDIT"
85
- }
86
86
  /**
87
87
  * Property keys for BillingAdjustment
88
88
  * Use these constants instead of string literals for type safety
89
89
  */
90
90
  export declare enum BillingAdjustmentPropertyKeys {
91
- /** Billing Adjustment Title (Sales - BillingAdjustment) */
92
- Title = "Title",
93
- /** The number of future invoices that should be free of charge (Sales - BillingAdjustment) */
94
- FreePeriodLength = "FreePeriodLength",
95
- /** the billing adjustment reason (Sales - BillingAdjustment) */
96
- Reason = "Reason",
97
- /** the value of the discount to be applied (Sales - BillingAdjustment) */
98
- DiscountValue = "DiscountValue",
91
+ /** Describe why this billing adjustment being applied (Sales - BillingAdjustment) */
92
+ Description = "Description",
99
93
  /** the length of the discount (Sales - BillingAdjustment) */
100
94
  DiscountLength = "DiscountLength",
101
95
  /** the type of discount (Sales - BillingAdjustment) */
102
96
  DiscountType = "DiscountType",
97
+ /** the value of the discount to be applied (Sales - BillingAdjustment) */
98
+ DiscountValue = "DiscountValue",
99
+ /** The number of future invoices that should be free of charge (Sales - BillingAdjustment) */
100
+ FreePeriodLength = "FreePeriodLength",
103
101
  /** end of first full cycle (Invoice.BillingPeriodEnd!) (Sales - BillingAdjustment) */
104
102
  InCycleBillingPeriodEnd = "InCycleBillingPeriodEnd",
105
- /** day after prev invoice ended (Sales - BillingAdjustment) */
106
- ProrationBillingPeriodStart = "ProrationBillingPeriodStart",
107
- /** day before new billing day (Sales - BillingAdjustment) */
108
- ProrationBillingPeriodEnd = "ProrationBillingPeriodEnd",
109
103
  /** the new billing billing period start (Sales - BillingAdjustment) */
110
104
  InCycleBillingPeriodStart = "InCycleBillingPeriodStart",
111
- /** proration type charge or credit (Sales - BillingAdjustment) */
112
- ProrationType = "ProrationType",
113
105
  /** The number of days being prorated (Sales - BillingAdjustment) */
114
106
  ProrationBillableDays = "ProrationBillableDays",
115
- /** Describe why this billing adjustment being applied (Sales - BillingAdjustment) */
116
- Description = "Description",
107
+ /** day before new billing day (Sales - BillingAdjustment) */
108
+ ProrationBillingPeriodEnd = "ProrationBillingPeriodEnd",
109
+ /** day after prev invoice ended (Sales - BillingAdjustment) */
110
+ ProrationBillingPeriodStart = "ProrationBillingPeriodStart",
111
+ /** proration type charge or credit (Sales - BillingAdjustment) */
112
+ ProrationType = "ProrationType",
113
+ /** the billing adjustment reason (Sales - BillingAdjustment) */
114
+ Reason = "Reason",
117
115
  /** Source of payment date update (Sales - BillingAdjustment) */
118
- Source = "Source"
116
+ Source = "Source",
117
+ /** Billing Adjustment Title (Sales - BillingAdjustment) */
118
+ Title = "Title"
119
119
  }
120
120
  /**
121
121
  * Properties for BillingAdjustment records
@@ -123,80 +123,80 @@ export declare enum BillingAdjustmentPropertyKeys {
123
123
  * @see OrderModule:BillingAdjustment
124
124
  */
125
125
  export interface BillingAdjustmentProperties {
126
- /** Billing Adjustment Title (Sales - BillingAdjustment)
126
+ /** Describe why this billing adjustment being applied (Sales - BillingAdjustment)
127
127
  *
128
- * @type {TEXT}
128
+ * @type {TEXT_LONG}
129
129
  */
130
- Title?: string;
131
- /** The number of future invoices that should be free of charge (Sales - BillingAdjustment)
130
+ Description?: string;
131
+ /** the length of the discount (Sales - BillingAdjustment)
132
132
  *
133
133
  * @type {NUMBER}
134
- * @hidden This field is hidden in the UI
135
134
  */
136
- FreePeriodLength?: number;
137
- /** the billing adjustment reason (Sales - BillingAdjustment)
135
+ DiscountLength?: number;
136
+ /** the type of discount (Sales - BillingAdjustment)
138
137
  *
139
138
  * @type {ENUM}
140
- * @enum {BillingAdjustmentReason}
139
+ * @enum {BillingAdjustmentDiscountType}
141
140
  */
142
- Reason?: BillingAdjustmentReason;
141
+ DiscountType?: BillingAdjustmentDiscountType;
143
142
  /** the value of the discount to be applied (Sales - BillingAdjustment)
144
143
  *
145
144
  * @type {NUMERIC}
146
145
  */
147
146
  DiscountValue?: number;
148
- /** the length of the discount (Sales - BillingAdjustment)
147
+ /** The number of future invoices that should be free of charge (Sales - BillingAdjustment)
149
148
  *
150
149
  * @type {NUMBER}
150
+ * @hidden This field is hidden in the UI
151
151
  */
152
- DiscountLength?: number;
153
- /** the type of discount (Sales - BillingAdjustment)
154
- *
155
- * @type {ENUM}
156
- * @enum {BillingAdjustmentDiscountType}
157
- */
158
- DiscountType?: BillingAdjustmentDiscountType;
152
+ FreePeriodLength?: number;
159
153
  /** end of first full cycle (Invoice.BillingPeriodEnd!) (Sales - BillingAdjustment)
160
154
  *
161
155
  * @type {DATE}
162
156
  */
163
157
  InCycleBillingPeriodEnd?: string;
164
- /** day after prev invoice ended (Sales - BillingAdjustment)
158
+ /** the new billing billing period start (Sales - BillingAdjustment)
165
159
  *
166
160
  * @type {DATE}
167
161
  */
168
- ProrationBillingPeriodStart?: string;
162
+ InCycleBillingPeriodStart?: string;
163
+ /** The number of days being prorated (Sales - BillingAdjustment)
164
+ *
165
+ * @type {NUMBER}
166
+ */
167
+ ProrationBillableDays?: number;
169
168
  /** day before new billing day (Sales - BillingAdjustment)
170
169
  *
171
170
  * @type {DATE}
172
171
  */
173
172
  ProrationBillingPeriodEnd?: string;
174
- /** the new billing billing period start (Sales - BillingAdjustment)
173
+ /** day after prev invoice ended (Sales - BillingAdjustment)
175
174
  *
176
175
  * @type {DATE}
177
176
  */
178
- InCycleBillingPeriodStart?: string;
177
+ ProrationBillingPeriodStart?: string;
179
178
  /** proration type charge or credit (Sales - BillingAdjustment)
180
179
  *
181
180
  * @type {ENUM}
182
181
  * @enum {BillingAdjustmentProrationType}
183
182
  */
184
183
  ProrationType?: BillingAdjustmentProrationType;
185
- /** The number of days being prorated (Sales - BillingAdjustment)
186
- *
187
- * @type {NUMBER}
188
- */
189
- ProrationBillableDays?: number;
190
- /** Describe why this billing adjustment being applied (Sales - BillingAdjustment)
184
+ /** the billing adjustment reason (Sales - BillingAdjustment)
191
185
  *
192
- * @type {TEXT_LONG}
186
+ * @type {ENUM}
187
+ * @enum {BillingAdjustmentReason}
193
188
  */
194
- Description?: string;
189
+ Reason?: BillingAdjustmentReason;
195
190
  /** Source of payment date update (Sales - BillingAdjustment)
196
191
  *
197
192
  * @type {TEXT}
198
193
  */
199
194
  Source?: string;
195
+ /** Billing Adjustment Title (Sales - BillingAdjustment)
196
+ *
197
+ * @type {TEXT}
198
+ */
199
+ Title?: string;
200
200
  }
201
201
  /**
202
202
  * BillingAdjustment entity from OrderModule
@@ -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_BILLING_ADJUSTMENT_FILE_DELETED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_FILE_CREATED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_NOTE_DELETED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_NOTE_CREATED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_DELETED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_UPDATED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_CREATED = exports.BillingAdjustment = exports.BillingAdjustmentPropertyKeys = exports.BillingAdjustmentProrationType = exports.BillingAdjustmentDiscountType = exports.BillingAdjustmentReason = exports.BillingAdjustmentEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_FILE_DELETED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_FILE_CREATED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_NOTE_DELETED = exports.ROUTING_KEY_LINK_BILLING_ADJUSTMENT_NOTE_CREATED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_DELETED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_UPDATED = exports.ROUTING_KEY_BILLING_ADJUSTMENT_CREATED = exports.BillingAdjustment = exports.BillingAdjustmentPropertyKeys = exports.BillingAdjustmentReason = exports.BillingAdjustmentProrationType = exports.BillingAdjustmentDiscountType = exports.BillingAdjustmentEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for BillingAdjustment records
@@ -22,6 +22,34 @@ var BillingAdjustmentEntityTypes;
22
22
  /** Default record type */
23
23
  BillingAdjustmentEntityTypes["DEFAULT"] = "DEFAULT";
24
24
  })(BillingAdjustmentEntityTypes = exports.BillingAdjustmentEntityTypes || (exports.BillingAdjustmentEntityTypes = {}));
25
+ /**
26
+ * Valid values for BillingAdjustment.DiscountType
27
+ *
28
+ * the type of discount (Sales - BillingAdjustment)
29
+ *
30
+ * @remarks Available options:
31
+ * - `AMOUNT` - Amount
32
+ * - `PERCENT` - Percent
33
+ */
34
+ var BillingAdjustmentDiscountType;
35
+ (function (BillingAdjustmentDiscountType) {
36
+ BillingAdjustmentDiscountType["AMOUNT"] = "AMOUNT";
37
+ BillingAdjustmentDiscountType["PERCENT"] = "PERCENT";
38
+ })(BillingAdjustmentDiscountType = exports.BillingAdjustmentDiscountType || (exports.BillingAdjustmentDiscountType = {}));
39
+ /**
40
+ * Valid values for BillingAdjustment.ProrationType
41
+ *
42
+ * proration type charge or credit (Sales - BillingAdjustment)
43
+ *
44
+ * @remarks Available options:
45
+ * - `CHARGE` - Charge
46
+ * - `CREDIT` - Credit
47
+ */
48
+ var BillingAdjustmentProrationType;
49
+ (function (BillingAdjustmentProrationType) {
50
+ BillingAdjustmentProrationType["CHARGE"] = "CHARGE";
51
+ BillingAdjustmentProrationType["CREDIT"] = "CREDIT";
52
+ })(BillingAdjustmentProrationType = exports.BillingAdjustmentProrationType || (exports.BillingAdjustmentProrationType = {}));
25
53
  /**
26
54
  * Valid values for BillingAdjustment.Reason
27
55
  *
@@ -58,68 +86,40 @@ var BillingAdjustmentReason;
58
86
  BillingAdjustmentReason["SALES_MISSELLING_ADJUSTMENT"] = "SALES_MISSELLING_ADJUSTMENT";
59
87
  BillingAdjustmentReason["OUTAGE_COMPENSATION"] = "OUTAGE_COMPENSATION";
60
88
  })(BillingAdjustmentReason = exports.BillingAdjustmentReason || (exports.BillingAdjustmentReason = {}));
61
- /**
62
- * Valid values for BillingAdjustment.DiscountType
63
- *
64
- * the type of discount (Sales - BillingAdjustment)
65
- *
66
- * @remarks Available options:
67
- * - `AMOUNT` - Amount
68
- * - `PERCENT` - Percent
69
- */
70
- var BillingAdjustmentDiscountType;
71
- (function (BillingAdjustmentDiscountType) {
72
- BillingAdjustmentDiscountType["AMOUNT"] = "AMOUNT";
73
- BillingAdjustmentDiscountType["PERCENT"] = "PERCENT";
74
- })(BillingAdjustmentDiscountType = exports.BillingAdjustmentDiscountType || (exports.BillingAdjustmentDiscountType = {}));
75
- /**
76
- * Valid values for BillingAdjustment.ProrationType
77
- *
78
- * proration type charge or credit (Sales - BillingAdjustment)
79
- *
80
- * @remarks Available options:
81
- * - `CHARGE` - Charge
82
- * - `CREDIT` - Credit
83
- */
84
- var BillingAdjustmentProrationType;
85
- (function (BillingAdjustmentProrationType) {
86
- BillingAdjustmentProrationType["CHARGE"] = "CHARGE";
87
- BillingAdjustmentProrationType["CREDIT"] = "CREDIT";
88
- })(BillingAdjustmentProrationType = exports.BillingAdjustmentProrationType || (exports.BillingAdjustmentProrationType = {}));
89
89
  /**
90
90
  * Property keys for BillingAdjustment
91
91
  * Use these constants instead of string literals for type safety
92
92
  */
93
93
  var BillingAdjustmentPropertyKeys;
94
94
  (function (BillingAdjustmentPropertyKeys) {
95
- /** Billing Adjustment Title (Sales - BillingAdjustment) */
96
- BillingAdjustmentPropertyKeys["Title"] = "Title";
97
- /** The number of future invoices that should be free of charge (Sales - BillingAdjustment) */
98
- BillingAdjustmentPropertyKeys["FreePeriodLength"] = "FreePeriodLength";
99
- /** the billing adjustment reason (Sales - BillingAdjustment) */
100
- BillingAdjustmentPropertyKeys["Reason"] = "Reason";
101
- /** the value of the discount to be applied (Sales - BillingAdjustment) */
102
- BillingAdjustmentPropertyKeys["DiscountValue"] = "DiscountValue";
95
+ /** Describe why this billing adjustment being applied (Sales - BillingAdjustment) */
96
+ BillingAdjustmentPropertyKeys["Description"] = "Description";
103
97
  /** the length of the discount (Sales - BillingAdjustment) */
104
98
  BillingAdjustmentPropertyKeys["DiscountLength"] = "DiscountLength";
105
99
  /** the type of discount (Sales - BillingAdjustment) */
106
100
  BillingAdjustmentPropertyKeys["DiscountType"] = "DiscountType";
101
+ /** the value of the discount to be applied (Sales - BillingAdjustment) */
102
+ BillingAdjustmentPropertyKeys["DiscountValue"] = "DiscountValue";
103
+ /** The number of future invoices that should be free of charge (Sales - BillingAdjustment) */
104
+ BillingAdjustmentPropertyKeys["FreePeriodLength"] = "FreePeriodLength";
107
105
  /** end of first full cycle (Invoice.BillingPeriodEnd!) (Sales - BillingAdjustment) */
108
106
  BillingAdjustmentPropertyKeys["InCycleBillingPeriodEnd"] = "InCycleBillingPeriodEnd";
109
- /** day after prev invoice ended (Sales - BillingAdjustment) */
110
- BillingAdjustmentPropertyKeys["ProrationBillingPeriodStart"] = "ProrationBillingPeriodStart";
111
- /** day before new billing day (Sales - BillingAdjustment) */
112
- BillingAdjustmentPropertyKeys["ProrationBillingPeriodEnd"] = "ProrationBillingPeriodEnd";
113
107
  /** the new billing billing period start (Sales - BillingAdjustment) */
114
108
  BillingAdjustmentPropertyKeys["InCycleBillingPeriodStart"] = "InCycleBillingPeriodStart";
115
- /** proration type charge or credit (Sales - BillingAdjustment) */
116
- BillingAdjustmentPropertyKeys["ProrationType"] = "ProrationType";
117
109
  /** The number of days being prorated (Sales - BillingAdjustment) */
118
110
  BillingAdjustmentPropertyKeys["ProrationBillableDays"] = "ProrationBillableDays";
119
- /** Describe why this billing adjustment being applied (Sales - BillingAdjustment) */
120
- BillingAdjustmentPropertyKeys["Description"] = "Description";
111
+ /** day before new billing day (Sales - BillingAdjustment) */
112
+ BillingAdjustmentPropertyKeys["ProrationBillingPeriodEnd"] = "ProrationBillingPeriodEnd";
113
+ /** day after prev invoice ended (Sales - BillingAdjustment) */
114
+ BillingAdjustmentPropertyKeys["ProrationBillingPeriodStart"] = "ProrationBillingPeriodStart";
115
+ /** proration type charge or credit (Sales - BillingAdjustment) */
116
+ BillingAdjustmentPropertyKeys["ProrationType"] = "ProrationType";
117
+ /** the billing adjustment reason (Sales - BillingAdjustment) */
118
+ BillingAdjustmentPropertyKeys["Reason"] = "Reason";
121
119
  /** Source of payment date update (Sales - BillingAdjustment) */
122
120
  BillingAdjustmentPropertyKeys["Source"] = "Source";
121
+ /** Billing Adjustment Title (Sales - BillingAdjustment) */
122
+ BillingAdjustmentPropertyKeys["Title"] = "Title";
123
123
  })(BillingAdjustmentPropertyKeys = exports.BillingAdjustmentPropertyKeys || (exports.BillingAdjustmentPropertyKeys = {}));
124
124
  /**
125
125
  * BillingAdjustment entity from OrderModule
@@ -20,7 +20,8 @@ import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-man
20
20
  import { AddressProperties } from '../entities-v2/Address';
21
21
  import { AddressCreateProperties } from '../actions-v2/AddressCreateDto';
22
22
  import { AddressUpdateProperties } from '../actions-v2/AddressUpdateDto';
23
- import { CreateLeadFromAddressProperties } from '../actions-v2/CreateLeadFromAddressDto';
23
+ import { CreateLeadProperties } from '../actions-v2/CreateLeadFromAddressDto';
24
+ import { CreateContactProperties } from '../actions-v2/CreateLeadFromAddressDto';
24
25
  import { OrderRecord } from './OrderRecord';
25
26
  import { ContactRecord } from './ContactRecord';
26
27
  import { CustomerDeviceOntRecord } from './CustomerDeviceOntRecord';
@@ -35,6 +36,38 @@ import { CrmDatasetRecord } from './CrmDatasetRecord';
35
36
  import { CaseRecord } from './CaseRecord';
36
37
  import { LeadRecord } from './LeadRecord';
37
38
  import { AccountRecord } from './AccountRecord';
39
+ /**
40
+ * FlowBuilder for CreateLeadFromAddress multi-step action
41
+ *
42
+ * Use method chaining to add steps, then call execute() to run the flow.
43
+ */
44
+ declare class CreateLeadFromAddressFlowBuilder {
45
+ private _record;
46
+ private _provider;
47
+ private _pendingLinks;
48
+ private _options?;
49
+ private _steps;
50
+ constructor(record: AddressRecord, provider: IOdinProvider, pendingLinks: OdinRecordLinkDto[], options?: {
51
+ journeyId?: string;
52
+ });
53
+ /**
54
+ * Add CreateLead step to the flow
55
+ * @param properties - Properties for this step
56
+ * @returns this (for method chaining)
57
+ */
58
+ createLead(properties: CreateLeadProperties): this;
59
+ /**
60
+ * Add CreateContact step to the flow
61
+ * @param properties - Properties for this step
62
+ * @returns this (for method chaining)
63
+ */
64
+ createContact(properties: CreateContactProperties): this;
65
+ /**
66
+ * Execute the flow with all collected steps
67
+ * @returns The action result
68
+ */
69
+ execute(): Promise<IDbRecordCreateUpdateRes[]>;
70
+ }
38
71
  export declare class AddressRecord {
39
72
  private _record;
40
73
  private _provider;
@@ -330,26 +363,27 @@ export declare class AddressRecord {
330
363
  /**
331
364
  * CreateLeadFromAddress
332
365
  *
333
- * Updates this Address record.
366
+ * Starts a multi-step flow action on this Address record.
367
+ * Chain step methods and call .execute() to run the flow.
334
368
  *
335
- * @param propertiesOrOptions - Properties to update, or options object
336
- * @param options - Optional settings (journeyId, stageKey)
337
- * @returns The updated record(s)
369
+ * @param options - Optional settings
370
+ * @param options.journeyId - Associate with a journey
371
+ * @returns FlowBuilder for chaining step methods
338
372
  * @throws Error if called on a new (unsaved) record
339
373
  *
340
374
  * @example
341
375
  * ```typescript
342
376
  * const record = await odinClient.addresss.get(id);
343
- * await record.createLeadFromAddress({ ... });
377
+ * await record.createLeadFromAddress()
378
+ * .createLead({ ... })
379
+ * .createContact({ ... })
380
+ * .execute();
344
381
  * ```
345
382
  */
346
- createLeadFromAddress(propertiesOrOptions?: CreateLeadFromAddressProperties | {
347
- journeyId?: string;
348
- stageKey?: string;
349
- }, options?: {
383
+ createLeadFromAddress(options?: {
350
384
  journeyId?: string;
351
- stageKey?: string;
352
- }): Promise<IDbRecordCreateUpdateRes[]>;
385
+ }): CreateLeadFromAddressFlowBuilder;
353
386
  }
354
387
  /** Type guard to check if an object is a AddressRecord */
355
388
  export declare function isAddressRecord(obj: any): obj is AddressRecord;
389
+ export {};
@@ -40,6 +40,53 @@ const CrmDatasetRecord_1 = require("./CrmDatasetRecord");
40
40
  const CaseRecord_1 = require("./CaseRecord");
41
41
  const LeadRecord_1 = require("./LeadRecord");
42
42
  const AccountRecord_1 = require("./AccountRecord");
43
+ /**
44
+ * FlowBuilder for CreateLeadFromAddress multi-step action
45
+ *
46
+ * Use method chaining to add steps, then call execute() to run the flow.
47
+ */
48
+ class CreateLeadFromAddressFlowBuilder {
49
+ constructor(record, provider, pendingLinks, options) {
50
+ this._steps = [];
51
+ this._record = record;
52
+ this._provider = provider;
53
+ this._pendingLinks = pendingLinks;
54
+ this._options = options;
55
+ }
56
+ /**
57
+ * Add CreateLead step to the flow
58
+ * @param properties - Properties for this step
59
+ * @returns this (for method chaining)
60
+ */
61
+ createLead(properties) {
62
+ this._steps.push({ actionKey: 'CreateLead', properties });
63
+ return this;
64
+ }
65
+ /**
66
+ * Add CreateContact step to the flow
67
+ * @param properties - Properties for this step
68
+ * @returns this (for method chaining)
69
+ */
70
+ createContact(properties) {
71
+ this._steps.push({ actionKey: 'CreateContact', properties });
72
+ return this;
73
+ }
74
+ /**
75
+ * Execute the flow with all collected steps
76
+ * @returns The action result
77
+ */
78
+ execute() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const rawRecord = this._record.raw;
81
+ if (!(rawRecord === null || rawRecord === void 0 ? void 0 : rawRecord.id))
82
+ throw new Error('Cannot execute flow on unsaved record');
83
+ const result = yield this._provider._applyAction('CrmModule', 'Address', Object.assign({ id: rawRecord.id, entity: rawRecord.entity, type: rawRecord.type, actionName: 'CreateLeadFromAddress', steps: this._steps, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, this._options));
84
+ // Clear pending links on the record after execution
85
+ this._record.clearPendingLinks();
86
+ return result;
87
+ });
88
+ }
89
+ }
43
90
  class AddressRecord {
44
91
  /**
45
92
  * Create a record wrapper.
@@ -581,38 +628,28 @@ class AddressRecord {
581
628
  /**
582
629
  * CreateLeadFromAddress
583
630
  *
584
- * Updates this Address record.
631
+ * Starts a multi-step flow action on this Address record.
632
+ * Chain step methods and call .execute() to run the flow.
585
633
  *
586
- * @param propertiesOrOptions - Properties to update, or options object
587
- * @param options - Optional settings (journeyId, stageKey)
588
- * @returns The updated record(s)
634
+ * @param options - Optional settings
635
+ * @param options.journeyId - Associate with a journey
636
+ * @returns FlowBuilder for chaining step methods
589
637
  * @throws Error if called on a new (unsaved) record
590
638
  *
591
639
  * @example
592
640
  * ```typescript
593
641
  * const record = await odinClient.addresss.get(id);
594
- * await record.createLeadFromAddress({ ... });
642
+ * await record.createLeadFromAddress()
643
+ * .createLead({ ... })
644
+ * .createContact({ ... })
645
+ * .execute();
595
646
  * ```
596
647
  */
597
- createLeadFromAddress(propertiesOrOptions, options) {
648
+ createLeadFromAddress(options) {
598
649
  var _a;
599
- return __awaiter(this, void 0, void 0, function* () {
600
- if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
601
- throw new Error('createLeadFromAddress requires an existing record. Use accessor.get() first.');
602
- let properties = {};
603
- let opts = options;
604
- if (propertiesOrOptions) {
605
- if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
606
- opts = propertiesOrOptions;
607
- }
608
- else {
609
- properties = propertiesOrOptions;
610
- }
611
- }
612
- const result = yield this._provider._applyAction('CrmModule', 'Address', Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'CreateLeadFromAddress', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts));
613
- this._pendingLinks = [];
614
- return result;
615
- });
650
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
651
+ throw new Error('createLeadFromAddress requires an existing record. Use accessor.get() first.');
652
+ return new CreateLeadFromAddressFlowBuilder(this, this._provider, this._pendingLinks, options);
616
653
  }
617
654
  }
618
655
  exports.AddressRecord = AddressRecord;