mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 16:01:40 +03:00
27 lines
649 B
JavaScript
27 lines
649 B
JavaScript
|
/**
|
||
|
* @typedef {object} SubscriptionCancelledEventData
|
||
|
* @prop {string} source
|
||
|
* @prop {string} memberId
|
||
|
* @prop {string} tierId
|
||
|
* @prop {string} subscriptionId
|
||
|
*/
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
};
|