@d19n/youfibre-odin-sdk 2.0.9 → 2.0.10-beta.0

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 CHANGED
@@ -269,7 +269,7 @@ This SDK includes **164** entities across **12** modules.
269
269
  | **Conversation** | Conversation Entity Definition | DEFAULT |
270
270
  | **ConversationFeedback** | ConversationFeedback Entity Definition | DEFAULT |
271
271
  | **CustomerDeviceConfiguration** | CustomerDeviceConfiguration Entity Definition | DEFAULT |
272
- | **Email** | Email Entity Definition | SUPPORT, TRANSACTIONAL |
272
+ | **Email** | Email Entity Definition | REFERRAL, SUPPORT, TRANSACTIONAL |
273
273
  | **EmailSender** | EmailSender Entity Definition | DEFAULT |
274
274
  | **EmailTemplate** | EmailTemplate Entity Definition | DEFAULT |
275
275
  | **Message** | Message Entity Definition | EVENT |
@@ -352,7 +352,7 @@ This SDK includes **164** entities across **12** modules.
352
352
 
353
353
  ## Actions
354
354
 
355
- This SDK includes **559** actions.
355
+ This SDK includes **560** actions.
356
356
 
357
357
  ### Action Types
358
358
 
@@ -1618,6 +1618,7 @@ This SDK includes **559** actions.
1618
1618
  | Action | Type | Event |
1619
1619
  |--------|------|-------|
1620
1620
  | `CreateTransactionalEmail` | CREATE | k1.t-hEOJjsDb.NotificationModule.Email.Create.CreateTransactionalEmail |
1621
+ | `SendOrderReferralRefereePendingEmail` | CREATE | k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail |
1621
1622
  | `SendTlosNinjaCaseEmail` | CREATE | k1.t-hEOJjsDb.NotificationModule.Email.Create.SendTlosNinjaCaseEmail |
1622
1623
  | `UpdateEmail` | UPDATE | k1.t-hEOJjsDb.NotificationModule.Email.Update.UpdateEmail |
1623
1624
  | `UpdateSupportEmail` | UPDATE | k1.t-hEOJjsDb.NotificationModule.Email.Update.UpdateSupportEmail |
