2022-01-27 13:57:51 +03:00
|
|
|
/**
|
|
|
|
* @typedef {object} MemberSubscribeEventData
|
|
|
|
* @prop {string} memberId
|
2022-08-25 04:41:19 +03:00
|
|
|
* @prop {'import' | 'system' | 'api' | 'admin' | 'member'} source
|
2022-01-27 13:57:51 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = class MemberSubscribeEvent {
|
|
|
|
/**
|
|
|
|
* @param {MemberSubscribeEventData} data
|
|
|
|
* @param {Date} timestamp
|
|
|
|
*/
|
|
|
|
constructor(data, timestamp) {
|
|
|
|
this.data = data;
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {MemberSubscribeEventData} data
|
|
|
|
* @param {Date} [timestamp]
|
|
|
|
*/
|
|
|
|
static create(data, timestamp) {
|
|
|
|
return new MemberSubscribeEvent(data, timestamp || new Date);
|
|
|
|
}
|
|
|
|
};
|