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