50 lines
851 B
JavaScript
50 lines
851 B
JavaScript
|
module.exports = class EmailDeliveredEvent {
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
email;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
memberId;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
emailId;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {string}
|
||
|
*/
|
||
|
emailRecipientId;
|
||
|
|
||
|
/**
|
||
|
* @readonly
|
||
|
* @type {Date}
|
||
|
*/
|
||
|
timestamp;
|
||
|
|
||
|
/**
|
||
|
* @private
|
||
|
*/
|
||
|
constructor({email, memberId, emailId, emailRecipientId, timestamp}) {
|
||
|
this.email = email;
|
||
|
this.memberId = memberId;
|
||
|
this.emailId = emailId;
|
||
|
this.emailRecipientId = emailRecipientId;
|
||
|
this.timestamp = timestamp;
|
||
|
}
|
||
|
|
||
|
static create(data) {
|
||
|
return new EmailDeliveredEvent({
|
||
|
...data,
|
||
|
timestamp: data.timestamp || new Date
|
||
|
});
|
||
|
}
|
||
|
};
|