2022-08-18 18:38:42 +03:00
|
|
|
/**
|
|
|
|
* @typedef {object} MemberCreatedEventData
|
|
|
|
* @prop {string} memberId
|
2022-10-27 12:44:19 +03:00
|
|
|
* @prop {string} batchId
|
2022-08-25 04:41:19 +03:00
|
|
|
* @prop {'import' | 'system' | 'api' | 'admin' | 'member'} source
|
2022-08-18 18:38:42 +03:00
|
|
|
* @prop {import('@tryghost/member-attribution/lib/attribution').Attribution} [attribution] Attribution
|
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = class MemberCreatedEvent {
|
|
|
|
/**
|
|
|
|
* @param {MemberCreatedEventData} data
|
|
|
|
* @param {Date} timestamp
|
|
|
|
*/
|
|
|
|
constructor(data, timestamp) {
|
|
|
|
this.data = data;
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {MemberCreatedEventData} data
|
|
|
|
* @param {Date} [timestamp]
|
|
|
|
*/
|
|
|
|
static create(data, timestamp) {
|
|
|
|
return new MemberCreatedEvent(data, timestamp ?? new Date);
|
|
|
|
}
|
|
|
|
};
|