@d19n/youfibre-odin-sdk 2.0.1 → 2.0.2-beta.1

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 (31) hide show
  1. package/README.md +2 -1
  2. package/dist/actions-v2/AssignCaseDto.d.ts +5 -13
  3. package/dist/actions-v2/AssignCaseWithNoteFlowDto.d.ts +5 -13
  4. package/dist/actions-v2/CreateAuddisPgSubmissionAllocationDto.d.ts +8 -1
  5. package/dist/actions-v2/CreateBacsPgSubmissionAllocationDto.d.ts +11 -4
  6. package/dist/actions-v2/CreateCaseFromContactDto.d.ts +5 -13
  7. package/dist/actions-v2/CreateCashbackRewardForOrderReferralDto.d.ts +208 -0
  8. package/dist/actions-v2/CreateCashbackRewardForOrderReferralDto.js +179 -0
  9. package/dist/actions-v2/UpdateTeamDto.d.ts +15 -1
  10. package/dist/api-sdk-v2/ReferralApi.d.ts +2 -0
  11. package/dist/api-sdk-v2/ReferralApi.js +6 -0
  12. package/dist/api-sdk-v2/RewardApi.d.ts +2 -0
  13. package/dist/api-sdk-v2/RewardApi.js +6 -0
  14. package/dist/db-sdk-v2/ReferralDb.d.ts +2 -0
  15. package/dist/db-sdk-v2/ReferralDb.js +6 -0
  16. package/dist/db-sdk-v2/RewardDb.d.ts +2 -0
  17. package/dist/db-sdk-v2/RewardDb.js +6 -0
  18. package/dist/entities-v2/AccountCredit.d.ts +90 -7
  19. package/dist/entities-v2/AccountCredit.js +86 -3
  20. package/dist/entities-v2/Referral.d.ts +7 -0
  21. package/dist/entities-v2/Referral.js +5 -1
  22. package/dist/entities-v2/Reward.d.ts +3 -12
  23. package/dist/entities-v2/Reward.js +0 -2
  24. package/dist/entities-v2/Team.d.ts +21 -0
  25. package/dist/entities-v2/Team.js +17 -1
  26. package/dist/records-v2/ContactRecord.js +2 -0
  27. package/dist/records-v2/ReferralRecord.d.ts +20 -0
  28. package/dist/records-v2/ReferralRecord.js +33 -0
  29. package/dist/records-v2/RewardRecord.d.ts +49 -0
  30. package/dist/records-v2/RewardRecord.js +60 -0
  31. package/package.json +1 -1
@@ -68,6 +68,12 @@ class ReferralDb extends db_provider_1.DbProvider {
68
68
  }
69
69
  return this._order;
70
70
  }
71
+ get reward() {
72
+ if (!this._reward) {
73
+ this._reward = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'CrmModule:Referral', 'CrmModule:Reward', 'OrderReferralCashbackReward');
74
+ }
75
+ return this._reward;
76
+ }
71
77
  // ============================================
72
78
  // STANDARD METHODS
73
79
  // ============================================
@@ -25,11 +25,13 @@ export declare class RewardDb extends DbProvider {
25
25
  private _contact?;
26
26
  private _affiliatecode?;
27
27
  private _paymentmethodrefund?;
28
+ private _referral?;
28
29
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
29
30
  get campaign(): DbRecordLinkManager;
30
31
  get contact(): DbRecordLinkManager;
31
32
  get affiliatecode(): DbRecordLinkManager;
32
33
  get paymentmethodrefund(): DbRecordLinkManager;
34
+ get referral(): DbRecordLinkManager;
33
35
  setRecord(sourceRecord: any): void;
34
36
  /**
35
37
  * Search records with manual pagination control
@@ -62,6 +62,12 @@ class RewardDb extends db_provider_1.DbProvider {
62
62
  }
63
63
  return this._paymentmethodrefund;
64
64
  }
65
+ get referral() {
66
+ if (!this._referral) {
67
+ this._referral = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'CrmModule:Reward', 'CrmModule:Referral', 'OrderReferralCashbackReward');
68
+ }
69
+ return this._referral;
70
+ }
65
71
  // ============================================
66
72
  // STANDARD METHODS
67
73
  // ============================================
@@ -20,19 +20,100 @@ export declare enum AccountCreditEntityTypes {
20
20
  /** This is the default record type */
21
21
  DEFAULT = "DEFAULT"
22
22
  }
