models/invites/ReferralUser.js

import User from './../communities/User.js';

export default class ReferralUser extends User {
    /**
     * @constructor ReferralUser
     *
     * @extends User
     * @param {Object} params - Referral User parameters
     * @param {number} params.eventDate - The date the event was triggered, in RFC3339 format.
     * @param {string} params.event - The related event.
     * @param {Object<string, string>} [params.eventData] - The custom data from the event.
     *     For the `app_install` event additional data is included:
     *     * `$channel`
     *     * `$suspicious`
     *     * `$platform`
     *     * any other custom data included in the Smart Invite
     */

    constructor(args) {
        super(args.user);

        this.event = args.event || null;
        this.eventDate = args.eventDate || null;
        this.eventData = args.eventData || null;

        Object.freeze(this);
    }
}