2022-09-09 17:25:25 +03:00
|
|
|
/**
|
|
|
|
* @typedef {object} SubscriptionCancelledEventData
|
|
|
|
* @prop {string} source
|
|
|
|
* @prop {string} memberId
|
|
|
|
* @prop {string} tierId
|
|
|
|
* @prop {string} subscriptionId
|
2024-07-15 09:07:18 +03:00
|
|
|
* @prop {boolean} cancelNow
|
|
|
|
* @prop {Date} expiryAt
|
|
|
|
* @prop {Date} canceledAt
|
2022-09-09 17:25:25 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
module.exports = class SubscriptionCancelledEvent {
|
|
|
|
/**
|
|
|
|
* @param {SubscriptionCancelledEventData} data
|
|
|
|
* @param {Date} timestamp
|
|
|
|
*/
|
|
|
|
constructor(data, timestamp) {
|
|
|
|
this.data = data;
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {SubscriptionCancelledEventData} data
|
|
|
|
* @param {Date} [timestamp]
|
|
|
|
*/
|
|
|
|
static create(data, timestamp) {
|
|
|
|
return new SubscriptionCancelledEvent(data, timestamp || new Date);
|
|
|
|
}
|
|
|
|
};
|