module.exports = (sequelize, type) => {
    const MiniMasterClass = sequelize.define('mini_master_class', {
        id: {
            type: type.INTEGER,
            primaryKey: true,
            autoIncrement: true
        },
        class_name: {
            type: type.STRING
        },
        class_url: {
            type: type.STRING
        },
        certi_id: type.INTEGER,
        users: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('users').split(',') }
        },
        enroll_email_template: type.STRING,
        class1_display_name: type.STRING,
        class1_video_url: type.STRING,
        class1_thumbnail_url: type.STRING,
        class1_material_url: type.STRING,
        class1_material_name: type.STRING,
        class1_video_next_button: type.STRING,
        class1_video_complete_email: type.STRING,
        class1_video_not_complete_email: type.STRING,
        class1_ka_name: type.STRING,
        kaq: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('kaq').split(',') }
        },
        class1_ka_next_button: type.STRING,
        class1_ka_complete_email: type.STRING,
        class1_ka_not_complete_email: type.STRING,

        class2_display_name: type.STRING,
        class2_video_url: type.STRING,
        class2_thumbnail_url: type.STRING,
        class2_material_url: type.STRING,
        class2_material_name: type.STRING,
        class2_video_next_button: type.STRING,
        class2_video_complete_email: type.STRING,
        class2_video_not_complete_email: type.STRING,
        class2_pt_name: type.STRING,
        ptq: {
            type: type.STRING,
            defaultValue: 0,
            allowNull: false,
            get: function () { return this.getDataValue('ptq').split(',') }
        },
        class2_pt_next_button: type.STRING,
        class2_pt_complete_email: type.STRING,
        class2_pt_not_complete_email: type.STRING,

        class3_display_name: type.STRING,
        class3_video_url: type.STRING,
        class3_thumbnail_url: type.STRING,
        class3_material_url: type.STRING,
        class3_material_name: type.STRING,
        class3_video_next_button: type.STRING,
        class3_video_complete_email: type.STRING,
        class3_video_not_complete_email: type.STRING,

        offer_name: type.STRING,
        offer_video_url: type.STRING,
        offer_thumbnail_url: type.STRING,
        offer_material_url: type.STRING,
        offer_button_text: type.STRING,
        offer_link: type.STRING,
        offer_page_text: type.TEXT,

        class1_video_url_144p: type.STRING,
        class1_video_url_240p: type.STRING,
        class1_video_url_360p: type.STRING,
        class1_video_url_480p: type.STRING,
        class1_video_url_720p: type.STRING,

        class2_video_url_144p: type.STRING,
        class2_video_url_240p: type.STRING,
        class2_video_url_360p: type.STRING,
        class2_video_url_480p: type.STRING,
        class2_video_url_720p: type.STRING,

        class3_video_url_144p: type.STRING,
        class3_video_url_240p: type.STRING,
        class3_video_url_360p: type.STRING,
        class3_video_url_480p: type.STRING,
        class3_video_url_720p: type.STRING,

        status: {
            type: type.INTEGER,
            defaultValue: 0
        }
    })
    return MiniMasterClass;
}