@d19n/youfibre-odin-sdk 1.0.291 → 1.0.293

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 (27) hide show
  1. package/dist/actions-v2/CreateAffiliateCodeDto.d.ts +61 -12
  2. package/dist/actions-v2/CreateAffiliateCodeDto.js +70 -7
  3. package/dist/actions-v2/CreateCashbackRewardDto.d.ts +85 -18
  4. package/dist/actions-v2/CreateCashbackRewardDto.js +96 -7
  5. package/dist/actions-v2/CreateCollectionAmcoReplacementWorkOrderDto.d.ts +48 -9
  6. package/dist/actions-v2/CreateCollectionAmcoReplacementWorkOrderDto.js +56 -7
  7. package/dist/actions-v2/CreateCollectionAmcoReplacementWorkOrderFromWorkOrderDto.d.ts +47 -8
  8. package/dist/actions-v2/CreateCollectionAmcoReplacementWorkOrderFromWorkOrderDto.js +56 -7
  9. package/dist/actions-v2/CreateFieldServiceDispatchedProductDto.d.ts +48 -9
  10. package/dist/actions-v2/CreateFieldServiceDispatchedProductDto.js +56 -7
  11. package/dist/actions-v2/CreateOrderReferralDto.d.ts +97 -21
  12. package/dist/actions-v2/CreateOrderReferralDto.js +109 -7
  13. package/dist/actions-v2/CreatePaymentDto.d.ts +48 -9
  14. package/dist/actions-v2/CreatePaymentDto.js +56 -7
  15. package/dist/records-v2/AffiliateCodeRecord.d.ts +2 -4
  16. package/dist/records-v2/AffiliateCodeRecord.js +3 -9
  17. package/dist/records-v2/FieldServiceDispatchedProductRecord.d.ts +2 -4
  18. package/dist/records-v2/FieldServiceDispatchedProductRecord.js +3 -9
  19. package/dist/records-v2/PaymentRecord.d.ts +2 -4
  20. package/dist/records-v2/PaymentRecord.js +3 -9
  21. package/dist/records-v2/ReferralRecord.d.ts +2 -4
  22. package/dist/records-v2/ReferralRecord.js +3 -9
  23. package/dist/records-v2/RewardRecord.d.ts +2 -4
  24. package/dist/records-v2/RewardRecord.js +3 -9
  25. package/dist/records-v2/WorkOrderRecord.d.ts +2 -4
  26. package/dist/records-v2/WorkOrderRecord.js +3 -9
  27. package/package.json +2 -2
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
12
12
  */
