2022-11-24 09:54:20 +03:00
|
|
|
module.exports = class EmailBouncedEvent {
|
2022-12-01 12:00:53 +03:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
id;
|
|
|
|
|
2022-11-24 09:54:20 +03:00
|
|
|
/**
|
|
|
|
* @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-12-01 12:00:53 +03:00
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {{message: string, code: number, enhancedCode: string | null}}
|
|
|
|
*/
|
|
|
|
error;
|
|
|
|
|
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-12-01 12:00:53 +03:00
|
|
|
constructor({id, email, memberId, emailId, error, emailRecipientId, timestamp}) {
|
|
|
|
this.id = id;
|
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;
|
2022-12-01 12:00:53 +03:00
|
|
|
this.error = error;
|
2022-11-29 13:15:19 +03:00
|
|
|
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
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|