module.exports = (sequelize, type) => {
    const HybridClass = sequelize.define('hybrid_class', {
        id: {
            type: type.INTEGER,
            primaryKey: true,
            autoIncrement: true
        },
        cohort_name: {
            type: type.STRING,
            // unique: {
            //     args: true,
            //     msg: 'Oops. Looks like Cohort already exist.'
            // }
        },
        userslist: { type: type.TEXT, allowNull: true, get: function () { return this.getDataValue('userslist') ? this.getDataValue('userslist').split(',') : [] } },
        knowassessments: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('knowassessments').split(',') }
        },
        practicetests: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('practicetests').split(',') }
        },
        ketexamtests: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('ketexamtests').split(',') }
        },
        email_templates: {
            type: type.STRING,
            allowNull: true,
            get: function () { return this.getDataValue('email_templates').split(',') }
        },
        videos: {
            type: type.STRING,
            allowNull: true,
            get: function () { return this.getDataValue('videos').split(',') }
        },
        mindmaps: {
            type: type.STRING,
            allowNull: true,
            get: function () { return this.getDataValue('mindmaps').split(',') }
        },
        live_events: {
            type: type.STRING,
            allowNull: true,
            get: function () { return this.getDataValue('live_events').split(',') }
        },
        certi_id: type.INTEGER,
        cource_id: type.INTEGER,
        practice_time: type.STRING,
        location: type.STRING,
        company_id: type.INTEGER,
        template_id: type.INTEGER,
        events: type.TEXT,
        time_zone: type.TEXT,
        status: {
            type: type.INTEGER,
            defaultValue: 0
        },
        video_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        mindmap_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        summary_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        reference_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        KA_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        PT_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        CAT_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        livechat_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        liveq_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        liveevent_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        question_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        flashcard_access: {
            type: type.INTEGER,
            defaultValue: 0
        },
        start_date: type.TEXT,
        method_id: {
            type: type.INTEGER,
            defaultValue: 0
        },
        access_duration: {
            type: type.INTEGER,
            defaultValue: 0
        },
        course_type: type.TEXT,
        baseline_ka: type.TEXT,
        baseline_ka_schedule: type.TEXT
    })
    return HybridClass;
}