2022-11-24 09:54:20 +03:00
|
|
|
module.exports = class EmailBouncedEvent {
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
email;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
2022-11-29 13:15:19 +03:00
|
|
|
* @type {string}
|
2022-11-24 09:54:20 +03:00
|
|
|
*/
|
|
|
|
memberId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
2022-11-29 13:15:19 +03:00
|
|
|
* @type {string}
|
2022-11-24 09:54:20 +03:00
|
|
|
*/
|
|
|
|
emailId;
|
|
|
|
|
2022-11-29 13:15:19 +03:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
emailRecipientId;
|
|
|
|
|
2022-11-24 09:54:20 +03:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {Date}
|
|
|
|
*/
|
|
|
|
timestamp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
*/
|
2022-11-29 13:15:19 +03:00
|
|
|
constructor({email, memberId, emailId, emailRecipientId, timestamp}) {
|
2022-11-24 09:54:20 +03:00
|
|
|
this.memberId = memberId;
|
|
|
|
this.emailId = emailId;
|
2022-11-29 13:15:19 +03:00
|
|
|
this.email = email;
|
|
|
|
this.emailRecipientId = emailRecipientId;
|
2022-11-24 09:54:20 +03:00
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static create(data) {
|
|
|
|
return new EmailBouncedEvent({
|
|
|
|
...data,
|
|
|
|
timestamp: data.timestamp || new Date
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|