@@ -0,0 +1,128 @@
1
+ /**
2
+ * SendOrderReferralRefereePendingEmail Action DTO
3
+ *
4
+ * Order Referral Referee Pending
5
+ *
6
+ * @module NotificationModule
7
+ * @entity Email
8
+ * @entityType REFERRAL
9
+ * @actionKey SendOrderReferralRefereePendingEmail
10
+ * @event k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail
11
+ *
12
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
13
+ */
14
+ import { OdinRecordCreateDto, OdinRecordCreatedEvent } from '@d19n/odin-types/dist/core';
15
+ /**
16
+ * RabbitMQ message payload for SendOrderReferralRefereePendingEmail created events
17
+ *
18
+ * @event k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail
19
+ */
20
+ export interface SendOrderReferralRefereePendingEmailMessage extends OdinRecordCreatedEvent<SendOrderReferralRefereePendingEmailDto, SendOrderReferralRefereePendingEmailProperties> {
21
+ }
22
+ /**
23
+ * Properties for SendOrderReferralRefereePendingEmail action
24
+ *
25
+ * @property Required fields: 0
26
+ * @property Optional fields: 9
27
+ */
28
+ export interface SendOrderReferralRefereePendingEmailProperties {
29
+ /**
30
+ * TemplateLabel
31
+ *
32
+ * The template label from email templates engine
33
+ * @type {TEXT}
34
+ */
35
+ TemplateLabel?: string | null;
36
+ /**
37
+ * DynamicData
38
+ *
39
+ * Data will pass to emailing service (variables)
40
+ * @type {JSON}
41
+ */
42
+ DynamicData?: string | null;
43
+ /**
44
+ * ContactId
45
+ *
46
+ * The related Contact to send the email
47
+ * @type {LOOKUP}
48
+ */
49
+ ContactId?: string | null;
50
+ /**
51
+ * To
52
+ *
53
+ * Data field for Email records. Used by Communications team.
54
+ * @type {TEXT}
55
+ */
56
+ To?: string | null;
57
+ /**
58
+ * Subject
59
+ *
60
+ * Data field for Email records. Used by Communications team.
61
+ * @type {TEXT}
62
+ */
63
+ Subject?: string | null;
64
+ /**
65
+ * MessageId
66
+ *
67
+ * SMTP Message Id (Communications - Email)
68
+ * @type {TEXT}
69
+ */
70
+ MessageId?: string | null;
71
+ /**
72
+ * Email Sender
73
+ *
74
+ * The Email Sender related entity
75
+ * @type {LOOKUP}
76
+ */
77
+ EmailSenderId?: string | null;
78
+ /**
79
+ * Date
80
+ *
81
+ * Date field for Email records. Used by Communications team.
82
+ * @type {DATE_TIME}
83
+ */
84
+ Date?: string | null;
85
+ /**
86
+ * Referral Id
87
+ *
88
+ * Reference to referral
89
+ * @type {LOOKUP}
90
+ */
91
+ ReferralId?: string | null;
92
+ }
93
+ /**
94
+ * SendOrderReferralRefereePendingEmail
95
+ *
96
+ * Order Referral Referee Pending
97
+ *
98
+ * @actionType CREATE - Creates a new Email record
99
+ * @module NotificationModule
100
+ * @entity Email
101
+ * @entityType REFERRAL (REFERRAL)
102
+ * @event k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail
103
+ * @permission schema.action.sendorderreferralrefereependingemail.trigger
104
+ * @benchmark This action is tracked for performance benchmarks
105
+ */
106
+ export declare class SendOrderReferralRefereePendingEmailDto extends OdinRecordCreateDto<SendOrderReferralRefereePendingEmailProperties> {
107
+ /** Used by SDK generators to identify action type */
108
+ static readonly ACTION_TYPE = "CREATE";
109
+ static readonly ACTION_KEY = "SendOrderReferralRefereePendingEmail";
110
+ static readonly MODULE_NAME = "NotificationModule";
111
+ static readonly ENTITIES: string[];
112
+ static readonly ENTITY_TYPE = "REFERRAL";
113
+ static readonly EVENT_NAME = "k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail";
114
+ static readonly PERMISSION = "schema.action.sendorderreferralrefereependingemail.trigger";
115
+ /** Step metadata - entity this action targets */
116
+ static readonly STEP_ENTITY = "NotificationModule:Email";
117
+ static readonly STEP_SCHEMA_ID = "a3b4d6b7-0647-4202-90a6-036e3c87c5ae";
118
+ static readonly STEP_SCHEMA_ACTION_ID = "a103026a-b665-4927-9eea-c1a222f1a4dd";
119
+ static readonly STEP_SCHEMA_TYPE_ID = "d9d0bf79-8d32-4f71-a6d7-3ce74dd5ba16";
120
+ static readonly STEP_TYPE = "REFERRAL";
121
+ static readonly AUTO_LINK_PARENT = true;
122
+ readonly actionName: string;
123
+ readonly schemaActionId: string;
124
+ readonly entity: string;
125
+ constructor(properties: SendOrderReferralRefereePendingEmailProperties, options?: {
126
+ journeyId?: string;
127
+ });
128
+ }
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ /**
3
+ * SendOrderReferralRefereePendingEmail Action DTO
4
+ *
5
+ * Order Referral Referee Pending
6
+ *
7
+ * @module NotificationModule
8
+ * @entity Email
9
+ * @entityType REFERRAL
10
+ * @actionKey SendOrderReferralRefereePendingEmail
11
+ * @event k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail
12
+ *
13
+ * AUTO-GENERATED - DO NOT EDIT DIRECTLY
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.SendOrderReferralRefereePendingEmailDto = void 0;
17
+ const core_1 = require("@d19n/odin-types/dist/core");
18
+ /**
19
+ * SendOrderReferralRefereePendingEmail
20
+ *
21
+ * Order Referral Referee Pending
22
+ *
23
+ * @actionType CREATE - Creates a new Email record
24
+ * @module NotificationModule
25
+ * @entity Email
26
+ * @entityType REFERRAL (REFERRAL)
27
+ * @event k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail
28
+ * @permission schema.action.sendorderreferralrefereependingemail.trigger
29
+ * @benchmark This action is tracked for performance benchmarks
30
+ */
31
+ class SendOrderReferralRefereePendingEmailDto extends core_1.OdinRecordCreateDto {
32
+ constructor(properties, options) {
33
+ super({
34
+ entity: 'NotificationModule:Email',
35
+ type: 'REFERRAL',
36
+ properties,
37
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
38
+ });
39
+ this.actionName = 'SendOrderReferralRefereePendingEmail';
40
+ this.schemaActionId = 'a103026a-b665-4927-9eea-c1a222f1a4dd';
41
+ this.entity = 'NotificationModule:Email';
42
+ }
43
+ }
44
+ exports.SendOrderReferralRefereePendingEmailDto = SendOrderReferralRefereePendingEmailDto;
45
+ /** Used by SDK generators to identify action type */
46
+ SendOrderReferralRefereePendingEmailDto.ACTION_TYPE = 'CREATE';
47
+ SendOrderReferralRefereePendingEmailDto.ACTION_KEY = 'SendOrderReferralRefereePendingEmail';
48
+ SendOrderReferralRefereePendingEmailDto.MODULE_NAME = 'NotificationModule';
49
+ SendOrderReferralRefereePendingEmailDto.ENTITIES = ['Email'];
50
+ SendOrderReferralRefereePendingEmailDto.ENTITY_TYPE = 'REFERRAL';
51
+ SendOrderReferralRefereePendingEmailDto.EVENT_NAME = 'k1.t-t-hEOJjsDb.NotificationModule.Email.Create.SendOrderReferralRefereePendingEmail';
52
+ SendOrderReferralRefereePendingEmailDto.PERMISSION = 'schema.action.sendorderreferralrefereependingemail.trigger';
53
+ /** Step metadata - entity this action targets */
54
+ SendOrderReferralRefereePendingEmailDto.STEP_ENTITY = 'NotificationModule:Email';
55
+ SendOrderReferralRefereePendingEmailDto.STEP_SCHEMA_ID = 'a3b4d6b7-0647-4202-90a6-036e3c87c5ae';
56
+ SendOrderReferralRefereePendingEmailDto.STEP_SCHEMA_ACTION_ID = 'a103026a-b665-4927-9eea-c1a222f1a4dd';
57
+ SendOrderReferralRefereePendingEmailDto.STEP_SCHEMA_TYPE_ID = 'd9d0bf79-8d32-4f71-a6d7-3ce74dd5ba16';
58
+ SendOrderReferralRefereePendingEmailDto.STEP_TYPE = 'REFERRAL';
59
+ SendOrderReferralRefereePendingEmailDto.AUTO_LINK_PARENT = true;
@@ -24,6 +24,7 @@ export declare class EmailApi extends ApiProvider {
24
24
  private _contact?;
25
25
  private _emailsender?;
26
26
  private _workorder?;
27
+ private _referral?;
27
28
  constructor(authParams?: OauthParams, authToken?: string);
28
29
  get user(): ApiRecordLinkManager;
29
30
  get email(): ApiRecordLinkManager;
@@ -32,6 +33,7 @@ export declare class EmailApi extends ApiProvider {
32
33
  get contact(): ApiRecordLinkManager;
33
34
  get emailsender(): ApiRecordLinkManager;
34
35
  get workorder(): ApiRecordLinkManager;
36
+ get referral(): ApiRecordLinkManager;
35
37
  setRecord(sourceRecord: any): void;
36
38
  schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
37
39
  search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<EmailProperties>>>;
@@ -75,6 +75,12 @@ class EmailApi extends api_provider_1.ApiProvider {
75
75
  }
76
76
  return this._workorder;
77
77
  }
78
+ get referral() {
79
+ if (!this._referral) {
80
+ this._referral = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'NotificationModule:Email', 'CrmModule:Referral', 'Referral__Email');
81
+ }
82
+ return this._referral;
83
+ }
78
84
  // ============================================
79
85
  // STANDARD METHODS (Unchanged API)
80
86
  // ============================================
