2022-09-16 11:42:21 +03:00
|
|
|
const ObjectID = require('bson-objectid').default;
|
|
|
|
|
|
|
|
module.exports = class ClickEvent {
|
|
|
|
/** @type {ObjectID} */
|
|
|
|
event_id;
|
2022-09-19 18:12:54 +03:00
|
|
|
/** @type {string} */
|
|
|
|
member_uuid;
|
2022-09-16 11:42:21 +03:00
|
|
|
/** @type {ObjectID} */
|
|
|
|
link_id;
|
|
|
|
|
|
|
|
constructor(data) {
|
|
|
|
if (!data.id) {
|
|
|
|
this.event_id = new ObjectID();
|
|
|
|
}
|
|
|
|
|
|
|
|
if (typeof data.id === 'string') {
|
|
|
|
this.event_id = ObjectID.createFromHexString(data.id);
|
|
|
|
} else {
|
|
|
|
this.event_id = data.id;
|
|
|
|
}
|
|
|
|
|
2022-09-19 18:12:54 +03:00
|
|
|
this.member_uuid = data.member_uuid;
|
2022-09-16 11:42:21 +03:00
|
|
|
this.link_id = data.link_id;
|
|
|
|
}
|
|
|
|
};
|