23
+ /**
24
+ * Pipeline stage names for DEFAULT AccountCredit
25
+ * Pipeline: Account Credit
26
+ * Account credit fulfillment pipeline
27
+ */
28
+ export declare enum DefaultAccountCreditStageNames {
29
+ /** Pending stage for newly created (unused) account credit (default) */
30
+ Pending = "Pending",
31
+ /** Account credit has been partially used by the customer and is still available */
32
+ InProgress = "In Progress",
33
+ /** The customer has successfully used the full account credit */
34
+ Complete = "Complete",
35
+ /** The account credit has been cancelled (fail) */
36
+ Cancelled = "Cancelled",
37
+ /** The account credit has been voided */
38
+ Void = "Void"
39
+ }
40
+ /**
41
+ * Pipeline stage keys for DEFAULT AccountCredit
42
+ * Use these keys when transitioning between stages
43
+ */
44
+ export declare enum DefaultAccountCreditStageKeys {
45
+ /** Pending stage for newly created (unused) account credit */
46
+ AccountCreditStagePending = "AccountCreditStagePending",
47
+ /** Account credit has been partially used by the customer and is still available */
48
+ AccountCreditStageInProgress = "AccountCreditStageInProgress",
49
+ /** The customer has successfully used the full account credit */
50
+ AccountCreditStageComplete = "AccountCreditStageComplete",
51
+ /** The account credit has been cancelled */
52
+ AccountCreditStageCancelled = "AccountCreditStageCancelled",
53
+ /** The account credit has been voided */
54
+ AccountCreditStageVoid = "AccountCreditStageVoid"
55
+ }
23
56
  /**
24
57
  * Valid values for AccountCredit.Source
25
58
  *
26
59
  * Source
60
+ *
61
+ * @remarks Available options:
62
+ * - `ACCOUNTS` - Accounts
63
+ * - `COMPLAINTS` - Complaints
64
+ * - `RETENTIONS` - Retentions
65
+ * - `SALES` - Sales
66
+ * - `SUPPORT` - Support
67
+ * - `SYSTEM` - System
27
68
  */
28
69
  export declare enum AccountCreditSource {
70
+ ACCOUNTS = "ACCOUNTS",
71
+ COMPLAINTS = "COMPLAINTS",
72
+ RETENTIONS = "RETENTIONS",
73
+ SALES = "SALES",
74
+ SUPPORT = "SUPPORT",
75
+ SYSTEM = "SYSTEM"
29
76
  }
30
77
  /**
31
78
  * Valid values for AccountCredit.Reason
32
79
  *
33
80
  * Reason
81
+ *
82
+ * @remarks Available options:
83
+ * - `FOURTEEN_DAY_TERMINATION_CREDIT` - 14-Day Termination Credit
84
+ * - `BAD_DEBT_CREDIT` - Bad Debt Credit
85
+ * - `BILLING_DAY_CHANGE_CREDIT` - Billing Day Change Credit
86
+ * - `COMPLAINTS_CREDIT` - Complaints Credit
87
+ * - `DOWNTIME_CREDIT` - Downtime Credit
88
+ * - `IN_CONTRACT_BUYOUT` - In Contract Buyout
89
+ * - `INCORRECTLY_BILLED` - Incorrectly Billed
90
+ * - `MANUAL_CREDIT` - Manual Credit
91
+ * - `MOVE_ORDER_CREDIT` - Move Order Credit
92
+ * - `RENEWALS_CREDIT` - Renewals Credit
93
+ * - `RETENTIONS_CREDIT` - Retentions Credit
94
+ * - `REWARD_CORRECTION_CREDIT` - Reward Correction Credit
95
+ * - `SALES_CREDIT` - Sales Credit
96
+ * - `SUPPORT_CREDIT` - Support Credit
97
+ * - `SUSPENSION_CREDIT` - Suspension Credit
98
+ * - ... and 2 more
34
99
  */
35
100
  export declare enum AccountCreditReason {
101
+ BAD_DEBT_CREDIT = "BAD_DEBT_CREDIT",
102
+ BILLING_DAY_CHANGE_CREDIT = "BILLING_DAY_CHANGE_CREDIT",
103
+ COMPLAINTS_CREDIT = "COMPLAINTS_CREDIT",
104
+ DOWNTIME_CREDIT = "DOWNTIME_CREDIT",
105
+ IN_CONTRACT_BUYOUT = "IN_CONTRACT_BUYOUT",
106
+ INCORRECTLY_BILLED = "INCORRECTLY_BILLED",
107
+ MANUAL_CREDIT = "MANUAL_CREDIT",
108
+ MOVE_ORDER_CREDIT = "MOVE_ORDER_CREDIT",
109
+ RENEWALS_CREDIT = "RENEWALS_CREDIT",
110
+ RETENTIONS_CREDIT = "RETENTIONS_CREDIT",
111
+ REWARD_CORRECTION_CREDIT = "REWARD_CORRECTION_CREDIT",
112
+ SALES_CREDIT = "SALES_CREDIT",
113
+ SUPPORT_CREDIT = "SUPPORT_CREDIT",
114
+ SUSPENSION_CREDIT = "SUSPENSION_CREDIT",
115
+ UNSPECIFIED = "UNSPECIFIED",
116
+ WINBACK_CAMPAIGN = "WINBACK_CAMPAIGN"
36
117
  }