@@ -23,6 +23,7 @@ export declare class ReferralApi extends ApiProvider {
23
23
  private _campaign?;
24
24
  private _order?;
25
25
  private _reward?;
26
+ private _email?;
26
27
  constructor(authParams?: OauthParams, authToken?: string);
27
28
  get referrerreferrals(): ApiRecordLinkManager;
28
29
  get refereereferrals(): ApiRecordLinkManager;
@@ -30,6 +31,7 @@ export declare class ReferralApi extends ApiProvider {
30
31
  get campaign(): ApiRecordLinkManager;
31
32
  get order(): ApiRecordLinkManager;
32
33
  get reward(): ApiRecordLinkManager;
34
+ get email(): ApiRecordLinkManager;
33
35
  setRecord(sourceRecord: any): void;
34
36
  schema(): Promise<import("@d19n/odin-types/dist/core").OdinSchema>;
35
37
  search(params: Partial<OdinSearchV2>): Promise<import("@d19n/odin-sdk-generator/dist/odin-sdk-types").OdinSearchResponse<import("@d19n/odin-types/dist/core").OdinRecord<ReferralProperties>>>;
@@ -69,6 +69,12 @@ class ReferralApi extends api_provider_1.ApiProvider {
69
69
  }
70
70
  return this._reward;
71
71
  }
72
+ get email() {
73
+ if (!this._email) {
74
+ this._email = new api_record_link_manager_1.ApiRecordLinkManager(this.authParams, 'CrmModule:Referral', 'NotificationModule:Email', 'Referral__Email');
75
+ }
76
+ return this._email;
77
+ }
72
78
  // ============================================
73
79
  // STANDARD METHODS (Unchanged API)
74
80
  // ============================================
@@ -28,6 +28,7 @@ export declare class EmailDb extends DbProvider {
28
28
  private _contact?;
29
29
  private _emailsender?;
30
30
  private _workorder?;
31
+ private _referral?;
31
32
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
32
33
  get user(): DbRecordLinkManager;
33
34
  get email(): DbRecordLinkManager;
@@ -36,6 +37,7 @@ export declare class EmailDb extends DbProvider {
36
37
  get contact(): DbRecordLinkManager;
37
38
  get emailsender(): DbRecordLinkManager;
38
39
  get workorder(): DbRecordLinkManager;
40
+ get referral(): DbRecordLinkManager;
39
41
  setRecord(sourceRecord: any): void;
40
42
  /**
41
43
  * Search records with manual pagination control
@@ -80,6 +80,12 @@ class EmailDb extends db_provider_1.DbProvider {
80
80
  }
81
81
  return this._workorder;
82
82
  }
83
+ get referral() {
84
+ if (!this._referral) {
85
+ this._referral = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'NotificationModule:Email', 'CrmModule:Referral', 'Referral__Email');
86
+ }
87
+ return this._referral;
88
+ }
83
89
  // ============================================
84
90
  // STANDARD METHODS
85
91
  // ============================================
@@ -27,6 +27,7 @@ export declare class ReferralDb extends DbProvider {
27
27
  private _campaign?;
28
28
  private _order?;
29
29
  private _reward?;
30
+ private _email?;
30
31
  constructor(principal: any, dbService: any, defaultOptions?: DbProviderOptions);
31
32
  get referrerreferrals(): DbRecordLinkManager;
32
33
  get refereereferrals(): DbRecordLinkManager;
@@ -34,6 +35,7 @@ export declare class ReferralDb extends DbProvider {
34
35
  get campaign(): DbRecordLinkManager;
35
36
  get order(): DbRecordLinkManager;
36
37
  get reward(): DbRecordLinkManager;
38
+ get email(): DbRecordLinkManager;
37
39
  setRecord(sourceRecord: any): void;
38
40
  /**
39
41
  * Search records with manual pagination control
@@ -74,6 +74,12 @@ class ReferralDb extends db_provider_1.DbProvider {
74
74
  }
75
75
  return this._reward;
76
76
  }
77
+ get email() {
78
+ if (!this._email) {
79
+ this._email = new db_record_link_manager_1.DbRecordLinkManager(this.principal, this.dbService, 'CrmModule:Referral', 'NotificationModule:Email', 'Referral__Email');
80
+ }
81
+ return this._email;
82
+ }
77
83
  // ============================================
78
84
  // STANDARD METHODS
79
85
  // ============================================
@@ -17,12 +17,15 @@ import { CaseProperties } from './Case';
17
17
  import { ContactProperties } from './Contact';
18
18
  import { EmailSenderProperties } from './EmailSender';
19
19
  import { WorkOrderProperties } from './WorkOrder';
20
+ import { ReferralProperties } from './Referral';
20
21
  /**
21
22
  * Available types for Email records
22
23
  */
23
24
  export declare enum EmailEntityTypes {
24
25
  /** This is the default record type */
25
26
  DEFAULT = "DEFAULT",
27
+ /** Sending emails in the referral system */
28
+ REFERRAL = "REFERRAL",
26
29
  /** Support */
27
30
  SUPPORT = "SUPPORT",
28
31
  /** This type is used to create entities for transactional emails */
@@ -114,6 +117,8 @@ export declare enum EmailPropertyKeys {
114
117
  Bcc = "Bcc",
115
118
  /** Date field for Email records. Used by Communications team. */
116
119
  Date = "Date",
120
+ /** Reference to referral */
121
+ ReferralId = "ReferralId",
117
122
  /** Sender Type (Communications - Email) */
118
123
  SenderType = "SenderType",
119
124
  /** Data field for Email records. Used by Communications team. */
@@ -219,6 +224,153 @@ export interface EmailProperties {
219
224
  * @type {DATE_TIME}
220
225
  */
221
226
  Date: string;
227
+ /** Reference to referral
228
+ *
229
+ * @type {LOOKUP}
230
+ */
231
+ ReferralId: string;
232
+ /** Sender Type (Communications - Email)
233
+ *
234
+ * @type {ENUM}
235
+ * @default CUSTOMER
236
+ * @enum {EmailSenderType}
237
+ */
238
+ SenderType: EmailSenderType;
239
+ /** Data field for Email records. Used by Communications team.
240
+ *
241
+ * @type {LOOKUP}
242
+ */
243
+ Case: string;
244
+ /** Status of the email in the process
245
+ *
246
+ * @type {ENUM}
247
+ * @default CREATED
248
+ * @enum {EmailStatus}
249
+ */
250
+ Status: EmailStatus;
251
+ /** Data will pass to emailing service (variables)
252
+ *
253
+ * @type {JSON}
254
+ */
255
+ DynamicData: string;
256
+ /** The template label from email templates engine
257
+ *
258
+ * @type {TEXT}
259
+ */
260
+ TemplateLabel: string;
261
+ /** The related Contact to send the email
262
+ *
263
+ * @type {LOOKUP}
264
+ */
265
+ ContactId: string;
266
+ /** The provider we use to send email (eg. Sendgrid)
267
+ *
268
+ * @type {ENUM}
269
+ * @enum {EmailEmailingService}
270
+ */
271
+ EmailingService: EmailEmailingService;
272
+ /** The Email Sender related entity
273
+ *
274
+ * @type {LOOKUP}
275
+ */
276
+ EmailSenderId: string;
277
+ /** WorkOrder
278
+ *
279
+ * @type {LOOKUP}
280
+ */
281
+ WorkOrder: string;
282
+ }
283
+ /**
284
+ * Properties for REFERRAL Email records
285
+ *
286
+ * @see NotificationModule:Email
287
+ */
288
+ export interface ReferralEmailProperties {
289
+ /** Used for title
290
+ *
291
+ * @type {TEXT}
292
+ */
293
+ Title: string;
294
+ /** Data field for Email records. Used by Communications team.
295
+ *
296
+ * @type {TEXT}
297
+ */
298
+ Subject: string;
299
+ /** Formatted Message (Communications - Email)
300
+ *
301
+ * @type {HTML}
302
+ */
303
+ FormattedMessage: string;
304
+ /** Carbon Copy (Communications - Email)
305
+ *
306
+ * @type {TEXT}
307
+ */
308
+ Cc: string;
309
+ /** Data field for Email records. Used by Communications team.
310
+ *
311
+ * @type {TEXT}
312
+ */
313
+ To: string;
314
+ /** In Reply To (Communications - Email)
315
+ *
316
+ * @type {TEXT}
317
+ */
318
+ InReplyTo: string;
319
+ /** Data field for Email records. Used by Communications team.
320
+ *
321
+ * @type {JSON}
322
+ */
323
+ Envelope: string;
324
+ /** When the email was created (Communications - Email)
325
+ *
326
+ * @type {DATE_TIME}
327
+ */
328
+ CreatedAt: string;
329
+ /** Parent Message id (Communications - Email)
330
+ *
331
+ * @type {LOOKUP}
332
+ */
333
+ ParentMessageId: string;
334
+ /** Data field for Email records. Used by Communications team.
335
+ *
336
+ * @type {TEXT}
337
+ */
338
+ Message: string;
339
+ /** Data field for Email records. Used by Communications team.
340
+ *
341
+ * @type {TEXT}
342
+ */
343
+ From: string;
344
+ /** email attachments (Communications - Email)
345
+ *
346
+ * @type {FILE_MULTIPLE}
347
+ */
348
+ Files: string;
349
+ /** SMTP Message Id (Communications - Email)
350
+ *
351
+ * @type {TEXT}
352
+ */
353
+ MessageId: string;
354
+ /** When the email was updated (Communications - Email)
355
+ *
356
+ * @type {DATE_TIME}
357
+ */
358
+ UpdatedAt: string;
359
+ /** Blind Carbon Copy (Communications - Email)
360
+ *
361
+ * @type {TEXT}
362
+ */
363
+ Bcc: string;
364
+ /** Date field for Email records. Used by Communications team.
365
+ *
366
+ * @type {DATE_TIME}
367
+ */
368
+ Date: string;
369
+ /** Reference to referral
370
+ *
371
+ * @type {LOOKUP}
372
+ */
373
+ ReferralId: string;
222
374
  /** Sender Type (Communications - Email)
223
375
  *
224
376
  * @type {ENUM}
@@ -356,6 +508,11 @@ export interface SupportEmailProperties {
356
508
  * @type {DATE_TIME}
357
509
  */
358
510
  Date: string;
511
+ /** Reference to referral
512
+ *
513
+ * @type {LOOKUP}
514
+ */
515
+ ReferralId: string;
359
516
  /** Sender Type (Communications - Email)
360
517
  *
361
518
  * @type {ENUM}
@@ -493,6 +650,11 @@ export interface TransactionalEmailProperties {
493
650
  * @type {DATE_TIME}
494
651
  */
495
652
  Date: string;
653
+ /** Reference to referral
654
+ *
655
+ * @type {LOOKUP}
656
+ */
657
+ ReferralId: string;
496
658
  /** Sender Type (Communications - Email)
497
659
  *
498
660
  * @type {ENUM}
@@ -573,6 +735,8 @@ export declare class Email extends OdinRecord<EmailProperties> {
573
735
  EmailSender: OdinLink<LinkedOdinRecord<EmailSenderProperties>>;
574
736
  /** Linked WorkOrder records (WorkOrder__Email) */
575
737
  WorkOrder: OdinLink<LinkedOdinRecord<WorkOrderProperties>>;
738
+ /** Linked Referral records (Referral__Email) */
739
+ Referral: OdinLink<LinkedOdinRecord<ReferralProperties>>;
576
740
  }
577
741
  /**
578
742
  * RabbitMQ routing keys for Email events
@@ -590,6 +754,12 @@ export declare const ROUTING_KEY_EMAIL_DEFAULT_CREATED = "NotificationModule.Ema
590
754
  export declare const ROUTING_KEY_EMAIL_DEFAULT_UPDATED = "NotificationModule.Email.DEFAULT.SubDbRecordUpdated";
591
755
  /** This is the default record type deleted */
592
756
  export declare const ROUTING_KEY_EMAIL_DEFAULT_DELETED = "NotificationModule.Email.DEFAULT.SubDbRecordDeleted";
757
+ /** Sending emails in the referral system created */
758
+ export declare const ROUTING_KEY_EMAIL_REFERRAL_CREATED = "NotificationModule.Email.REFERRAL.SubDbRecordCreated";
759
+ /** Sending emails in the referral system updated */
760
+ export declare const ROUTING_KEY_EMAIL_REFERRAL_UPDATED = "NotificationModule.Email.REFERRAL.SubDbRecordUpdated";
761
+ /** Sending emails in the referral system deleted */
762
+ export declare const ROUTING_KEY_EMAIL_REFERRAL_DELETED = "NotificationModule.Email.REFERRAL.SubDbRecordDeleted";
593
763
  /** Support created */
594
764
  export declare const ROUTING_KEY_EMAIL_SUPPORT_CREATED = "NotificationModule.Email.SUPPORT.SubDbRecordCreated";
595
765
  /** Support updated */
@@ -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_EMAI_EMAIL_SENDER_DELETED = exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_CREATED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_DELETED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_UPDATED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_CREATED = exports.ROUTING_KEY_EMAIL_SUPPORT_DELETED = exports.ROUTING_KEY_EMAIL_SUPPORT_UPDATED = exports.ROUTING_KEY_EMAIL_SUPPORT_CREATED = exports.ROUTING_KEY_EMAIL_DEFAULT_DELETED = exports.ROUTING_KEY_EMAIL_DEFAULT_UPDATED = exports.ROUTING_KEY_EMAIL_DEFAULT_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailEmailingService = exports.EmailStatus = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
15
+ exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_DELETED = exports.ROUTING_KEY_LINK_EMAI_EMAIL_SENDER_CREATED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_DELETED = exports.ROUTING_KEY_LINK_EMAIL_CONTACT_CREATED = exports.ROUTING_KEY_LINK_ATTACHMENTS_DELETED = exports.ROUTING_KEY_LINK_ATTACHMENTS_CREATED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_EMAIL_EMAIL_CREATED = exports.ROUTING_KEY_LINK_EMAIL_USER_DELETED = exports.ROUTING_KEY_LINK_EMAIL_USER_CREATED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_DELETED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_UPDATED = exports.ROUTING_KEY_EMAIL_TRANSACTIONAL_CREATED = exports.ROUTING_KEY_EMAIL_SUPPORT_DELETED = exports.ROUTING_KEY_EMAIL_SUPPORT_UPDATED = exports.ROUTING_KEY_EMAIL_SUPPORT_CREATED = exports.ROUTING_KEY_EMAIL_REFERRAL_DELETED = exports.ROUTING_KEY_EMAIL_REFERRAL_UPDATED = exports.ROUTING_KEY_EMAIL_REFERRAL_CREATED = exports.ROUTING_KEY_EMAIL_DEFAULT_DELETED = exports.ROUTING_KEY_EMAIL_DEFAULT_UPDATED = exports.ROUTING_KEY_EMAIL_DEFAULT_CREATED = exports.ROUTING_KEY_EMAIL_DELETED = exports.ROUTING_KEY_EMAIL_UPDATED = exports.ROUTING_KEY_EMAIL_CREATED = exports.Email = exports.EmailPropertyKeys = exports.EmailEmailingService = exports.EmailStatus = exports.EmailSenderType = exports.EmailEntityTypes = void 0;
16
16
  const core_1 = require("@d19n/odin-types/dist/core");
17
17
  /**
18
18
  * Available types for Email records
@@ -21,6 +21,8 @@ var EmailEntityTypes;
21
21
  (function (EmailEntityTypes) {
22
22
  /** This is the default record type */
23
23
  EmailEntityTypes["DEFAULT"] = "DEFAULT";
24
+ /** Sending emails in the referral system */
25
+ EmailEntityTypes["REFERRAL"] = "REFERRAL";
24
26
  /** Support */
25
27
  EmailEntityTypes["SUPPORT"] = "SUPPORT";
26
28
  /** This type is used to create entities for transactional emails */
@@ -116,6 +118,8 @@ var EmailPropertyKeys;
116
118
  EmailPropertyKeys["Bcc"] = "Bcc";
117
119
  /** Date field for Email records. Used by Communications team. */
118
120
  EmailPropertyKeys["Date"] = "Date";
121
+ /** Reference to referral */
122
+ EmailPropertyKeys["ReferralId"] = "ReferralId";
119
123
  /** Sender Type (Communications - Email) */
120
124
  EmailPropertyKeys["SenderType"] = "SenderType";
121
125
  /** Data field for Email records. Used by Communications team. */
@@ -167,6 +171,12 @@ exports.ROUTING_KEY_EMAIL_DEFAULT_CREATED = 'NotificationModule.Email.DEFAULT.Su
167
171
  exports.ROUTING_KEY_EMAIL_DEFAULT_UPDATED = 'NotificationModule.Email.DEFAULT.SubDbRecordUpdated';
168
172
  /** This is the default record type deleted */
169
173
  exports.ROUTING_KEY_EMAIL_DEFAULT_DELETED = 'NotificationModule.Email.DEFAULT.SubDbRecordDeleted';
174
+ /** Sending emails in the referral system created */
175
+ exports.ROUTING_KEY_EMAIL_REFERRAL_CREATED = 'NotificationModule.Email.REFERRAL.SubDbRecordCreated';
176
+ /** Sending emails in the referral system updated */
177
+ exports.ROUTING_KEY_EMAIL_REFERRAL_UPDATED = 'NotificationModule.Email.REFERRAL.SubDbRecordUpdated';
178
+ /** Sending emails in the referral system deleted */
179
+ exports.ROUTING_KEY_EMAIL_REFERRAL_DELETED = 'NotificationModule.Email.REFERRAL.SubDbRecordDeleted';
170
180
  /** Support created */
171
181
  exports.ROUTING_KEY_EMAIL_SUPPORT_CREATED = 'NotificationModule.Email.SUPPORT.SubDbRecordCreated';
172
182
  /** Support updated */
@@ -309,6 +309,8 @@ export declare enum ProductContractType {
309
309
  * Use these constants instead of string literals for type safety
310
310
  */
311
311
  export declare enum ProductPropertyKeys {
312
+ /** External Reference ID */
313
+ ExternalRef = "ExternalRef",
312
314
  /** suggested price to sell a single product (Product Management - Product) */
313
315
  UnitPrice = "UnitPrice",
314
316
  /** promo label pricing box down (Product Management - Product) */
@@ -416,6 +418,11 @@ export declare enum ProductPropertyKeys {
416
418
  * @see ProductModule:Product
417
419
  */
418
420
  export interface ProductProperties {
421
+ /** External Reference ID
422
+ *
423
+ * @type {TEXT}
424
+ */
425
+ ExternalRef: string;
419
426
  /** suggested price to sell a single product (Product Management - Product)
420
427
  *
421
428
  * @type {CURRENCY}
@@ -728,6 +735,11 @@ export interface ProductProperties {
728
735
  * @see ProductModule:Product
729
736
  */
730
737
  export interface BundleProductProperties {
738
+ /** External Reference ID
739
+ *
740
+ * @type {TEXT}
741
+ */
742
+ ExternalRef: string;
731
743
  /** suggested price to sell a single product (Product Management - Product)
732
744
  *
733
745
  * @type {CURRENCY}
@@ -1040,6 +1052,11 @@ export interface BundleProductProperties {
1040
1052
  * @see ProductModule:Product
1041
1053
  */
1042
1054
  export interface InternetProductProperties {
1055
+ /** External Reference ID
1056
+ *
1057
+ * @type {TEXT}
1058
+ */
1059
+ ExternalRef: string;
1043
1060
  /** suggested price to sell a single product (Product Management - Product)
1044
1061
  *
1045
1062
  * @type {CURRENCY}
@@ -1352,6 +1369,11 @@ export interface InternetProductProperties {
1352
1369
  * @see ProductModule:Product
1353
1370
  */
1354
1371
  export interface LaborProductProperties {
1372
+ /** External Reference ID
1373
+ *
1374
+ * @type {TEXT}
1375
+ */
1376
+ ExternalRef: string;
1355
1377
  /** suggested price to sell a single product (Product Management - Product)
1356
1378
  *
1357
1379
  * @type {CURRENCY}
@@ -1664,6 +1686,11 @@ export interface LaborProductProperties {
1664
1686
  * @see ProductModule:Product
1665
1687
  */
1666
1688
  export interface LandlineProductProperties {
1689
+ /** External Reference ID
1690
+ *
1691
+ * @type {TEXT}
1692
+ */
1693
+ ExternalRef: string;
1667
1694
  /** suggested price to sell a single product (Product Management - Product)
1668
1695
  *
1669
1696
  * @type {CURRENCY}
@@ -1976,6 +2003,11 @@ export interface LandlineProductProperties {
1976
2003
  * @see ProductModule:Product
1977
2004
  */
1978
2005
  export interface MeshProductProperties {
2006
+ /** External Reference ID
2007
+ *
2008
+ * @type {TEXT}
2009
+ */
2010
+ ExternalRef: string;
1979
2011
  /** suggested price to sell a single product (Product Management - Product)
1980
2012
  *
1981
2013
  * @type {CURRENCY}
@@ -2288,6 +2320,11 @@ export interface MeshProductProperties {
2288
2320
  * @see ProductModule:Product
2289
2321
  */
2290
2322
  export interface MobileProductProperties {
2323
+ /** External Reference ID
2324
+ *
2325
+ * @type {TEXT}
2326
+ */
2327
+ ExternalRef: string;
2291
2328
  /** suggested price to sell a single product (Product Management - Product)
2292
2329
  *
2293
2330
  * @type {CURRENCY}
@@ -2600,6 +2637,11 @@ export interface MobileProductProperties {
2600
2637
  * @see ProductModule:Product
2601
2638
  */
2602
2639
  export interface TelevisionProductProperties {
2640
+ /** External Reference ID
2641
+ *
2642
+ * @type {TEXT}
2643
+ */
2644
+ ExternalRef: string;
2603
2645
  /** suggested price to sell a single product (Product Management - Product)
2604
2646
  *
2605
2647
  * @type {CURRENCY}
@@ -323,6 +323,8 @@ var ProductContractType;
323
323
  */
324
324
  var ProductPropertyKeys;
325
325
  (function (ProductPropertyKeys) {
326
+ /** External Reference ID */
327
+ ProductPropertyKeys["ExternalRef"] = "ExternalRef";
326
328
  /** suggested price to sell a single product (Product Management - Product) */
327
329
  ProductPropertyKeys["UnitPrice"] = "UnitPrice";
328
330
  /** promo label pricing box down (Product Management - Product) */
@@ -16,6 +16,7 @@ import { AffiliateCodeProperties } from './AffiliateCode';
16
16
  import { CampaignProperties } from './Campaign';
17
17
  import { OrderProperties } from './Order';
18
18
  import { RewardProperties } from './Reward';
19
+ import { EmailProperties } from './Email';
19
20
  /**
20
21
  * Available types for Referral records
21
22
  */
@@ -170,6 +171,8 @@ export declare class Referral extends OdinRecord<ReferralProperties> {
170
171
  Order: OdinLink<LinkedOdinRecord<OrderProperties>>;
171
172
  /** Linked Reward records (OrderReferralCashbackReward) */
172
173
  Reward: OdinLink<LinkedOdinRecord<RewardProperties>>;
174
+ /** Linked Email records (Referral__Email) */
175
+ Email: OdinLink<LinkedOdinRecord<EmailProperties>>;
173
176
  }
174
177
  /**
175
178
  * RabbitMQ routing keys for Referral events
@@ -191,3 +194,7 @@ export declare const ROUTING_KEY_REFERRAL_ORDER_DELETED = "CrmModule.Referral.OR
191
194
  export declare const ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_CREATED = "CrmModule.Referral.Reward.SubDbRecordAssociationCreated";
192
195
  /** Event: OrderReferralCashbackReward link deleted */
193
196
  export declare const ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_DELETED = "CrmModule.Referral.Reward.SubDbRecordAssociationDeleted";
197
+ /** Event: Referral__Email link created */
198
+ export declare const ROUTING_KEY_LINK_REFERRAL_EMAIL_CREATED = "CrmModule.Referral.Email.SubDbRecordAssociationCreated";
199
+ /** Event: Referral__Email link deleted */
200
+ export declare const ROUTING_KEY_LINK_REFERRAL_EMAIL_DELETED = "CrmModule.Referral.Email.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_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;
15
+ exports.ROUTING_KEY_LINK_REFERRAL_EMAIL_DELETED = exports.ROUTING_KEY_LINK_REFERRAL_EMAIL_CREATED = 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
@@ -119,3 +119,7 @@ exports.ROUTING_KEY_REFERRAL_ORDER_DELETED = 'CrmModule.Referral.ORDER.SubDbReco
119
119
  exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_CREATED = 'CrmModule.Referral.Reward.SubDbRecordAssociationCreated';
120
120
  /** Event: OrderReferralCashbackReward link deleted */
121
121
  exports.ROUTING_KEY_LINK_ORDER_REFERRAL_CASHBACK_REWARD_DELETED = 'CrmModule.Referral.Reward.SubDbRecordAssociationDeleted';
122
+ /** Event: Referral__Email link created */
123
+ exports.ROUTING_KEY_LINK_REFERRAL_EMAIL_CREATED = 'CrmModule.Referral.Email.SubDbRecordAssociationCreated';
124
+ /** Event: Referral__Email link deleted */
125
+ exports.ROUTING_KEY_LINK_REFERRAL_EMAIL_DELETED = 'CrmModule.Referral.Email.SubDbRecordAssociationDeleted';
@@ -13,7 +13,7 @@
13
13
  * await record.createEmail({ ... }).execute();
14
14
  * ```
15
15
  *
16
- * Entity Types: DEFAULT, SUPPORT, TRANSACTIONAL
16
+ * Entity Types: DEFAULT, REFERRAL, SUPPORT, TRANSACTIONAL
17
17
  *
18
18
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
19
19
  */
@@ -22,8 +22,9 @@ import { PipelineStageEntity } from '@d19n/odin-types/dist/core';
22
22
  import { IDbRecordCreateUpdateRes } from '@d19n/odin-types/dist/core/interfaces/v1.db.interfaces';
23
23
  import { IOdinProvider } from '@d19n/odin-sdk-generator/dist/odin-sdk-types';
24
24
  import { RecordLinkManager } from '@d19n/odin-sdk-generator/dist/record-link-manager';
25
- import { EmailProperties, SupportEmailProperties, TransactionalEmailProperties } from '../entities-v2/Email';
25
+ import { EmailProperties, ReferralEmailProperties, SupportEmailProperties, TransactionalEmailProperties } from '../entities-v2/Email';
26
26
  import { CreateTransactionalEmailProperties } from '../actions-v2/CreateTransactionalEmailDto';
27
+ import { SendOrderReferralRefereePendingEmailProperties } from '../actions-v2/SendOrderReferralRefereePendingEmailDto';
27
28
  import { SendTlosNinjaCaseEmailProperties } from '../actions-v2/SendTlosNinjaCaseEmailDto';
28
29
  import { UpdateEmailProperties } from '../actions-v2/UpdateEmailDto';
29
30
  import { UpdateSupportEmailProperties } from '../actions-v2/UpdateSupportEmailDto';
@@ -33,8 +34,9 @@ import { CaseRecord } from './CaseRecord';
33
34
  import { ContactRecord } from './ContactRecord';
34
35
  import { EmailSenderRecord } from './EmailSenderRecord';
35
36
  import { WorkOrderRecord } from './WorkOrderRecord';
37
+ import { ReferralRecord } from './ReferralRecord';
36
38
  /** Valid entity types for Email */
37
- export declare type EmailType = 'DEFAULT' | 'SUPPORT' | 'TRANSACTIONAL';
39
+ export declare type EmailType = 'DEFAULT' | 'REFERRAL' | 'SUPPORT' | 'TRANSACTIONAL';
38
40
  /**
39
41
  * Builder for action execution with dryRun support
40
42
  *
@@ -105,6 +107,7 @@ export declare class EmailRecord<TProps = EmailProperties> {
105
107
  private _contacts?;
106
108
  private _emailSenders?;
107
109
  private _workOrders?;
110
+ private _referrals?;
108
111
  /**
109
112
  * Create a record wrapper.
110
113
  * @param record - The underlying record, or null for create operations
@@ -146,6 +149,22 @@ export declare class EmailRecord<TProps = EmailProperties> {
146
149
  * @remarks This is the default record type
147
150
  */
148
151
  isDefault(): this is EmailRecord<EmailProperties>;
152
+ /**
153
+ * Type guard: check if this record is of type REFERRAL
154
+ *
155
+ * When this returns true, TypeScript automatically narrows the type,
156
+ * giving you access to REFERRAL-specific properties.
157
+ *
158
+ * @example
159
+ * ```typescript
160
+ * if (record.isReferral()) {
161
+ * // TypeScript knows record.properties is ReferralEmailProperties
162
+ * console.log(record.properties.SomeTypeSpecificField);
163
+ * }
164
+ * ```
165
+ * @remarks Sending emails in the referral system
166
+ */
167
+ isReferral(): this is EmailRecord<ReferralEmailProperties>;
149
168
  /**
150
169
  * Type guard: check if this record is of type SUPPORT
151
170
  *
@@ -304,6 +323,24 @@ export declare class EmailRecord<TProps = EmailProperties> {
304
323
  * ```
305
324
  */
306
325
  get workOrders(): RecordLinkManager<WorkOrderRecord, typeof EmailRecord['workOrdersLabels'][number]>;
326
+ /** Valid labels for Referral associations */
327
+ static readonly referralsLabels: readonly ["Referral__Email"];
328
+ /**
329
+ * Access linked Referral records
330
+ * @remarks Available labels: Referral__Email
331
+ * @throws Error if called on a new (unsaved) record
332
+ *
333
+ * @example
334
+ * ```typescript
335
+ * // Get all linked Referral records
336
+ * const items = await record.referrals.list();
337
+ * const first = await record.referrals.first();
338
+ *
339
+ * // Filter by label
340
+ * const specific = await record.referrals.first({ label: 'Referral__Email' });
341
+ * ```
342
+ */
343
+ get referrals(): RecordLinkManager<ReferralRecord, typeof EmailRecord['referralsLabels'][number]>;
307
344
  /**
308
345
  * Queue a link to be created with the next action.
309
346
  * Works for both create and update actions.
@@ -353,6 +390,34 @@ export declare class EmailRecord<TProps = EmailProperties> {
353
390
  journeyId?: string;
354
391
  stageKey?: string;
355
392
  }): ActionBuilder;
393
+ /**
394
+ * SendOrderReferralRefereePendingEmail
395
+ *
396
+ * Creates a new Email record with the specified properties.
397
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
398
+ *
399
+ * @remarks Record type: REFERRAL
400
+ *
401
+ * @param properties - The properties for the new record
402
+ * @param options - Optional settings
403
+ * @param options.journeyId - Associate with a journey
404
+ * @param options.stageKey - Set initial pipeline stage
405
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
406
+ *
407
+ * @example
408
+ * ```typescript
409
+ * // Create with properties
410
+ * const record = odinClient.emails.new();
411
+ * await record.sendOrderReferralRefereePendingEmail({ ... }).execute();
412
+ *
413
+ * // Dry run (for debugging)
414
+ * const payload = record.sendOrderReferralRefereePendingEmail({ ... }).dryRun();
415
+ * ```
416
+ */
417
+ sendOrderReferralRefereePendingEmail(properties?: SendOrderReferralRefereePendingEmailProperties, options?: {
418
+ journeyId?: string;
419
+ stageKey?: string;
420
+ }): ActionBuilder;
356
421
  /**
357
422
  * SendTlosNinjaCaseEmail
358
423
  *
@@ -14,7 +14,7 @@
14
14
  * await record.createEmail({ ... }).execute();
15
15
  * ```
16
16
  *
17
- * Entity Types: DEFAULT, SUPPORT, TRANSACTIONAL
17
+ * Entity Types: DEFAULT, REFERRAL, SUPPORT, TRANSACTIONAL
18
18
  *
19
19
  * AUTO-GENERATED - DO NOT EDIT DIRECTLY
20
20
  */
@@ -38,6 +38,7 @@ const CaseRecord_1 = require("./CaseRecord");
38
38
  const ContactRecord_1 = require("./ContactRecord");
39
39
  const EmailSenderRecord_1 = require("./EmailSenderRecord");
40
40
  const WorkOrderRecord_1 = require("./WorkOrderRecord");
41
+ const ReferralRecord_1 = require("./ReferralRecord");
41
42
  /**
42
43
  * Builder for action execution with dryRun support
43
44
  *
@@ -167,6 +168,22 @@ class EmailRecord {
167
168
  * @remarks This is the default record type
168
169
  */
169
170
  isDefault() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'DEFAULT'; }
171
+ /**
172
+ * Type guard: check if this record is of type REFERRAL
173
+ *
174
+ * When this returns true, TypeScript automatically narrows the type,
175
+ * giving you access to REFERRAL-specific properties.
176
+ *
177
+ * @example
178
+ * ```typescript
179
+ * if (record.isReferral()) {
180
+ * // TypeScript knows record.properties is ReferralEmailProperties
181
+ * console.log(record.properties.SomeTypeSpecificField);
182
+ * }
183
+ * ```
184
+ * @remarks Sending emails in the referral system
185
+ */
186
+ isReferral() { var _a; return ((_a = this._record) === null || _a === void 0 ? void 0 : _a.type) === 'REFERRAL'; }
170
187
  /**
171
188
  * Type guard: check if this record is of type SUPPORT
172
189
  *
@@ -409,6 +426,36 @@ class EmailRecord {
409
426
  }
410
427
  return this._workOrders;
411
428
  }
429
+ /**
430
+ * Access linked Referral records
431
+ * @remarks Available labels: Referral__Email
432
+ * @throws Error if called on a new (unsaved) record
433
+ *
434
+ * @example
435
+ * ```typescript
436
+ * // Get all linked Referral records
437
+ * const items = await record.referrals.list();
438
+ * const first = await record.referrals.first();
439
+ *
440
+ * // Filter by label
441
+ * const specific = await record.referrals.first({ label: 'Referral__Email' });
442
+ * ```
443
+ */
444
+ get referrals() {
445
+ var _a;
446
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
447
+ throw new Error('Cannot access links on a new (unsaved) record');
448
+ if (!this._referrals) {
449
+ this._referrals = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
450
+ sourceEntity: 'NotificationModule:Email',
451
+ targetEntity: 'CrmModule:Referral',
452
+ targetModuleName: 'CrmModule',
453
+ targetEntityName: 'Referral',
454
+ labels: ['Referral__Email'],
455
+ }, ReferralRecord_1.ReferralRecord);
456
+ }
457
+ return this._referrals;
458
+ }
412
459
  // ============================================
413
460
  // LINK MANAGEMENT
414
461
  // ============================================
@@ -483,6 +530,42 @@ class EmailRecord {
483
530
  };
484
531
  return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
485
532
  }
533
+ /**
534
+ * SendOrderReferralRefereePendingEmail
535
+ *
536
+ * Creates a new Email record with the specified properties.
537
+ * Returns an ActionBuilder - call .execute() to create or .dryRun() for debugging.
538
+ *
539
+ * @remarks Record type: REFERRAL
540
+ *
541
+ * @param properties - The properties for the new record
542
+ * @param options - Optional settings
543
+ * @param options.journeyId - Associate with a journey
544
+ * @param options.stageKey - Set initial pipeline stage
545
+ * @returns ActionBuilder - call .execute() to create or .dryRun() for payload
546
+ *
547
+ * @example
548
+ * ```typescript
549
+ * // Create with properties
550
+ * const record = odinClient.emails.new();
551
+ * await record.sendOrderReferralRefereePendingEmail({ ... }).execute();
552
+ *
553
+ * // Dry run (for debugging)
554
+ * const payload = record.sendOrderReferralRefereePendingEmail({ ... }).dryRun();
555
+ * ```
556
+ */
557
+ sendOrderReferralRefereePendingEmail(properties, options) {
558
+ const payload = {
559
+ entity: 'NotificationModule:Email',
560
+ type: 'REFERRAL',
561
+ actionName: 'SendOrderReferralRefereePendingEmail',
562
+ properties: properties || {},
563
+ associations: this._pendingLinks.length > 0 ? this._pendingLinks : undefined,
564
+ journeyId: options === null || options === void 0 ? void 0 : options.journeyId,
565
+ stageKey: options === null || options === void 0 ? void 0 : options.stageKey,
566
+ };
567
+ return new ActionBuilder(this._provider, 'NotificationModule', 'Email', payload, () => { this._pendingLinks = []; });
568
+ }
486
569
  /**
487
570
  * SendTlosNinjaCaseEmail
488
571
  *
@@ -607,6 +690,8 @@ EmailRecord.contactsLabels = ['Email_Contact'];
607
690
  EmailRecord.emailSendersLabels = ['Emai__EmailSender'];
608
691
  /** Valid labels for WorkOrder associations */
609
692
  EmailRecord.workOrdersLabels = ['WorkOrder__Email'];
693
+ /** Valid labels for Referral associations */
694
+ EmailRecord.referralsLabels = ['Referral__Email'];
610
695
  /** Type guard to check if an object is a EmailRecord */
611
696
  function isEmailRecord(obj) {
612
697
  return obj instanceof EmailRecord;
@@ -29,6 +29,7 @@ import { AffiliateCodeRecord } from './AffiliateCodeRecord';
29
29
  import { CampaignRecord } from './CampaignRecord';
30
30
  import { OrderRecord } from './OrderRecord';
31
31
  import { RewardRecord } from './RewardRecord';
32
+ import { EmailRecord } from './EmailRecord';
32
33
  /** Valid entity types for Referral */
33
34
  export declare type ReferralType = 'ORDER';
34
35
  /**
@@ -99,6 +100,7 @@ export declare class ReferralRecord<TProps = ReferralProperties> {
99
100
  private _campaigns?;
100
101
  private _orders?;
101
102
  private _rewards?;
103
+ private _emails?;
102
104
  /**
103
105
  * Create a record wrapper.
104
106
  * @param record - The underlying record, or null for create operations
@@ -230,6 +232,24 @@ export declare class ReferralRecord<TProps = ReferralProperties> {
230
232
  * ```
231
233
  */
232
234
  get rewards(): RecordLinkManager<RewardRecord, typeof ReferralRecord['rewardsLabels'][number]>;
235
+ /** Valid labels for Email associations */
236
+ static readonly emailsLabels: readonly ["Referral__Email"];
237
+ /**
238
+ * Access linked Email records
239
+ * @remarks Available labels: Referral__Email
240
+ * @throws Error if called on a new (unsaved) record
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * // Get all linked Email records
245
+ * const items = await record.emails.list();
246
+ * const first = await record.emails.first();
247
+ *
248
+ * // Filter by label
249
+ * const specific = await record.emails.first({ label: 'Referral__Email' });
250
+ * ```
251
+ */
252
+ get emails(): RecordLinkManager<EmailRecord, typeof ReferralRecord['emailsLabels'][number]>;
233
253
  /**
234
254
  * Queue a link to be created with the next action.
235
255
  * Works for both create and update actions.
@@ -37,6 +37,7 @@ const AffiliateCodeRecord_1 = require("./AffiliateCodeRecord");
37
37
  const CampaignRecord_1 = require("./CampaignRecord");
38
38
  const OrderRecord_1 = require("./OrderRecord");
39
39
  const RewardRecord_1 = require("./RewardRecord");
40
+ const EmailRecord_1 = require("./EmailRecord");
40
41
  /**
41
42
  * Builder for action execution with dryRun support
42
43
  *
@@ -316,6 +317,36 @@ class ReferralRecord {
316
317
  }
317
318
  return this._rewards;
318
319
  }
320
+ /**
321
+ * Access linked Email records
322
+ * @remarks Available labels: Referral__Email
323
+ * @throws Error if called on a new (unsaved) record
324
+ *
325
+ * @example
326
+ * ```typescript
327
+ * // Get all linked Email records
328
+ * const items = await record.emails.list();
329
+ * const first = await record.emails.first();
330
+ *
331
+ * // Filter by label
332
+ * const specific = await record.emails.first({ label: 'Referral__Email' });
333
+ * ```
334
+ */
335
+ get emails() {
336
+ var _a;
337
+ if (!((_a = this._record) === null || _a === void 0 ? void 0 : _a.id))
338
+ throw new Error('Cannot access links on a new (unsaved) record');
339
+ if (!this._emails) {
340
+ this._emails = new record_link_manager_1.RecordLinkManager(this._provider, this._record, {
341
+ sourceEntity: 'CrmModule:Referral',
342
+ targetEntity: 'NotificationModule:Email',
343
+ targetModuleName: 'NotificationModule',
344
+ targetEntityName: 'Email',
345
+ labels: ['Referral__Email'],
346
+ }, EmailRecord_1.EmailRecord);
347
+ }
348
+ return this._emails;
349
+ }
319
350
  // ============================================
320
351
  // LINK MANAGEMENT
321
352
  // ============================================
@@ -582,6 +613,8 @@ ReferralRecord.campaignsLabels = ['CampaignReferrals'];
582
613
  ReferralRecord.ordersLabels = ['OrderReferral'];
583
614
  /** Valid labels for Reward associations */
584
615
  ReferralRecord.rewardsLabels = ['OrderReferralCashbackReward'];
616
+ /** Valid labels for Email associations */
617
+ ReferralRecord.emailsLabels = ['Referral__Email'];
585
618
  /** Type guard to check if an object is a ReferralRecord */
586
619
  function isReferralRecord(obj) {
587
620
  return obj instanceof ReferralRecord;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@d19n/youfibre-odin-sdk",
3
- "version": "2.0.9",
3
+ "version": "2.0.10-beta.0",
4
4
  "description": "",
5
5
  "author": "@d19n",
6
6
  "license": "UNLICENSED",