13
- import { OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
13
+ import { OdinRecord, OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
14
14
  /**
15
15
  * RabbitMQ message payload for CreateAffiliateCode created events
16
16
  *
@@ -34,24 +34,61 @@ export interface CreateAffiliateCodeProperties {
34
34
  Code?: string | null;
35
35
  }
36
36
  /**
37
- * Associations for CreateAffiliateCode action
37
+ * Builder for CreateAffiliateCode action
38
38
  *
39
- * @property Required associations: 0
40
- * @property Optional associations: 2
39
+ * Provides fluent API for adding associations before executing the action.
40
+ * Use .link*() methods to add associations, then call .execute() to run.
41
+ *
42
+ * @example
43
+ * ```typescript
44
+ * await record.createAffiliateCode({ ...properties })
45
+ * .linkCampaignAffiliateCodes({ id: '...', entity: '...' })
46
+ * .linkContactAffiliateCodes({ id: '...', entity: '...' })
47
+ * .execute();
48
+ * ```
41
49
  */
42
- export interface CreateAffiliateCodeAssociations {
50
+ export declare class CreateAffiliateCodeBuilder {
51
+ private _associations;
52
+ private _properties;
53
+ private _pendingLinks;
54
+ private _options?;
55
+ constructor(properties: CreateAffiliateCodeProperties, pendingLinks: OdinRecordLinkDto[], options?: {
56
+ journeyId?: string;
57
+ stageKey?: string;
58
+ });
43
59
  /**
44
- * CampaignAffiliateCodes
45
- * @type {association}
60
+ * Link CampaignAffiliateCodes
46
61
  * @schemaAssociationId 861d3320-5071-4f9e-90c1-fe42fb4a85f0
62
+ * @param target - The record to link
63
+ * @returns this (for method chaining)
47
64
  */
48
- CampaignAffiliateCodes?: OdinRecordLinkDto;
65
+ linkCampaignAffiliateCodes(target: OdinRecord<any> | {
66
+ id: string;
67
+ entity: string;
68
+ }): this;
49
69
  /**
50
- * ContactAffiliateCodes
51
- * @type {association}
70
+ * Link ContactAffiliateCodes
52
71
  * @schemaAssociationId 097e54b9-7194-447e-89f3-d610122cd03b
72
+ * @param target - The record to link
73
+ * @returns this (for method chaining)
53
74
  */
54
- ContactAffiliateCodes?: OdinRecordLinkDto;
75
+ linkContactAffiliateCodes(target: OdinRecord<any> | {
76
+ id: string;
77
+ entity: string;
78
+ }): this;
79
+ /**
80
+ * Get the action payload without executing
81
+ * @returns The action data that would be sent
82
+ */
83
+ getData(): {
84
+ entity: string;
85
+ type: string | undefined;
86
+ actionName: string;
87
+ properties: CreateAffiliateCodeProperties;
88
+ associations?: OdinRecordLinkDto[];
89
+ journeyId?: string;
90
+ stageKey?: string;
91
+ };
55
92
  }
56
93
  /**
57
94
  * Create Code
@@ -75,10 +112,22 @@ export declare class CreateAffiliateCodeDto extends OdinRecordCreateDto<CreateAf
75
112
  static readonly PERMISSION = "schema.action.createaffiliatecode.trigger";
76
113
  static readonly HAS_ASSOCIATIONS = true;
77
114
  static readonly HAS_REQUIRED_ASSOCIATIONS = false;
115
+ static readonly BUILDER_CLASS = "CreateAffiliateCodeBuilder";
116
+ static readonly ASSOCIATION_FIELDS: readonly [{
117
+ readonly name: "CampaignAffiliateCodes";
118
+ readonly methodName: "linkCampaignAffiliateCodes";
119
+ readonly required: false;
120
+ readonly schemaAssociationId: "861d3320-5071-4f9e-90c1-fe42fb4a85f0";
121
+ }, {
122
+ readonly name: "ContactAffiliateCodes";
123
+ readonly methodName: "linkContactAffiliateCodes";
124
+ readonly required: false;
125
+ readonly schemaAssociationId: "097e54b9-7194-447e-89f3-d610122cd03b";
126
+ }];
78
127
  readonly actionName: string;
79
128
  readonly schemaActionId: string;
80
129
  readonly entity: string;
81
- constructor(properties: CreateAffiliateCodeProperties, associations?: CreateAffiliateCodeAssociations, options?: {
130
+ constructor(properties: CreateAffiliateCodeProperties, options?: {
82
131
  journeyId?: string;
83
132
  });
84
133
  }
@@ -12,8 +12,74 @@
12
12
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
13
  */
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CreateAffiliateCodeDto = void 0;
15
+ exports.CreateAffiliateCodeDto = exports.CreateAffiliateCodeBuilder = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
+ /**
18
+ * Builder for CreateAffiliateCode action
19
+ *
20
+ * Provides fluent API for adding associations before executing the action.
21
+ * Use .link*() methods to add associations, then call .execute() to run.
22
+ *
23
+ * @example
24
+ * ```typescript
25
+ * await record.createAffiliateCode({ ...properties })
26
+ * .linkCampaignAffiliateCodes({ id: '...', entity: '...' })
27
+ * .linkContactAffiliateCodes({ id: '...', entity: '...' })
28
+ * .execute();
29
+ * ```
30
+ */
31
+ class CreateAffiliateCodeBuilder {
32
+ constructor(properties, pendingLinks, options) {
33
+ this._associations = [];
34
+ this._properties = properties;
35
+ this._pendingLinks = pendingLinks;
36
+ this._options = options;
37
+ }
38
+ /**
39
+ * Link CampaignAffiliateCodes
40
+ * @schemaAssociationId 861d3320-5071-4f9e-90c1-fe42fb4a85f0
41
+ * @param target - The record to link
42
+ * @returns this (for method chaining)
43
+ */
44
+ linkCampaignAffiliateCodes(target) {
45
+ this._associations.push(new core_1.OdinRecordLinkDto({
46
+ id: target.id,
47
+ entity: 'entity' in target ? target.entity : target.entity,
48
+ }));
49
+ return this;
50
+ }
51
+ /**
52
+ * Link ContactAffiliateCodes
53
+ * @schemaAssociationId 097e54b9-7194-447e-89f3-d610122cd03b
54
+ * @param target - The record to link
55
+ * @returns this (for method chaining)
56
+ */
57
+ linkContactAffiliateCodes(target) {
58
+ this._associations.push(new core_1.OdinRecordLinkDto({
59
+ id: target.id,
60
+ entity: 'entity' in target ? target.entity : target.entity,
61
+ }));
62
+ return this;
63
+ }
64
+ /**
65
+ * Get the action payload without executing
66
+ * @returns The action data that would be sent
67
+ */
68
+ getData() {
69
+ var _a, _b;
70
+ const allAssociations = [...this._associations, ...this._pendingLinks];
71
+ return {
72
+ entity: 'CrmModule:AffiliateCode',
73
+ type: undefined,
74
+ actionName: 'CreateAffiliateCode',
75
+ properties: this._properties,
76
+ associations: allAssociations.length > 0 ? allAssociations : undefined,
77
+ journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId,
78
+ stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey,
79
+ };
80
+ }
81
+ }
82
+ exports.CreateAffiliateCodeBuilder = CreateAffiliateCodeBuilder;
17
83
  /**
18
84
  * Create Code
19
85
  *
@@ -27,16 +93,11 @@ const core_1 = require("@d19n/odin-types/dist/core");
27
93
  * @benchmark This action is tracked for performance benchmarks
28
94
  */
29
95
  class CreateAffiliateCodeDto extends core_1.OdinRecordCreateDto {
30
- constructor(properties, associations, options) {
31
- // Convert associations object to array of OdinRecordLinkDto
32
- const associationsArray = associations
33
- ? Object.values(associations).filter((a) => a !== undefined && a !== null)
34
- : [];
96
+ constructor(properties, options) {
35
97
  super({
36
98
  entity: 'CrmModule:AffiliateCode',
37
99
  type: undefined,
38
100
  properties,
39
- associations: associationsArray.length > 0 ? associationsArray : undefined,
40
101
  journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
41
102
  });
42
103
  this.actionName = 'CreateAffiliateCode';
@@ -54,3 +115,5 @@ CreateAffiliateCodeDto.EVENT_NAME = 'CrmModule.AffiliateCode.Create.CreateAffili
54
115
  CreateAffiliateCodeDto.PERMISSION = 'schema.action.createaffiliatecode.trigger';
55
116
  CreateAffiliateCodeDto.HAS_ASSOCIATIONS = true;
56
117
  CreateAffiliateCodeDto.HAS_REQUIRED_ASSOCIATIONS = false;
118
+ CreateAffiliateCodeDto.BUILDER_CLASS = 'CreateAffiliateCodeBuilder';
119
+ CreateAffiliateCodeDto.ASSOCIATION_FIELDS = [{ "name": "CampaignAffiliateCodes", "methodName": "linkCampaignAffiliateCodes", "required": false, "schemaAssociationId": "861d3320-5071-4f9e-90c1-fe42fb4a85f0" }, { "name": "ContactAffiliateCodes", "methodName": "linkContactAffiliateCodes", "required": false, "schemaAssociationId": "097e54b9-7194-447e-89f3-d610122cd03b" }];
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
13
  */
14
- import { OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
14
+ import { OdinRecord, OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
15
15
  /**
16
16
  * RabbitMQ message payload for CreateCashbackReward created events
17
17
  *
@@ -26,36 +26,81 @@ export interface CreateCashbackRewardMessage extends OdinRecordCreatedEvent<Crea
26
26
  export interface CreateCashbackRewardProperties {
27
27
  }
28
28
  /**
29
- * Associations for CreateCashbackReward action
29
+ * Builder for CreateCashbackReward action
30
30
  *
31
- * @property Required associations: 0
32
- * @property Optional associations: 4
31
+ * Provides fluent API for adding associations before executing the action.
32
+ * Use .link*() methods to add associations, then call .execute() to run.
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * await record.createCashbackReward({ ...properties })
37
+ * .linkCampaignRewards({ id: '...', entity: '...' })
38
+ * .linkAffiliateCodeRewards({ id: '...', entity: '...' })
39
+ * .execute();
40
+ * ```
33
41
  */
34
- export interface CreateCashbackRewardAssociations {
42
+ export declare class CreateCashbackRewardBuilder {
43
+ private _associations;
44
+ private _properties;
45
+ private _pendingLinks;
46
+ private _options?;
47
+ constructor(properties: CreateCashbackRewardProperties, pendingLinks: OdinRecordLinkDto[], options?: {
48
+ journeyId?: string;
49
+ stageKey?: string;
50
+ });
35
51
  /**
36
- * CampaignRewards
37
- * @type {association}
52
+ * Link CampaignRewards
38
53
  * @schemaAssociationId f25593e0-9ade-4c4d-84ac-8db3e62be61c
54
+ * @param target - The record to link
55
+ * @returns this (for method chaining)
39
56
  */
40
- CampaignRewards?: OdinRecordLinkDto;
57
+ linkCampaignRewards(target: OdinRecord<any> | {
58
+ id: string;
59
+ entity: string;
60
+ }): this;
41
61
  /**
42
- * AffiliateCodeRewards
43
- * @type {association}
62
+ * Link AffiliateCodeRewards
44
63
  * @schemaAssociationId 90515d9f-b58c-4171-a370-f1d885c7ad7f
64
+ * @param target - The record to link
65
+ * @returns this (for method chaining)
45
66
  */
46
- AffiliateCodeRewards?: OdinRecordLinkDto;
67
+ linkAffiliateCodeRewards(target: OdinRecord<any> | {
68
+ id: string;
69
+ entity: string;
70
+ }): this;
47
71
  /**
48
- * ContactReward
49
- * @type {association}
72
+ * Link ContactReward
50
73
  * @schemaAssociationId 636e8951-0c1a-4e87-a6d3-3329586635d3
74
+ * @param target - The record to link
75
+ * @returns this (for method chaining)
51
76
  */
52
- ContactReward?: OdinRecordLinkDto;
77
+ linkContactReward(target: OdinRecord<any> | {
78
+ id: string;
79
+ entity: string;
80
+ }): this;
53
81
  /**
54
- * RewardPaymentMethodRefund
55
- * @type {association}
82
+ * Link RewardPaymentMethodRefund
56
83
  * @schemaAssociationId 8598b653-c4e8-4e8b-a9e4-28b7f534cdcd
84
+ * @param target - The record to link
85
+ * @returns this (for method chaining)
57
86
  */
58
- RewardPaymentMethodRefund?: OdinRecordLinkDto;
87
+ linkRewardPaymentMethodRefund(target: OdinRecord<any> | {
88
+ id: string;
89
+ entity: string;
90
+ }): this;
91
+ /**
92
+ * Get the action payload without executing
93
+ * @returns The action data that would be sent
94
+ */
95
+ getData(): {
96
+ entity: string;
97
+ type: string | undefined;
98
+ actionName: string;
99
+ properties: CreateCashbackRewardProperties;
100
+ associations?: OdinRecordLinkDto[];
101
+ journeyId?: string;
102
+ stageKey?: string;
103
+ };
59
104
  }
60
105
  /**
61
106
  * CreateCashbackReward
@@ -81,10 +126,32 @@ export declare class CreateCashbackRewardDto extends OdinRecordCreateDto<CreateC
81
126
  static readonly PERMISSION = "schema.action.createcashbackreward.trigger";
82
127
  static readonly HAS_ASSOCIATIONS = true;
83
128
  static readonly HAS_REQUIRED_ASSOCIATIONS = false;
129
+ static readonly BUILDER_CLASS = "CreateCashbackRewardBuilder";
130
+ static readonly ASSOCIATION_FIELDS: readonly [{
131
+ readonly name: "CampaignRewards";
132
+ readonly methodName: "linkCampaignRewards";
133
+ readonly required: false;
134
+ readonly schemaAssociationId: "f25593e0-9ade-4c4d-84ac-8db3e62be61c";
135
+ }, {
136
+ readonly name: "AffiliateCodeRewards";
137
+ readonly methodName: "linkAffiliateCodeRewards";
138
+ readonly required: false;
139
+ readonly schemaAssociationId: "90515d9f-b58c-4171-a370-f1d885c7ad7f";
140
+ }, {
141
+ readonly name: "ContactReward";
142
+ readonly methodName: "linkContactReward";
143
+ readonly required: false;
144
+ readonly schemaAssociationId: "636e8951-0c1a-4e87-a6d3-3329586635d3";
145
+ }, {
146
+ readonly name: "RewardPaymentMethodRefund";
147
+ readonly methodName: "linkRewardPaymentMethodRefund";
148
+ readonly required: false;
149
+ readonly schemaAssociationId: "8598b653-c4e8-4e8b-a9e4-28b7f534cdcd";
150
+ }];
84
151
  readonly actionName: string;
85
152
  readonly schemaActionId: string;
86
153
  readonly entity: string;
87
- constructor(properties: CreateCashbackRewardProperties, associations?: CreateCashbackRewardAssociations, options?: {
154
+ constructor(properties: CreateCashbackRewardProperties, options?: {
88
155
  journeyId?: string;
89
156
  });
90
157
  }
@@ -13,8 +13,100 @@
13
13
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CreateCashbackRewardDto = void 0;
16
+ exports.CreateCashbackRewardDto = exports.CreateCashbackRewardBuilder = void 0;
17
17
  const core_1 = require("@d19n/odin-types/dist/core");
18
+ /**
19
+ * Builder for CreateCashbackReward action
20
+ *
21
+ * Provides fluent API for adding associations before executing the action.
22
+ * Use .link*() methods to add associations, then call .execute() to run.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * await record.createCashbackReward({ ...properties })
27
+ * .linkCampaignRewards({ id: '...', entity: '...' })
28
+ * .linkAffiliateCodeRewards({ id: '...', entity: '...' })
29
+ * .execute();
30
+ * ```
31
+ */
32
+ class CreateCashbackRewardBuilder {
33
+ constructor(properties, pendingLinks, options) {
34
+ this._associations = [];
35
+ this._properties = properties;
36
+ this._pendingLinks = pendingLinks;
37
+ this._options = options;
38
+ }
39
+ /**
40
+ * Link CampaignRewards
41
+ * @schemaAssociationId f25593e0-9ade-4c4d-84ac-8db3e62be61c
42
+ * @param target - The record to link
43
+ * @returns this (for method chaining)
44
+ */
45
+ linkCampaignRewards(target) {
46
+ this._associations.push(new core_1.OdinRecordLinkDto({
47
+ id: target.id,
48
+ entity: 'entity' in target ? target.entity : target.entity,
49
+ }));
50
+ return this;
51
+ }
52
+ /**
53
+ * Link AffiliateCodeRewards
54
+ * @schemaAssociationId 90515d9f-b58c-4171-a370-f1d885c7ad7f
55
+ * @param target - The record to link
56
+ * @returns this (for method chaining)
57
+ */
58
+ linkAffiliateCodeRewards(target) {
59
+ this._associations.push(new core_1.OdinRecordLinkDto({
60
+ id: target.id,
61
+ entity: 'entity' in target ? target.entity : target.entity,
62
+ }));
63
+ return this;
64
+ }
65
+ /**
66
+ * Link ContactReward
67
+ * @schemaAssociationId 636e8951-0c1a-4e87-a6d3-3329586635d3
68
+ * @param target - The record to link
69
+ * @returns this (for method chaining)
70
+ */
71
+ linkContactReward(target) {
72
+ this._associations.push(new core_1.OdinRecordLinkDto({
73
+ id: target.id,
74
+ entity: 'entity' in target ? target.entity : target.entity,
75
+ }));
76
+ return this;
77
+ }
78
+ /**
79
+ * Link RewardPaymentMethodRefund
80
+ * @schemaAssociationId 8598b653-c4e8-4e8b-a9e4-28b7f534cdcd
81
+ * @param target - The record to link
82
+ * @returns this (for method chaining)
83
+ */
84
+ linkRewardPaymentMethodRefund(target) {
85
+ this._associations.push(new core_1.OdinRecordLinkDto({
86
+ id: target.id,
87
+ entity: 'entity' in target ? target.entity : target.entity,
88
+ }));
89
+ return this;
90
+ }
91
+ /**
92
+ * Get the action payload without executing
93
+ * @returns The action data that would be sent
94
+ */
95
+ getData() {
96
+ var _a, _b;
97
+ const allAssociations = [...this._associations, ...this._pendingLinks];
98
+ return {
99
+ entity: 'CrmModule:Reward',
100
+ type: 'CASHBACK',
101
+ actionName: 'CreateCashbackReward',
102
+ properties: this._properties,
103
+ associations: allAssociations.length > 0 ? allAssociations : undefined,
104
+ journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId,
105
+ stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey,
106
+ };
107
+ }
108
+ }
109
+ exports.CreateCashbackRewardBuilder = CreateCashbackRewardBuilder;
18
110
  /**
19
111
  * CreateCashbackReward
20
112
  *
@@ -29,16 +121,11 @@ const core_1 = require("@d19n/odin-types/dist/core");
29
121
  * @benchmark This action is tracked for performance benchmarks
30
122
  */
31
123
  class CreateCashbackRewardDto extends core_1.OdinRecordCreateDto {
32
- constructor(properties, associations, options) {
33
- // Convert associations object to array of OdinRecordLinkDto
34
- const associationsArray = associations
35
- ? Object.values(associations).filter((a) => a !== undefined && a !== null)
36
- : [];
124
+ constructor(properties, options) {
37
125
  super({
38
126
  entity: 'CrmModule:Reward',
39
127
  type: 'CASHBACK',
40
128
  properties,
41
- associations: associationsArray.length > 0 ? associationsArray : undefined,
42
129
  journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
43
130
  });
44
131
  this.actionName = 'CreateCashbackReward';
@@ -57,3 +144,5 @@ CreateCashbackRewardDto.EVENT_NAME = 'CrmModule.Reward.Create.CreateCashbackRewa
57
144
  CreateCashbackRewardDto.PERMISSION = 'schema.action.createcashbackreward.trigger';
58
145
  CreateCashbackRewardDto.HAS_ASSOCIATIONS = true;
59
146
  CreateCashbackRewardDto.HAS_REQUIRED_ASSOCIATIONS = false;
147
+ CreateCashbackRewardDto.BUILDER_CLASS = 'CreateCashbackRewardBuilder';
148
+ CreateCashbackRewardDto.ASSOCIATION_FIELDS = [{ "name": "CampaignRewards", "methodName": "linkCampaignRewards", "required": false, "schemaAssociationId": "f25593e0-9ade-4c4d-84ac-8db3e62be61c" }, { "name": "AffiliateCodeRewards", "methodName": "linkAffiliateCodeRewards", "required": false, "schemaAssociationId": "90515d9f-b58c-4171-a370-f1d885c7ad7f" }, { "name": "ContactReward", "methodName": "linkContactReward", "required": false, "schemaAssociationId": "636e8951-0c1a-4e87-a6d3-3329586635d3" }, { "name": "RewardPaymentMethodRefund", "methodName": "linkRewardPaymentMethodRefund", "required": false, "schemaAssociationId": "8598b653-c4e8-4e8b-a9e4-28b7f534cdcd" }];
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
13
  */
14
- import { OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
14
+ import { OdinRecord, OdinRecordCreateDto, OdinRecordCreatedEvent, OdinRecordLinkDto } from '@d19n/odin-types/dist/core';
15
15
  /**
16
16
  * RabbitMQ message payload for CreateCollectionAmcoReplacementWorkOrder created events
17
17
  *
@@ -123,18 +123,50 @@ export interface CreateCollectionAmcoReplacementWorkOrderProperties {
123
123
  AlternativeContact?: string | null;
124
124
  }
125
125
  /**
126
- * Associations for CreateCollectionAmcoReplacementWorkOrder action
126
+ * Builder for CreateCollectionAmcoReplacementWorkOrder action
127
127
  *
128
- * @property Required associations: 0
129
- * @property Optional associations: 1
128
+ * Provides fluent API for adding associations before executing the action.
129
+ * Use .link*() methods to add associations, then call .execute() to run.
130
+ *
131
+ * @example
132
+ * ```typescript
133
+ * await record.createCollectionAmcoReplacementWorkOrder({ ...properties })
134
+ * .linkOrderWorkOrder({ id: '...', entity: '...' })
135
+ * .execute();
136
+ * ```
130
137
  */
131
- export interface CreateCollectionAmcoReplacementWorkOrderAssociations {
138
+ export declare class CreateCollectionAmcoReplacementWorkOrderBuilder {
139
+ private _associations;
140
+ private _properties;
141
+ private _pendingLinks;
142
+ private _options?;
143
+ constructor(properties: CreateCollectionAmcoReplacementWorkOrderProperties, pendingLinks: OdinRecordLinkDto[], options?: {
144
+ journeyId?: string;
145
+ stageKey?: string;
146
+ });
132
147
  /**
133
- * Order__WorkOrder
134
- * @type {association}
148
+ * Link Order__WorkOrder
135
149
  * @schemaAssociationId f02581da-2a0b-49d6-befc-21b02eee1421
150
+ * @param target - The record to link
151
+ * @returns this (for method chaining)
136
152
  */
137
- OrderWorkOrder?: OdinRecordLinkDto;
153
+ linkOrderWorkOrder(target: OdinRecord<any> | {
154
+ id: string;
155
+ entity: string;
156
+ }): this;
157
+ /**
158
+ * Get the action payload without executing
159
+ * @returns The action data that would be sent
160
+ */
161
+ getData(): {
162
+ entity: string;
163
+ type: string | undefined;
164
+ actionName: string;
165
+ properties: CreateCollectionAmcoReplacementWorkOrderProperties;
166
+ associations?: OdinRecordLinkDto[];
167
+ journeyId?: string;
168
+ stageKey?: string;
169
+ };
138
170
  }
139
171
  /**
140
172
  * Create 3PL Replacement Collection
@@ -160,10 +192,17 @@ export declare class CreateCollectionAmcoReplacementWorkOrderDto extends OdinRec
160
192
  static readonly PERMISSION = "schema.action.createcollectionamcoreplacementworkorder.trigger";
161
193
  static readonly HAS_ASSOCIATIONS = true;
162
194
  static readonly HAS_REQUIRED_ASSOCIATIONS = false;
195
+ static readonly BUILDER_CLASS = "CreateCollectionAmcoReplacementWorkOrderBuilder";
196
+ static readonly ASSOCIATION_FIELDS: readonly [{
197
+ readonly name: "OrderWorkOrder";
198
+ readonly methodName: "linkOrderWorkOrder";
199
+ readonly required: false;
200
+ readonly schemaAssociationId: "f02581da-2a0b-49d6-befc-21b02eee1421";
201
+ }];
163
202
  readonly actionName: string;
164
203
  readonly schemaActionId: string;
165
204
  readonly entity: string;
166
- constructor(properties: CreateCollectionAmcoReplacementWorkOrderProperties, associations?: CreateCollectionAmcoReplacementWorkOrderAssociations, options?: {
205
+ constructor(properties: CreateCollectionAmcoReplacementWorkOrderProperties, options?: {
167
206
  journeyId?: string;
168
207
  });
169
208
  }
@@ -13,8 +13,60 @@
13
13
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.CreateCollectionAmcoReplacementWorkOrderDto = void 0;
16
+ exports.CreateCollectionAmcoReplacementWorkOrderDto = exports.CreateCollectionAmcoReplacementWorkOrderBuilder = void 0;
17
17
  const core_1 = require("@d19n/odin-types/dist/core");
18
+ /**
19
+ * Builder for CreateCollectionAmcoReplacementWorkOrder action
20
+ *
21
+ * Provides fluent API for adding associations before executing the action.
22
+ * Use .link*() methods to add associations, then call .execute() to run.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * await record.createCollectionAmcoReplacementWorkOrder({ ...properties })
27
+ * .linkOrderWorkOrder({ id: '...', entity: '...' })
28
+ * .execute();
29
+ * ```
30
+ */
31
+ class CreateCollectionAmcoReplacementWorkOrderBuilder {
32
+ constructor(properties, pendingLinks, options) {
33
+ this._associations = [];
34
+ this._properties = properties;
35
+ this._pendingLinks = pendingLinks;
36
+ this._options = options;
37
+ }
38
+ /**
39
+ * Link Order__WorkOrder
40
+ * @schemaAssociationId f02581da-2a0b-49d6-befc-21b02eee1421
41
+ * @param target - The record to link
42
+ * @returns this (for method chaining)
43
+ */
44
+ linkOrderWorkOrder(target) {
45
+ this._associations.push(new core_1.OdinRecordLinkDto({
46
+ id: target.id,
47
+ entity: 'entity' in target ? target.entity : target.entity,
48
+ }));
49
+ return this;
50
+ }
51
+ /**
52
+ * Get the action payload without executing
53
+ * @returns The action data that would be sent
54
+ */
55
+ getData() {
56
+ var _a, _b;
57
+ const allAssociations = [...this._associations, ...this._pendingLinks];
58
+ return {
59
+ entity: 'FieldServiceModule:WorkOrder',
60
+ type: 'COLLECTION_AMCO',
61
+ actionName: 'CreateCollectionAmcoReplacementWorkOrder',
62
+ properties: this._properties,
63
+ associations: allAssociations.length > 0 ? allAssociations : undefined,
64
+ journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId,
65
+ stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey,
66
+ };
67
+ }
68
+ }
69
+ exports.CreateCollectionAmcoReplacementWorkOrderBuilder = CreateCollectionAmcoReplacementWorkOrderBuilder;
18
70
  /**
19
71
  * Create 3PL Replacement Collection
20
72
  *
@@ -29,16 +81,11 @@ const core_1 = require("@d19n/odin-types/dist/core");
29
81
  * @benchmarkTags entity-type:collection_amco, entity:workorder, field-operations, record-creation, workorder
30
82
  */
31
83
  class CreateCollectionAmcoReplacementWorkOrderDto extends core_1.OdinRecordCreateDto {
32
- constructor(properties, associations, options) {
33
- // Convert associations object to array of OdinRecordLinkDto
34
- const associationsArray = associations
35
- ? Object.values(associations).filter((a) => a !== undefined && a !== null)
36
- : [];
84
+ constructor(properties, options) {
37
85
  super({
38
86
  entity: 'FieldServiceModule:WorkOrder',
39
87
  type: 'COLLECTION_AMCO',
40
88
  properties,
41
- associations: associationsArray.length > 0 ? associationsArray : undefined,
42
89
  journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
43
90
  });
44
91
  this.actionName = 'CreateCollectionAmcoReplacementWorkOrder';
@@ -57,3 +104,5 @@ CreateCollectionAmcoReplacementWorkOrderDto.EVENT_NAME = 'FieldServiceModule.Wor
57
104
  CreateCollectionAmcoReplacementWorkOrderDto.PERMISSION = 'schema.action.createcollectionamcoreplacementworkorder.trigger';
58
105
  CreateCollectionAmcoReplacementWorkOrderDto.HAS_ASSOCIATIONS = true;
59
106
  CreateCollectionAmcoReplacementWorkOrderDto.HAS_REQUIRED_ASSOCIATIONS = false;
107
+ CreateCollectionAmcoReplacementWorkOrderDto.BUILDER_CLASS = 'CreateCollectionAmcoReplacementWorkOrderBuilder';
108
+ CreateCollectionAmcoReplacementWorkOrderDto.ASSOCIATION_FIELDS = [{ "name": "OrderWorkOrder", "methodName": "linkOrderWorkOrder", "required": false, "schemaAssociationId": "f02581da-2a0b-49d6-befc-21b02eee1421" }];