37
118
  /**
38
119
  * Property keys for AccountCredit
@@ -41,10 +122,10 @@ export declare enum AccountCreditReason {
41
122
  export declare enum AccountCreditPropertyKeys {
42
123
  /** Source */
43
124
  Source = "Source",
44
- /** Reason */
45
- Reason = "Reason",
46
125
  /** Description */
47
126
  Description = "Description",
127
+ /** Reason */
128
+ Reason = "Reason",
48
129
  /** Contact */
49
130
  Contact = "Contact",
50
131
  /** Credit Balance */
@@ -61,18 +142,20 @@ export interface AccountCreditProperties {
61
142
  /** Source
62
143
  *
63
144
  * @type {ENUM}
145
+ * @enum {AccountCreditSource}
64
146
  */
65
147
  Source: AccountCreditSource;
66
- /** Reason
67
- *
68
- * @type {ENUM}
69
- */
70
- Reason: AccountCreditReason;
71
148
  /** Description
72
149
  *
73
150
  * @type {TEXT}
74
151
  */
75
152
  Description: string;
153
+ /** Reason
154
+ *
155
+ * @type {ENUM}
156
+ * @enum {AccountCreditReason}
157
+ */
158
+ Reason: AccountCreditReason;
76
159
  /** Contact
77
160
  *
78
161
  * @type {LOOKUP}
@@ -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_ACCOUNT_CREDIT_INVOICE_DELETED = exports.ROUTING_KEY_LINK_ACCOUNT_CREDIT_INVOICE_CREATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_DELETED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_UPDATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_CREATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DELETED = exports.ROUTING_KEY_ACCOUNT_CREDIT_UPDATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_CREATED = exports.AccountCredit = exports.AccountCreditPropertyKeys = exports.AccountCreditReason = exports.AccountCreditSource = exports.AccountCreditEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_ACCOUNT_CREDIT_INVOICE_DELETED = exports.ROUTING_KEY_LINK_ACCOUNT_CREDIT_INVOICE_CREATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_DELETED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_UPDATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DEFAULT_CREATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_DELETED = exports.ROUTING_KEY_ACCOUNT_CREDIT_UPDATED = exports.ROUTING_KEY_ACCOUNT_CREDIT_CREATED = exports.AccountCredit = exports.AccountCreditPropertyKeys = exports.AccountCreditReason = exports.AccountCreditSource = exports.DefaultAccountCreditStageKeys = exports.DefaultAccountCreditStageNames = exports.AccountCreditEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for AccountCredit records
@@ -22,21 +22,104 @@ var AccountCreditEntityTypes;
22
22
  /** This is the default record type */
23
23
  AccountCreditEntityTypes["DEFAULT"] = "DEFAULT";
24
24
  })(AccountCreditEntityTypes = exports.AccountCreditEntityTypes || (exports.AccountCreditEntityTypes = {}));
25
+ /**
26
+ * Pipeline stage names for DEFAULT AccountCredit
27
+ * Pipeline: Account Credit
28
+ * Account credit fulfillment pipeline
29
+ */
30
+ var DefaultAccountCreditStageNames;
31
+ (function (DefaultAccountCreditStageNames) {
32
+ /** Pending stage for newly created (unused) account credit (default) */
33
+ DefaultAccountCreditStageNames["Pending"] = "Pending";
34
+ /** Account credit has been partially used by the customer and is still available */
35
+ DefaultAccountCreditStageNames["InProgress"] = "In Progress";
36
+ /** The customer has successfully used the full account credit */
37
+ DefaultAccountCreditStageNames["Complete"] = "Complete";
38
+ /** The account credit has been cancelled (fail) */
39
+ DefaultAccountCreditStageNames["Cancelled"] = "Cancelled";
40
+ /** The account credit has been voided */
41
+ DefaultAccountCreditStageNames["Void"] = "Void";
42
+ })(DefaultAccountCreditStageNames = exports.DefaultAccountCreditStageNames || (exports.DefaultAccountCreditStageNames = {}));
43
+ /**
44
+ * Pipeline stage keys for DEFAULT AccountCredit
45
+ * Use these keys when transitioning between stages
46
+ */
47
+ var DefaultAccountCreditStageKeys;
48
+ (function (DefaultAccountCreditStageKeys) {
49
+ /** Pending stage for newly created (unused) account credit */
50
+ DefaultAccountCreditStageKeys["AccountCreditStagePending"] = "AccountCreditStagePending";
51
+ /** Account credit has been partially used by the customer and is still available */
52
+ DefaultAccountCreditStageKeys["AccountCreditStageInProgress"] = "AccountCreditStageInProgress";
53
+ /** The customer has successfully used the full account credit */
54
+ DefaultAccountCreditStageKeys["AccountCreditStageComplete"] = "AccountCreditStageComplete";
55
+ /** The account credit has been cancelled */
56
+ DefaultAccountCreditStageKeys["AccountCreditStageCancelled"] = "AccountCreditStageCancelled";
57
+ /** The account credit has been voided */
58
+ DefaultAccountCreditStageKeys["AccountCreditStageVoid"] = "AccountCreditStageVoid";
59
+ })(DefaultAccountCreditStageKeys = exports.DefaultAccountCreditStageKeys || (exports.DefaultAccountCreditStageKeys = {}));
25
60
  /**
26
61
  * Valid values for AccountCredit.Source
27
62
  *
28
63
  * Source
64
+ *
65
+ * @remarks Available options:
66
+ * - `ACCOUNTS` - Accounts
67
+ * - `COMPLAINTS` - Complaints
68
+ * - `RETENTIONS` - Retentions
69
+ * - `SALES` - Sales
70
+ * - `SUPPORT` - Support
71
+ * - `SYSTEM` - System
29
72
  */
