'use strict';

const Types = require('paradox-utils').SchemaTypes;

/**
 *  @param  {Dblize}  dblize
 *  @return {Object}  model
 **/
module.exports = function(dblize) {
    let Model = dblize.define('user', {
        username: {
            type: Types.STRING,
        },
        password: {
            type: Types.STRING,
        },
        email: {
            type: Types.STRING,
            validate: {
                isEmail: true,
            }
        },
        data: {
            type: Types.JSON,
            defaultValue: {}
        }
    });

    return Model;
};