2022-12-01 12:00:53 +03:00
|
|
|
module.exports = class EmailTemporaryBouncedEvent {
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
id;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
email;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
memberId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
emailId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
2023-01-10 18:36:41 +03:00
|
|
|
* @type {{message: string, code: number, enhancedCode: string | null}|null}
|
2022-12-01 12:00:53 +03:00
|
|
|
*/
|
|
|
|
error;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {string}
|
|
|
|
*/
|
|
|
|
emailRecipientId;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @readonly
|
|
|
|
* @type {Date}
|
|
|
|
*/
|
|
|
|
timestamp;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @private
|
|
|
|
*/
|
|
|
|
constructor({id, email, memberId, emailId, emailRecipientId, error, timestamp}) {
|
|
|
|
this.id = id;
|
|
|
|
this.memberId = memberId;
|
|
|
|
this.emailId = emailId;
|
|
|
|
this.email = email;
|
|
|
|
this.error = error;
|
|
|
|
this.emailRecipientId = emailRecipientId;
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
static create(data) {
|
|
|
|
return new EmailTemporaryBouncedEvent({
|
|
|
|
...data,
|
|
|
|
timestamp: data.timestamp || new Date
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|