30
73
  var AccountCreditSource;
31
74
  (function (AccountCreditSource) {
75
+ AccountCreditSource["ACCOUNTS"] = "ACCOUNTS";
76
+ AccountCreditSource["COMPLAINTS"] = "COMPLAINTS";
77
+ AccountCreditSource["RETENTIONS"] = "RETENTIONS";
78
+ AccountCreditSource["SALES"] = "SALES";
79
+ AccountCreditSource["SUPPORT"] = "SUPPORT";
80
+ AccountCreditSource["SYSTEM"] = "SYSTEM";
32
81
  })(AccountCreditSource = exports.AccountCreditSource || (exports.AccountCreditSource = {}));
33
82
  /**
34
83
  * Valid values for AccountCredit.Reason
35
84
  *
36
85
  * Reason
86
+ *
87
+ * @remarks Available options:
88
+ * - `FOURTEEN_DAY_TERMINATION_CREDIT` - 14-Day Termination Credit
89
+ * - `BAD_DEBT_CREDIT` - Bad Debt Credit
90
+ * - `BILLING_DAY_CHANGE_CREDIT` - Billing Day Change Credit
91
+ * - `COMPLAINTS_CREDIT` - Complaints Credit
92
+ * - `DOWNTIME_CREDIT` - Downtime Credit
93
+ * - `IN_CONTRACT_BUYOUT` - In Contract Buyout
94
+ * - `INCORRECTLY_BILLED` - Incorrectly Billed
95
+ * - `MANUAL_CREDIT` - Manual Credit
96
+ * - `MOVE_ORDER_CREDIT` - Move Order Credit
97
+ * - `RENEWALS_CREDIT` - Renewals Credit
98
+ * - `RETENTIONS_CREDIT` - Retentions Credit
99
+ * - `REWARD_CORRECTION_CREDIT` - Reward Correction Credit
100
+ * - `SALES_CREDIT` - Sales Credit
101
+ * - `SUPPORT_CREDIT` - Support Credit
102
+ * - `SUSPENSION_CREDIT` - Suspension Credit
103
+ * - ... and 2 more
37
104
  */
38
105
  var AccountCreditReason;
39
106
  (function (AccountCreditReason) {
107
+ AccountCreditReason["BAD_DEBT_CREDIT"] = "BAD_DEBT_CREDIT";
108
+ AccountCreditReason["BILLING_DAY_CHANGE_CREDIT"] = "BILLING_DAY_CHANGE_CREDIT";
109
+ AccountCreditReason["COMPLAINTS_CREDIT"] = "COMPLAINTS_CREDIT";
110
+ AccountCreditReason["DOWNTIME_CREDIT"] = "DOWNTIME_CREDIT";
111
+ AccountCreditReason["IN_CONTRACT_BUYOUT"] = "IN_CONTRACT_BUYOUT";
112
+ AccountCreditReason["INCORRECTLY_BILLED"] = "INCORRECTLY_BILLED";
113
+ AccountCreditReason["MANUAL_CREDIT"] = "MANUAL_CREDIT";
114
+ AccountCreditReason["MOVE_ORDER_CREDIT"] = "MOVE_ORDER_CREDIT";
115
+ AccountCreditReason["RENEWALS_CREDIT"] = "RENEWALS_CREDIT";
116
+ AccountCreditReason["RETENTIONS_CREDIT"] = "RETENTIONS_CREDIT";
117
+ AccountCreditReason["REWARD_CORRECTION_CREDIT"] = "REWARD_CORRECTION_CREDIT";
118
+ AccountCreditReason["SALES_CREDIT"] = "SALES_CREDIT";
119
+ AccountCreditReason["SUPPORT_CREDIT"] = "SUPPORT_CREDIT";
120
+ AccountCreditReason["SUSPENSION_CREDIT"] = "SUSPENSION_CREDIT";
121
+ AccountCreditReason["UNSPECIFIED"] = "UNSPECIFIED";
122
+ AccountCreditReason["WINBACK_CAMPAIGN"] = "WINBACK_CAMPAIGN";
40
123
  })(AccountCreditReason = exports.AccountCreditReason || (exports.AccountCreditReason = {}));
