@d19n/youfibre-odin-sdk 1.0.296-beta.2 → 1.0.296-beta.4
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 +2 -1
- package/dist/actions-v2/AssignCaseByUserDto.d.ts +65 -0
- package/dist/actions-v2/AssignCaseByUserDto.js +49 -0
- package/dist/actions-v2/CreateCashbackRewardDto.d.ts +40 -92
- package/dist/actions-v2/CreateCashbackRewardDto.js +1 -97
- package/dist/actions-v2/CreateOrderReferralDto.d.ts +33 -107
- package/dist/actions-v2/CreateOrderReferralDto.js +1 -110
- package/dist/records-v2/CaseRecord.d.ts +24 -0
- package/dist/records-v2/CaseRecord.js +36 -0
- package/dist/records-v2/ReferralRecord.d.ts +1 -1
- package/dist/records-v2/RewardRecord.d.ts +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -444,7 +444,7 @@ This SDK includes **256** entities across **12** modules.
|
|
|
444
444
|
|
|
445
445
|
## Actions
|
|
446
446
|
|
|
447
|
-
This SDK includes **
|
|
447
|
+
This SDK includes **481** actions.
|
|
448
448
|
|
|
449
449
|
### Action Types
|
|
450
450
|
|
|
@@ -805,6 +805,7 @@ This SDK includes **480** actions.
|
|
|
805
805
|
|
|
806
806
|
| Action | Type | Event |
|
|
807
807
|
|--------|------|-------|
|
|
808
|
+
| `AssignCaseByUser` | UPDATE | SupportModule.Case.Update.AssignCaseByUser |
|
|
808
809
|
| `AssignCase` | UPDATE | SupportModule.Case.Update.AssignCase |
|
|
809
810
|
| `AssignCaseWithNoteFlow` | MULTI_STEP_FLOW | SupportModule.Case.Update.AssignCase |
|
|
810
811
|
| `CaseDefaultStageEscalated` | STAGE_TRANSITION | SupportModule.Case.Update.EscalateCaseAction |
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AssignCaseByUser Action DTO
|
|
3
|
+
*
|
|
4
|
+
* AssignCaseByUser
|
|
5
|
+
*
|
|
6
|
+
* @module SupportModule
|
|
7
|
+
* @entity Case
|
|
8
|
+
* @actionKey AssignCaseByUser
|
|
9
|
+
* @event AssignCaseByUser
|
|
10
|
+
*
|
|
11
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
12
|
+
*/
|
|
13
|
+
import { OdinRecord, OdinRecordUpdateDto, OdinRecordUpdatedEvent } from '@d19n/odin-types/dist/core';
|
|
14
|
+
/**
|
|
15
|
+
* RabbitMQ message payload for AssignCaseByUser updated events
|
|
16
|
+
*
|
|
17
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
18
|
+
*/
|
|
19
|
+
export interface AssignCaseByUserMessage extends OdinRecordUpdatedEvent<AssignCaseByUserDto, AssignCaseByUserProperties> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Properties for AssignCaseByUser action
|
|
23
|
+
*
|
|
24
|
+
* @property Required fields: 0
|
|
25
|
+
* @property Optional fields: 1
|
|
26
|
+
*/
|
|
27
|
+
export interface AssignCaseByUserProperties {
|
|
28
|
+
/**
|
|
29
|
+
* Owner
|
|
30
|
+
*
|
|
31
|
+
* Reference identifier for Case relationships. Used for data integrity.
|
|
32
|
+
* @type {LOOKUP}
|
|
33
|
+
*/
|
|
34
|
+
OwnerId?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Assign by user
|
|
38
|
+
*
|
|
39
|
+
* @actionType UPDATE - Updates an existing Case record
|
|
40
|
+
* @module SupportModule
|
|
41
|
+
* @entity Case
|
|
42
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
43
|
+
* @permission schema.action.assigncasebyuser.trigger
|
|
44
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
45
|
+
*/
|
|
46
|
+
export declare class AssignCaseByUserDto extends OdinRecordUpdateDto<AssignCaseByUserProperties> {
|
|
47
|
+
/** Used by SDK generators to identify action type */
|
|
48
|
+
static readonly ACTION_TYPE = "UPDATE";
|
|
49
|
+
static readonly ACTION_KEY = "AssignCaseByUser";
|
|
50
|
+
static readonly MODULE_NAME = "SupportModule";
|
|
51
|
+
static readonly ENTITIES: string[];
|
|
52
|
+
static readonly EVENT_NAME = "SupportModule.Case.Update.AssignCaseByUser";
|
|
53
|
+
static readonly PERMISSION = "schema.action.assigncasebyuser.trigger";
|
|
54
|
+
readonly actionName: string;
|
|
55
|
+
readonly schemaActionId: string;
|
|
56
|
+
readonly entity: string;
|
|
57
|
+
constructor(record: OdinRecord<any> | {
|
|
58
|
+
id: string;
|
|
59
|
+
entity: string;
|
|
60
|
+
type?: string;
|
|
61
|
+
}, properties: AssignCaseByUserProperties, options?: {
|
|
62
|
+
journeyId?: string;
|
|
63
|
+
stageKey?: string;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* AssignCaseByUser Action DTO
|
|
4
|
+
*
|
|
5
|
+
* AssignCaseByUser
|
|
6
|
+
*
|
|
7
|
+
* @module SupportModule
|
|
8
|
+
* @entity Case
|
|
9
|
+
* @actionKey AssignCaseByUser
|
|
10
|
+
* @event AssignCaseByUser
|
|
11
|
+
*
|
|
12
|
+
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.AssignCaseByUserDto = void 0;
|
|
16
|
+
const core_1 = require("@d19n/odin-types/dist/core");
|
|
17
|
+
/**
|
|
18
|
+
* Assign by user
|
|
19
|
+
*
|
|
20
|
+
* @actionType UPDATE - Updates an existing Case record
|
|
21
|
+
* @module SupportModule
|
|
22
|
+
* @entity Case
|
|
23
|
+
* @event SupportModule.Case.Update.AssignCaseByUser
|
|
24
|
+
* @permission schema.action.assigncasebyuser.trigger
|
|
25
|
+
* @benchmark This action is tracked for performance benchmarks
|
|
26
|
+
*/
|
|
27
|
+
class AssignCaseByUserDto extends core_1.OdinRecordUpdateDto {
|
|
28
|
+
constructor(record, properties, options) {
|
|
29
|
+
super({
|
|
30
|
+
id: record.id,
|
|
31
|
+
entity: record.entity,
|
|
32
|
+
type: record.type,
|
|
33
|
+
properties,
|
|
34
|
+
journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
|
|
35
|
+
stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
|
|
36
|
+
});
|
|
37
|
+
this.actionName = 'AssignCaseByUser';
|
|
38
|
+
this.schemaActionId = 'd9e73b2b-3b0f-4822-a5a5-ce9d524b03af';
|
|
39
|
+
this.entity = 'SupportModule:Case';
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.AssignCaseByUserDto = AssignCaseByUserDto;
|
|
43
|
+
/** Used by SDK generators to identify action type */
|
|
44
|
+
AssignCaseByUserDto.ACTION_TYPE = 'UPDATE';
|
|
45
|
+
AssignCaseByUserDto.ACTION_KEY = 'AssignCaseByUser';
|
|
46
|
+
AssignCaseByUserDto.MODULE_NAME = 'SupportModule';
|
|
47
|
+
AssignCaseByUserDto.ENTITIES = ['Case'];
|
|
48
|
+
AssignCaseByUserDto.EVENT_NAME = 'SupportModule.Case.Update.AssignCaseByUser';
|
|
49
|
+
AssignCaseByUserDto.PERMISSION = 'schema.action.assigncasebyuser.trigger';
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
13
13
|
*/
|
|
14
|
-
import {
|
|
14
|
+
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
15
15
|
/**
|
|
16
16
|
* RabbitMQ message payload for CreateCashbackReward created events
|
|
17
17
|
*
|
|
@@ -22,85 +22,57 @@ export interface CreateCashbackRewardMessage extends OdinRecordCreatedEvent<Crea
|
|
|
22
22
|
/**
|
|
23
23
|
* Properties for CreateCashbackReward action
|
|
24
24
|
*
|
|
25
|
+
* @property Required fields: 5
|
|
26
|
+
* @property Optional fields: 1
|
|
25
27
|
*/
|
|
26
28
|
export interface CreateCashbackRewardProperties {
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Builder for CreateCashbackReward action
|
|
30
|
-
*
|
|
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
|
-
* ```
|
|
41
|
-
*/
|
|
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
|
-
});
|
|
51
29
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
30
|
+
* Currency
|
|
31
|
+
*
|
|
32
|
+
* Currency of the rewarded amount
|
|
33
|
+
* @type {TEXT}
|
|
34
|
+
* @required
|
|
56
35
|
*/
|
|
57
|
-
|
|
58
|
-
id: string;
|
|
59
|
-
entity: string;
|
|
60
|
-
}): this;
|
|
36
|
+
Currency: string;
|
|
61
37
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @
|
|
38
|
+
* Amount
|
|
39
|
+
*
|
|
40
|
+
* Reward amount value
|
|
41
|
+
* @type {NUMBER}
|
|
42
|
+
* @required
|
|
66
43
|
*/
|
|
67
|
-
|
|
68
|
-
id: string;
|
|
69
|
-
entity: string;
|
|
70
|
-
}): this;
|
|
44
|
+
Amount: number;
|
|
71
45
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
46
|
+
* AffiliateCodeId
|
|
47
|
+
*
|
|
48
|
+
* Affiliate code that generated this reward
|
|
49
|
+
* @type {LOOKUP}
|
|
50
|
+
* @required
|
|
76
51
|
*/
|
|
77
|
-
|
|
78
|
-
id: string;
|
|
79
|
-
entity: string;
|
|
80
|
-
}): this;
|
|
52
|
+
AffiliateCodeId: string;
|
|
81
53
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
54
|
+
* CampaignId
|
|
55
|
+
*
|
|
56
|
+
* Campaign this reward belongs to
|
|
57
|
+
* @type {LOOKUP}
|
|
58
|
+
* @required
|
|
86
59
|
*/
|
|
87
|
-
|
|
88
|
-
id: string;
|
|
89
|
-
entity: string;
|
|
90
|
-
}): this;
|
|
60
|
+
CampaignId: string;
|
|
91
61
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
62
|
+
* ContactId
|
|
63
|
+
*
|
|
64
|
+
* Contact receiving the reward
|
|
65
|
+
* @type {LOOKUP}
|
|
66
|
+
* @required
|
|
94
67
|
*/
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
};
|
|
68
|
+
ContactId: string;
|
|
69
|
+
/**
|
|
70
|
+
* PaymentMethodRefundId
|
|
71
|
+
*
|
|
72
|
+
* PaymentMethodRefund reference
|
|
73
|
+
* @type {LOOKUP}
|
|
74
|
+
*/
|
|
75
|
+
PaymentMethodRefundId?: string | null;
|
|
104
76
|
}
|
|
105
77
|
/**
|
|
106
78
|
* CreateCashbackReward
|
|
@@ -124,30 +96,6 @@ export declare class CreateCashbackRewardDto extends OdinRecordCreateDto<CreateC
|
|
|
124
96
|
static readonly ENTITY_TYPE = "CASHBACK";
|
|
125
97
|
static readonly EVENT_NAME = "CrmModule.Reward.Create.CreateCashbackReward";
|
|
126
98
|
static readonly PERMISSION = "schema.action.createcashbackreward.trigger";
|
|
127
|
-
static readonly HAS_ASSOCIATIONS = true;
|
|
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
|
-
}];
|
|
151
99
|
readonly actionName: string;
|
|
152
100
|
readonly schemaActionId: string;
|
|
153
101
|
readonly entity: string;
|
|
@@ -13,100 +13,8 @@
|
|
|
13
13
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CreateCashbackRewardDto =
|
|
16
|
+
exports.CreateCashbackRewardDto = 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;
|
|
110
18
|
/**
|
|
111
19
|
* CreateCashbackReward
|
|
112
20
|
*
|
|
@@ -142,7 +50,3 @@ CreateCashbackRewardDto.ENTITIES = ['Reward'];
|
|
|
142
50
|
CreateCashbackRewardDto.ENTITY_TYPE = 'CASHBACK';
|
|
143
51
|
CreateCashbackRewardDto.EVENT_NAME = 'CrmModule.Reward.Create.CreateCashbackReward';
|
|
144
52
|
CreateCashbackRewardDto.PERMISSION = 'schema.action.createcashbackreward.trigger';
|
|
145
|
-
CreateCashbackRewardDto.HAS_ASSOCIATIONS = true;
|
|
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 {
|
|
14
|
+
import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
|
|
15
15
|
/**
|
|
16
16
|
* RabbitMQ message payload for CreateOrderReferral created events
|
|
17
17
|
*
|
|
@@ -22,95 +22,50 @@ export interface CreateOrderReferralMessage extends OdinRecordCreatedEvent<Creat
|
|
|
22
22
|
/**
|
|
23
23
|
* Properties for CreateOrderReferral action
|
|
24
24
|
*
|
|
25
|
+
* @property Required fields: 5
|
|
26
|
+
* @property Optional fields: 0
|
|
25
27
|
*/
|
|
26
28
|
export interface CreateOrderReferralProperties {
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Builder for CreateOrderReferral action
|
|
30
|
-
*
|
|
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.createOrderReferral({ ...properties })
|
|
37
|
-
* .linkCampaignReferrals({ id: '...', entity: '...' })
|
|
38
|
-
* .linkAffiliateCodeReferrals({ id: '...', entity: '...' })
|
|
39
|
-
* .execute();
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
export declare class CreateOrderReferralBuilder {
|
|
43
|
-
private _associations;
|
|
44
|
-
private _properties;
|
|
45
|
-
private _pendingLinks;
|
|
46
|
-
private _options?;
|
|
47
|
-
constructor(properties: CreateOrderReferralProperties, pendingLinks: OdinRecordLinkDto[], options?: {
|
|
48
|
-
journeyId?: string;
|
|
49
|
-
stageKey?: string;
|
|
50
|
-
});
|
|
51
29
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
30
|
+
* RefereeContactId
|
|
31
|
+
*
|
|
32
|
+
* Contact who was referred
|
|
33
|
+
* @type {LOOKUP}
|
|
34
|
+
* @required
|
|
56
35
|
*/
|
|
57
|
-
|
|
58
|
-
id: string;
|
|
59
|
-
entity: string;
|
|
60
|
-
}): this;
|
|
36
|
+
RefereeContactId: string;
|
|
61
37
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* @
|
|
38
|
+
* AffiliateCodeId
|
|
39
|
+
*
|
|
40
|
+
* Affiliate code used for this referral
|
|
41
|
+
* @type {LOOKUP}
|
|
42
|
+
* @required
|
|
66
43
|
*/
|
|
67
|
-
|
|
68
|
-
id: string;
|
|
69
|
-
entity: string;
|
|
70
|
-
}): this;
|
|
44
|
+
AffiliateCodeId: string;
|
|
71
45
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* @
|
|
46
|
+
* ReferrerContactId
|
|
47
|
+
*
|
|
48
|
+
* Contact who made the referral
|
|
49
|
+
* @type {LOOKUP}
|
|
50
|
+
* @required
|
|
76
51
|
*/
|
|
77
|
-
|
|
78
|
-
id: string;
|
|
79
|
-
entity: string;
|
|
80
|
-
}): this;
|
|
52
|
+
ReferrerContactId: string;
|
|
81
53
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
85
|
-
* @
|
|
54
|
+
* CampaignId
|
|
55
|
+
*
|
|
56
|
+
* Campaign this referral belongs to
|
|
57
|
+
* @type {LOOKUP}
|
|
58
|
+
* @required
|
|
86
59
|
*/
|
|
87
|
-
|
|
88
|
-
id: string;
|
|
89
|
-
entity: string;
|
|
90
|
-
}): this;
|
|
60
|
+
CampaignId: string;
|
|
91
61
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
* @
|
|
62
|
+
* OrderId
|
|
63
|
+
*
|
|
64
|
+
* Order reference from where the referral started
|
|
65
|
+
* @type {LOOKUP}
|
|
66
|
+
* @required
|
|
96
67
|
*/
|
|
97
|
-
|
|
98
|
-
id: string;
|
|
99
|
-
entity: string;
|
|
100
|
-
}): this;
|
|
101
|
-
/**
|
|
102
|
-
* Get the action payload without executing
|
|
103
|
-
* @returns The action data that would be sent
|
|
104
|
-
*/
|
|
105
|
-
getData(): {
|
|
106
|
-
entity: string;
|
|
107
|
-
type: string | undefined;
|
|
108
|
-
actionName: string;
|
|
109
|
-
properties: CreateOrderReferralProperties;
|
|
110
|
-
associations?: OdinRecordLinkDto[];
|
|
111
|
-
journeyId?: string;
|
|
112
|
-
stageKey?: string;
|
|
113
|
-
};
|
|
68
|
+
OrderId: string;
|
|
114
69
|
}
|
|
115
70
|
/**
|
|
116
71
|
* Create Order Referral
|
|
@@ -134,35 +89,6 @@ export declare class CreateOrderReferralDto extends OdinRecordCreateDto<CreateOr
|
|
|
134
89
|
static readonly ENTITY_TYPE = "ORDER";
|
|
135
90
|
static readonly EVENT_NAME = "CrmModule.Referral.Create.CreateOrderReferral";
|
|
136
91
|
static readonly PERMISSION = "schema.action.createorderreferral.trigger";
|
|
137
|
-
static readonly HAS_ASSOCIATIONS = true;
|
|
138
|
-
static readonly HAS_REQUIRED_ASSOCIATIONS = false;
|
|
139
|
-
static readonly BUILDER_CLASS = "CreateOrderReferralBuilder";
|
|
140
|
-
static readonly ASSOCIATION_FIELDS: readonly [{
|
|
141
|
-
readonly name: "CampaignReferrals";
|
|
142
|
-
readonly methodName: "linkCampaignReferrals";
|
|
143
|
-
readonly required: false;
|
|
144
|
-
readonly schemaAssociationId: "d543cb67-f417-4127-bc2b-0626e928e04f";
|
|
145
|
-
}, {
|
|
146
|
-
readonly name: "AffiliateCodeReferrals";
|
|
147
|
-
readonly methodName: "linkAffiliateCodeReferrals";
|
|
148
|
-
readonly required: false;
|
|
149
|
-
readonly schemaAssociationId: "8e711c38-ef5c-4e7b-ba78-bb5c2fc455bc";
|
|
150
|
-
}, {
|
|
151
|
-
readonly name: "ReferrerReferrals";
|
|
152
|
-
readonly methodName: "linkReferrerReferrals";
|
|
153
|
-
readonly required: false;
|
|
154
|
-
readonly schemaAssociationId: "eb84ce69-4a59-45d0-a988-f6ee790fcf23";
|
|
155
|
-
}, {
|
|
156
|
-
readonly name: "RefereeReferrals";
|
|
157
|
-
readonly methodName: "linkRefereeReferrals";
|
|
158
|
-
readonly required: false;
|
|
159
|
-
readonly schemaAssociationId: "b5180cbf-ea9d-4e57-9998-0ce8fc519621";
|
|
160
|
-
}, {
|
|
161
|
-
readonly name: "OrderReferral";
|
|
162
|
-
readonly methodName: "linkOrderReferral";
|
|
163
|
-
readonly required: false;
|
|
164
|
-
readonly schemaAssociationId: "9adab3e1-f32e-42d3-a792-cc8451adba24";
|
|
165
|
-
}];
|
|
166
92
|
readonly actionName: string;
|
|
167
93
|
readonly schemaActionId: string;
|
|
168
94
|
readonly entity: string;
|
|
@@ -13,113 +13,8 @@
|
|
|
13
13
|
* AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
14
14
|
*/
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
-
exports.CreateOrderReferralDto =
|
|
16
|
+
exports.CreateOrderReferralDto = void 0;
|
|
17
17
|
const core_1 = require("@d19n/odin-types/dist/core");
|
|
18
|
-
/**
|
|
19
|
-
* Builder for CreateOrderReferral 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.createOrderReferral({ ...properties })
|
|
27
|
-
* .linkCampaignReferrals({ id: '...', entity: '...' })
|
|
28
|
-
* .linkAffiliateCodeReferrals({ id: '...', entity: '...' })
|
|
29
|
-
* .execute();
|
|
30
|
-
* ```
|
|
31
|
-
*/
|
|
32
|
-
class CreateOrderReferralBuilder {
|
|
33
|
-
constructor(properties, pendingLinks, options) {
|
|
34
|
-
this._associations = [];
|
|
35
|
-
this._properties = properties;
|
|
36
|
-
this._pendingLinks = pendingLinks;
|
|
37
|
-
this._options = options;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Link CampaignReferrals
|
|
41
|
-
* @schemaAssociationId d543cb67-f417-4127-bc2b-0626e928e04f
|
|
42
|
-
* @param target - The record to link
|
|
43
|
-
* @returns this (for method chaining)
|
|
44
|
-
*/
|
|
45
|
-
linkCampaignReferrals(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 AffiliateCodeReferrals
|
|
54
|
-
* @schemaAssociationId 8e711c38-ef5c-4e7b-ba78-bb5c2fc455bc
|
|
55
|
-
* @param target - The record to link
|
|
56
|
-
* @returns this (for method chaining)
|
|
57
|
-
*/
|
|
58
|
-
linkAffiliateCodeReferrals(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 ReferrerReferrals
|
|
67
|
-
* @schemaAssociationId eb84ce69-4a59-45d0-a988-f6ee790fcf23
|
|
68
|
-
* @param target - The record to link
|
|
69
|
-
* @returns this (for method chaining)
|
|
70
|
-
*/
|
|
71
|
-
linkReferrerReferrals(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 RefereeReferrals
|
|
80
|
-
* @schemaAssociationId b5180cbf-ea9d-4e57-9998-0ce8fc519621
|
|
81
|
-
* @param target - The record to link
|
|
82
|
-
* @returns this (for method chaining)
|
|
83
|
-
*/
|
|
84
|
-
linkRefereeReferrals(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
|
-
* Link OrderReferral
|
|
93
|
-
* @schemaAssociationId 9adab3e1-f32e-42d3-a792-cc8451adba24
|
|
94
|
-
* @param target - The record to link
|
|
95
|
-
* @returns this (for method chaining)
|
|
96
|
-
*/
|
|
97
|
-
linkOrderReferral(target) {
|
|
98
|
-
this._associations.push(new core_1.OdinRecordLinkDto({
|
|
99
|
-
id: target.id,
|
|
100
|
-
entity: 'entity' in target ? target.entity : target.entity,
|
|
101
|
-
}));
|
|
102
|
-
return this;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Get the action payload without executing
|
|
106
|
-
* @returns The action data that would be sent
|
|
107
|
-
*/
|
|
108
|
-
getData() {
|
|
109
|
-
var _a, _b;
|
|
110
|
-
const allAssociations = [...this._associations, ...this._pendingLinks];
|
|
111
|
-
return {
|
|
112
|
-
entity: 'CrmModule:Referral',
|
|
113
|
-
type: 'ORDER',
|
|
114
|
-
actionName: 'CreateOrderReferral',
|
|
115
|
-
properties: this._properties,
|
|
116
|
-
associations: allAssociations.length > 0 ? allAssociations : undefined,
|
|
117
|
-
journeyId: (_a = this._options) === null || _a === void 0 ? void 0 : _a.journeyId,
|
|
118
|
-
stageKey: (_b = this._options) === null || _b === void 0 ? void 0 : _b.stageKey,
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
exports.CreateOrderReferralBuilder = CreateOrderReferralBuilder;
|
|
123
18
|
/**
|
|
124
19
|
* Create Order Referral
|
|
125
20
|
*
|
|
@@ -155,7 +50,3 @@ CreateOrderReferralDto.ENTITIES = ['Referral'];
|
|
|
155
50
|
CreateOrderReferralDto.ENTITY_TYPE = 'ORDER';
|
|
156
51
|
CreateOrderReferralDto.EVENT_NAME = 'CrmModule.Referral.Create.CreateOrderReferral';
|
|
157
52
|
CreateOrderReferralDto.PERMISSION = 'schema.action.createorderreferral.trigger';
|
|
158
|
-
CreateOrderReferralDto.HAS_ASSOCIATIONS = true;
|
|
159
|
-
CreateOrderReferralDto.HAS_REQUIRED_ASSOCIATIONS = false;
|
|
160
|
-
CreateOrderReferralDto.BUILDER_CLASS = 'CreateOrderReferralBuilder';
|
|
161
|
-
CreateOrderReferralDto.ASSOCIATION_FIELDS = [{ "name": "CampaignReferrals", "methodName": "linkCampaignReferrals", "required": false, "schemaAssociationId": "d543cb67-f417-4127-bc2b-0626e928e04f" }, { "name": "AffiliateCodeReferrals", "methodName": "linkAffiliateCodeReferrals", "required": false, "schemaAssociationId": "8e711c38-ef5c-4e7b-ba78-bb5c2fc455bc" }, { "name": "ReferrerReferrals", "methodName": "linkReferrerReferrals", "required": false, "schemaAssociationId": "eb84ce69-4a59-45d0-a988-f6ee790fcf23" }, { "name": "RefereeReferrals", "methodName": "linkRefereeReferrals", "required": false, "schemaAssociationId": "b5180cbf-ea9d-4e57-9998-0ce8fc519621" }, { "name": "OrderReferral", "methodName": "linkOrderReferral", "required": false, "schemaAssociationId": "9adab3e1-f32e-42d3-a792-cc8451adba24" }];
|
|
@@ -20,6 +20,7 @@ import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/
|
|
|
20
20
|
import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
|
|
21
21
|
import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
|
|
22
22
|
import { CaseProperties, OutageCaseProperties } from '../entities-v2/Case';
|
|
23
|
+
import { AssignCaseByUserProperties } from '../actions-v2/AssignCaseByUserDto';
|
|
23
24
|
import { AssignCaseProperties } from '../actions-v2/AssignCaseDto';
|
|
24
25
|
import { CreateNoteForCaseAssignmentProperties } from '../actions-v2/AssignCaseWithNoteFlowDto';
|
|
25
26
|
import { EscalateCaseActionProperties } from '../actions-v2/CaseDefaultStageEscalatedDto';
|
|
@@ -898,6 +899,29 @@ export declare class CaseRecord<TProps = CaseProperties> {
|
|
|
898
899
|
journeyId?: string;
|
|
899
900
|
stageKey?: string;
|
|
900
901
|
}): Promise<IDbRecordCreateUpdateRes[]>;
|
|
902
|
+
/**
|
|
903
|
+
* AssignCaseByUser
|
|
904
|
+
*
|
|
905
|
+
* Updates this Case record.
|
|
906
|
+
*
|
|
907
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
908
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
909
|
+
* @returns The updated record(s)
|
|
910
|
+
* @throws Error if called on a new (unsaved) record
|
|
911
|
+
*
|
|
912
|
+
* @example
|
|
913
|
+
* ```typescript
|
|
914
|
+
* const record = await odinClient.cases.get(id);
|
|
915
|
+
* await record.assignCaseByUser({ ... });
|
|
916
|
+
* ```
|
|
917
|
+
*/
|
|
918
|
+
assignCaseByUser(propertiesOrOptions?: AssignCaseByUserProperties | {
|
|
919
|
+
journeyId?: string;
|
|
920
|
+
stageKey?: string;
|
|
921
|
+
}, options?: {
|
|
922
|
+
journeyId?: string;
|
|
923
|
+
stageKey?: string;
|
|
924
|
+
}): Promise<IDbRecordCreateUpdateRes[]>;
|
|
901
925
|
/**
|
|
902
926
|
* AssignCase
|
|
903
927
|
*
|
|
@@ -1207,6 +1207,42 @@ class CaseRecord {
|
|
|
1207
1207
|
// ============================================
|
|
1208
1208
|
// UPDATE ACTIONS (require existing record)
|
|
1209
1209
|
// ============================================
|
|
1210
|
+
/**
|
|
1211
|
+
* AssignCaseByUser
|
|
1212
|
+
*
|
|
1213
|
+
* Updates this Case record.
|
|
1214
|
+
*
|
|
1215
|
+
* @param propertiesOrOptions - Properties to update, or options object
|
|
1216
|
+
* @param options - Optional settings (journeyId, stageKey)
|
|
1217
|
+
* @returns The updated record(s)
|
|
1218
|
+
* @throws Error if called on a new (unsaved) record
|
|
1219
|
+
*
|
|
1220
|
+
* @example
|
|
1221
|
+
* ```typescript
|
|
1222
|
+
* const record = await odinClient.cases.get(id);
|
|
1223
|
+
* await record.assignCaseByUser({ ... });
|
|
1224
|
+
* ```
|
|
1225
|
+
*/
|
|
1226
|
+
assignCaseByUser(propertiesOrOptions, options) {
|
|
1227
|
+
var _a;
|
|
1228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1229
|
+
if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
|
|
1230
|
+
throw new Error('assignCaseByUser requires an existing record. Use accessor.get() first.');
|
|
1231
|
+
let properties = {};
|
|
1232
|
+
let opts = options;
|
|
1233
|
+
if (propertiesOrOptions) {
|
|
1234
|
+
if ('journeyId' in propertiesOrOptions || 'stageKey' in propertiesOrOptions) {
|
|
1235
|
+
opts = propertiesOrOptions;
|
|
1236
|
+
}
|
|
1237
|
+
else {
|
|
1238
|
+
properties = propertiesOrOptions;
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
const result = yield this._provider._applyAction('SupportModule', 'Case', Object.assign({ id: this._record.id, entity: this._record.entity, type: this._record.type, actionName: 'AssignCaseByUser', properties, associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined }, opts));
|
|
1242
|
+
this._pendingLinks = [];
|
|
1243
|
+
return result;
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1210
1246
|
/**
|
|
1211
1247
|
* AssignCase
|
|
1212
1248
|
*
|
|
@@ -192,7 +192,7 @@ export declare class ReferralRecord<TProps = ReferralProperties> {
|
|
|
192
192
|
* .createOrderReferral({ ... });
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
|
-
createOrderReferral(properties
|
|
195
|
+
createOrderReferral(properties: CreateOrderReferralProperties, options?: {
|
|
196
196
|
type?: string;
|
|
197
197
|
journeyId?: string;
|
|
198
198
|
stageKey?: string;
|
|
@@ -192,7 +192,7 @@ export declare class RewardRecord<TProps = RewardProperties> {
|
|
|
192
192
|
* .createCashbackReward({ ... });
|
|
193
193
|
* ```
|
|
194
194
|
*/
|
|
195
|
-
createCashbackReward(properties
|
|
195
|
+
createCashbackReward(properties: CreateCashbackRewardProperties, options?: {
|
|
196
196
|
type?: string;
|
|
197
197
|
journeyId?: string;
|
|
198
198
|
stageKey?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d19n/youfibre-odin-sdk",
|
|
3
|
-
"version": "1.0.296-beta.
|
|
3
|
+
"version": "1.0.296-beta.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "@d19n",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"typescript": "4.8.4"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@d19n/odin-sdk-generator": "^3.0.
|
|
14
|
+
"@d19n/odin-sdk-generator": "^3.0.189",
|
|
15
15
|
"@d19n/odin-types": "^3.0.18",
|
|
16
16
|
"@d19n/youfibre-odin-sdk": "^1.0.219"
|
|
17
17
|
},
|