2021-10-21 15:22:27 +03:00
|
|
|
/** @typedef {import('../models/Offer')} Offer */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @typedef {object} OfferCreatedEventData
|
|
|
|
* @prop {Offer} offer
|
|
|
|
*/
|
|
|
|
|
2023-05-02 23:43:47 +03:00
|
|
|
module.exports = class OfferCreatedEvent {
|
2021-10-21 15:22:27 +03:00
|
|
|
/**
|
|
|
|
* @param {OfferCreatedEventData} data
|
|
|
|
* @param {Date} timestamp
|
|
|
|
*/
|
|
|
|
constructor(data, timestamp) {
|
|
|
|
this.data = data;
|
|
|
|
this.timestamp = timestamp;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param {OfferCreatedEventData} data
|
|
|
|
* @param {Date} [timestamp]
|
|
|
|
*/
|
|
|
|
static create(data, timestamp) {
|
|
|
|
return new OfferCreatedEvent(data, timestamp || new Date);
|
|
|
|
}
|
2023-05-02 23:43:47 +03:00
|
|
|
};
|