41
124
  /**
42
125
  * Property keys for AccountCredit
@@ -46,10 +129,10 @@ var AccountCreditPropertyKeys;
46
129
  (function (AccountCreditPropertyKeys) {
47
130
  /** Source */
48
131
  AccountCreditPropertyKeys["Source"] = "Source";
49
- /** Reason */
50
- AccountCreditPropertyKeys["Reason"] = "Reason";
51
132
  /** Description */
52
133
  AccountCreditPropertyKeys["Description"] = "Description";
134
+ /** Reason */
135
+ AccountCreditPropertyKeys["Reason"] = "Reason";
53
136
  /** Contact */
54
137
  AccountCreditPropertyKeys["Contact"] = "Contact";
55
138
  /** Credit Balance */
@@ -15,6 +15,7 @@ import { ContactProperties } from './Contact';
15
15
  import { AffiliateCodeProperties } from './AffiliateCode';
16
16
  import { CampaignProperties } from './Campaign';
17
17
  import { OrderProperties } from './Order';
18
+ import { RewardProperties } from './Reward';
18
19
  /**
19
20
  * Available types for Referral records
20
21
  */
@@ -167,6 +168,8 @@ export declare class Referral extends OdinRecord<ReferralProperties> {
167
168
  Campaign: OdinLink<LinkedOdinRecord<CampaignProperties>>;
168
169
  /** Linked Order records (OrderReferral) */
169
170
  Order: OdinLink<LinkedOdinRecord<OrderProperties>>;
171
+ /** Linked Reward records (OrderReferralCashbackReward) */
172
+ Reward: OdinLink<LinkedOdinRecord<RewardProperties>>;
170
173
  }
171
174
  /**
172
175
  * RabbitMQ routing keys for Referral events
@@ -184,3 +187,7 @@ export declare const ROUTING_KEY_REFERRAL_ORDER_CREATED = "CrmModule.Referral.OR
184
187
  export declare const ROUTING_KEY_REFERRAL_ORDER_UPDATED = "CrmModule.Referral.ORDER.SubDbRecordUpdated";
185
188
  /** Records the usage of an affiliate code for an order deleted */
186
189
  export declare const ROUTING_KEY_REFERRAL_ORDER_DELETED = "CrmModule.Referral.ORDER.SubDbRecordDeleted";
190
+ /** Event: OrderReferralCashbackReward link created */
191
+ export declare const ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_CREATED = "CrmModule.Referral.Reward.SubDbRecordAssociationCreated";
192
+ /** Event: OrderReferralCashbackReward link deleted */
193
+ export declare const ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_DELETED = "CrmModule.Referral.Reward.SubDbRecordAssociationDeleted";
@@ -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_REFERRAL_ORDER_DELETED = exports.ROUTING_KEY_REFERRAL_ORDER_UPDATED = exports.ROUTING_KEY_REFERRAL_ORDER_CREATED = exports.ROUTING_KEY_REFERRAL_DELETED = exports.ROUTING_KEY_REFERRAL_UPDATED = exports.ROUTING_KEY_REFERRAL_CREATED = exports.Referral = exports.ReferralPropertyKeys = exports.OrderReferralStageKeys = exports.OrderReferralStageNames = exports.ReferralEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_DELETED = exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_CREATED = exports.ROUTING_KEY_REFERRAL_ORDER_DELETED = exports.ROUTING_KEY_REFERRAL_ORDER_UPDATED = exports.ROUTING_KEY_REFERRAL_ORDER_CREATED = exports.ROUTING_KEY_REFERRAL_DELETED = exports.ROUTING_KEY_REFERRAL_UPDATED = exports.ROUTING_KEY_REFERRAL_CREATED = exports.Referral = exports.ReferralPropertyKeys = exports.OrderReferralStageKeys = exports.OrderReferralStageNames = exports.ReferralEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for Referral records
@@ -115,3 +115,7 @@ exports.ROUTING_KEY_REFERRAL_ORDER_CREATED = 'CrmModule.Referral.ORDER.SubDbReco
115
115
  exports.ROUTING_KEY_REFERRAL_ORDER_UPDATED = 'CrmModule.Referral.ORDER.SubDbRecordUpdated';
116
116
  /** Records the usage of an affiliate code for an order deleted */
117
117
  exports.ROUTING_KEY_REFERRAL_ORDER_DELETED = 'CrmModule.Referral.ORDER.SubDbRecordDeleted';
118
+ /** Event: OrderReferralCashbackReward link created */
119
+ exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_CREATED = 'CrmModule.Referral.Reward.SubDbRecordAssociationCreated';
120
+ /** Event: OrderReferralCashbackReward link deleted */
121
+ exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_DELETED = 'CrmModule.Referral.Reward.SubDbRecordAssociationDeleted';
@@ -15,6 +15,7 @@ import { CampaignProperties } from './Campaign';
15
15
  import { ContactProperties } from './Contact';
16
16
  import { AffiliateCodeProperties } from './AffiliateCode';
17
17
  import { PaymentMethodRefundProperties } from './PaymentMethodRefund';
18
+ import { ReferralProperties } from './Referral';
18
19
  /**
19
20
  * Available types for Reward records
20
21
  */
@@ -60,8 +61,6 @@ export declare enum RewardPropertyKeys {
60
61
  Amount = "Amount",
61
62
  /** Currency of the rewarded amount */
62
63
  Currency = "Currency",
63
- /** PaymentMethodRefund reference */
64
- PaymentMethodRefundId = "PaymentMethodRefundId",
65
64
  /** Affiliate code that generated this reward */
66
65
  AffiliateCodeId = "AffiliateCodeId"
67
66
  }
@@ -91,11 +90,6 @@ export interface RewardProperties {
91
90
  * @type {TEXT}
92
91
  */
93
92
  Currency: string;
94
- /** PaymentMethodRefund reference
95
- *
96
- * @type {LOOKUP}
97
- */
98
- PaymentMethodRefundId: string;
99
93
  /** Affiliate code that generated this reward
100
94
  *
101
95
  * @type {LOOKUP}
@@ -128,11 +122,6 @@ export interface CashbackRewardProperties {
128
122
  * @type {TEXT}
129
123
  */
130
124
  Currency: string;
131
- /** PaymentMethodRefund reference
132
- *
133
- * @type {LOOKUP}
134
- */
135
- PaymentMethodRefundId: string;
136
125
  /** Affiliate code that generated this reward
137
126
  *
138
127
  * @type {LOOKUP}
@@ -163,6 +152,8 @@ export declare class Reward extends OdinRecord<RewardProperties> {
163
152
  AffiliateCode: OdinLink<LinkedOdinRecord<AffiliateCodeProperties>>;
164
153
  /** Linked PaymentMethodRefund records (RewardPaymentMethodRefund) */
165
154
  PaymentMethodRefund: OdinLink<LinkedOdinRecord<PaymentMethodRefundProperties>>;
155
+ /** Linked Referral records (OrderReferralCashbackReward) */
156
+ Referral: OdinLink<LinkedOdinRecord<ReferralProperties>>;
166
157
  }
167
158
  /**
168
159
  * RabbitMQ routing keys for Reward events
@@ -63,8 +63,6 @@ var RewardPropertyKeys;
63
63
  RewardPropertyKeys["Amount"] = "Amount";
64
64
  /** Currency of the rewarded amount */
65
65
  RewardPropertyKeys["Currency"] = "Currency";
66
- /** PaymentMethodRefund reference */
67
- RewardPropertyKeys["PaymentMethodRefundId"] = "PaymentMethodRefundId";
68
66
  /** Affiliate code that generated this reward */
69
67
  RewardPropertyKeys["AffiliateCodeId"] = "AffiliateCodeId";
70
68
  })(RewardPropertyKeys = exports.RewardPropertyKeys || (exports.RewardPropertyKeys = {}));
@@ -64,6 +64,19 @@ export declare enum TeamWorksCases {
64
64
  NO = "NO",
65
65
  YES = "YES"
66
66
  }
67
+ /**
68
+ * Valid values for Team.CanEscalateTo
69
+ *
70
+ * Can escalate to
71
+ *
72
+ * @remarks Available options:
73
+ * - `NO` - No
74
+ * - `YES` - Yes
75
+ */
76
+ export declare enum TeamCanEscalateTo {
77
+ NO = "NO",
78
+ YES = "YES"
79
+ }
67
80
  /**
68
81
  * Valid values for Team.PrimaryChannel
69
82
  *
@@ -105,6 +118,8 @@ export declare enum TeamPropertyKeys {
105
118
  Name = "Name",
106
119
  /** Available team for allocating cases */
107
120
  WorksCases = "WorksCases",
121
+ /** Can escalate to */
122
+ CanEscalateTo = "CanEscalateTo",
108
123
  /** Primary Channel - Cases */
109
124
  PrimaryChannel = "PrimaryChannel",
110
125
  /** This property is for translations into more readable names for use within schema actions (IT Security - Team) */
@@ -145,6 +160,12 @@ export interface TeamProperties {
145
160
  * @enum {TeamWorksCases}
146
161
  */
147
162
  WorksCases: TeamWorksCases;
163
+ /** Can escalate to
164
+ *
165
+ * @type {ENUM}
166
+ * @enum {TeamCanEscalateTo}
167
+ */
168
+ CanEscalateTo: TeamCanEscalateTo;
148
169
  /** Primary Channel - Cases
149
170
  *
150
171
  * @type {ENUM}
@@ -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_TEAM_USER_DELETED = exports.ROUTING_KEY_LINK_TEAM_USER_CREATED = exports.ROUTING_KEY_TEAM_DEFAULT_DELETED = exports.ROUTING_KEY_TEAM_DEFAULT_UPDATED = exports.ROUTING_KEY_TEAM_DEFAULT_CREATED = exports.ROUTING_KEY_TEAM_DELETED = exports.ROUTING_KEY_TEAM_UPDATED = exports.ROUTING_KEY_TEAM_CREATED = exports.Team = exports.TeamPropertyKeys = exports.TeamSupportTeam = exports.TeamPrimaryChannel = exports.TeamWorksCases = exports.TeamSecondaryChannel = exports.TeamSocialAccess = exports.TeamEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_TEAM_USER_DELETED = exports.ROUTING_KEY_LINK_TEAM_USER_CREATED = exports.ROUTING_KEY_TEAM_DEFAULT_DELETED = exports.ROUTING_KEY_TEAM_DEFAULT_UPDATED = exports.ROUTING_KEY_TEAM_DEFAULT_CREATED = exports.ROUTING_KEY_TEAM_DELETED = exports.ROUTING_KEY_TEAM_UPDATED = exports.ROUTING_KEY_TEAM_CREATED = exports.Team = exports.TeamPropertyKeys = exports.TeamSupportTeam = exports.TeamPrimaryChannel = exports.TeamCanEscalateTo = exports.TeamWorksCases = exports.TeamSecondaryChannel = exports.TeamSocialAccess = exports.TeamEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for Team records
@@ -66,6 +66,20 @@ var TeamWorksCases;
66
66
  TeamWorksCases["NO"] = "NO";
67
67
  TeamWorksCases["YES"] = "YES";
68
68
  })(TeamWorksCases = exports.TeamWorksCases || (exports.TeamWorksCases = {}));
69
+ /**
70
+ * Valid values for Team.CanEscalateTo
71
+ *
72
+ * Can escalate to
73
+ *
74
+ * @remarks Available options:
75
+ * - `NO` - No
76
+ * - `YES` - Yes
77
+ */
78
+ var TeamCanEscalateTo;
79
+ (function (TeamCanEscalateTo) {
80
+ TeamCanEscalateTo["NO"] = "NO";
81
+ TeamCanEscalateTo["YES"] = "YES";
82
+ })(TeamCanEscalateTo = exports.TeamCanEscalateTo || (exports.TeamCanEscalateTo = {}));
69
83
  /**
70
84
  * Valid values for Team.PrimaryChannel
71
85
  *
@@ -110,6 +124,8 @@ var TeamPropertyKeys;
110
124
  TeamPropertyKeys["Name"] = "Name";
111
125
  /** Available team for allocating cases */
112
126
  TeamPropertyKeys["WorksCases"] = "WorksCases";
127
+ /** Can escalate to */
128
+ TeamPropertyKeys["CanEscalateTo"] = "CanEscalateTo";
113
129
  /** Primary Channel - Cases */
114
130
  TeamPropertyKeys["PrimaryChannel"] = "PrimaryChannel";
115
131
  /** This property is for translations into more readable names for use within schema actions (IT Security - Team) */
@@ -171,6 +171,8 @@ class CreateCaseFromContactFlowBuilder {
171
171
  entity: 'SupportModule:Case',
172
172
  schemaId: 'be8173eb-269b-4a67-be0c-11ce6af5d561',
173
173
  schemaActionId: '4fd9f78b-0d8f-414e-96cf-aedf37b36d23',
174
+ schemaTypeId: '2d18d4c3-b4f8-4633-bfb0-ff0d62fbaecf',
175
+ type: 'DEFAULT',
174
176
  autoLinkParent: true,
175
177
  associations: (_a = options === null || options === void 0 ? void 0 : options.associations) === null || _a === void 0 ? void 0 : _a.map(a => (Object.assign(Object.assign({}, a), { linkType: null, relationType: undefined }))),
176
178
  groups: options === null || options === void 0 ? void 0 : options.groups,
@@ -28,6 +28,7 @@ import { ContactRecord } from './ContactRecord';
28
28
  import { AffiliateCodeRecord } from './AffiliateCodeRecord';
29
29
  import { CampaignRecord } from './CampaignRecord';
30
30
  import { OrderRecord } from './OrderRecord';
31
+ import { RewardRecord } from './RewardRecord';
31
32
  /** Valid entity types for Referral */
32
33
  export declare type ReferralType = 'ORDER';
33
34
  /**
@@ -97,6 +98,7 @@ export declare class ReferralRecord<TProps = ReferralProperties> {
97
98
  private _affiliateCodes?;
98
99
  private _campaigns?;
99
100
  private _orders?;
101
+ private _rewards?;
100
102
  /**
101
103
  * Create a record wrapper.
102
104
  * @param record - The underlying record, or null for create operations
@@ -210,6 +212,24 @@ export declare class ReferralRecord<TProps = ReferralProperties> {
210
212
  * ```
211
213
  */
212
214
  get orders(): RecordLinkManager<OrderRecord, typeof ReferralRecord['ordersLabels'][number]>;
215
+ /** Valid labels for Reward associations */
216
+ static readonly rewardsLabels: readonly ["OrderReferralCashbackReward"];
217
+ /**
218
+ * Access linked Reward records
219
+ * @remarks Available labels: OrderReferralCashbackReward
220
+ * @throws Error if called on a new (unsaved) record
221
+ *
222
+ * @example
223
+ * ```typescript
224
+ * // Get all linked Reward records
225
+ * const items = await record.rewards.list();
226
+ * const first = await record.rewards.first();
227
+ *
228
+ * // Filter by label
229
+ * const specific = await record.rewards.first({ label: 'OrderReferralCashbackReward' });
230
+ * ```
231
+ */
232
+ get rewards(): RecordLinkManager<RewardRecord, typeof ReferralRecord['rewardsLabels'][number]>;
213
233
  /**
214
234
  * Queue a link to be created with the next action.
215
235
  * Works for both create and update actions.
@@ -36,6 +36,7 @@ const ContactRecord_1 = require("./ContactRecord");
36
36
  const AffiliateCodeRecord_1 = require("./AffiliateCodeRecord");
37
37
  const CampaignRecord_1 = require("./CampaignRecord");
38
38
  const OrderRecord_1 = require("./OrderRecord");
39
+ const RewardRecord_1 = require("./RewardRecord");
39
40
  /**
40
41
  * Builder for action execution with dryRun support
41
42
  *
@@ -285,6 +286,36 @@ class ReferralRecord {
285
286
  }
286
287
  return this._orders;
287
288
  }
289
+ /**
290
+ * Access linked Reward records
291
+ * @remarks Available labels: OrderReferralCashbackReward
292
+ * @throws Error if called on a new (unsaved) record
293
+ *
294
+ * @example
295
+ * ```typescript
296
+ * // Get all linked Reward records
297
+ * const items = await record.rewards.list();
298
+ * const first = await record.rewards.first();
299
+ *
300
+ * // Filter by label
301
+ * const specific = await record.rewards.first({ label: 'OrderReferralCashbackReward' });
302
+ * ```
303
+ */
304
+ get rewards() {
305
+ var _a;
306
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
307
+ throw new Error('Cannot access links on a new (unsaved) record');
308
+ if (!this._rewards) {
309
+ this._rewards = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
310
+ sourceEntity: 'CrmModule:Referral',
311
+ targetEntity: 'CrmModule:Reward',
312
+ targetModuleName: 'CrmModule',
313
+ targetEntityName: 'Reward',
314
+ labels: ['OrderReferralCashbackReward'],
315
+ }, RewardRecord_1.RewardRecord);
316
+ }
317
+ return this._rewards;
318
+ }
288
319
  // ============================================
289
320
  // LINK MANAGEMENT
290
321
  // ============================================
@@ -549,6 +580,8 @@ ReferralRecord.affiliateCodesLabels = ['AffiliateCodeReferrals'];
549
580
  ReferralRecord.campaignsLabels = ['CampaignReferrals'];
550
581
  /** Valid labels for Order associations */
551
582
  ReferralRecord.ordersLabels = ['OrderReferral'];
583
+ /** Valid labels for Reward associations */
584
+ ReferralRecord.rewardsLabels = ['OrderReferralCashbackReward'];
552
585
  /** Type guard to check if an object is a ReferralRecord */
553
586
  function isReferralRecord(obj) {
554
587
  return obj instanceof ReferralRecord;