const sequelize = require('../db');
const {DataTypes} = require('sequelize');

const User = sequelize.define('user', {
    telegram_id: {type: DataTypes.STRING, primaryKey: true, unique: true},
    username: {type: DataTypes.STRING},
    name: {type: DataTypes.STRING},
    status: {type: DataTypes.STRING, defaultValue: 'user'},
    level: {type: DataTypes.INTEGER, defaultValue: 1},
    hp: {type: DataTypes.INTEGER, defaultValue: 100},
    armor: {type: DataTypes.INTEGER, defaultValue: 0},
    exp: {type: DataTypes.INTEGER, defaultValue: 0},
    money: {type: DataTypes.INTEGER, defaultValue: 0},
    dirtymoney: {type: DataTypes.INTEGER, defaultValue: 0},
    stealedcards: {type: DataTypes.INTEGER, defaultValue: 0},
    bonus: {type: DataTypes.INTEGER, defaultValue: 0},
    bonustime: {type: DataTypes.INTEGER, defaultValue: 0},
    job: {type: DataTypes.INTEGER, defaultValue: 0},
    jobcheck: {type: DataTypes.INTEGER, defaultValue: 0},
    jobtime: {type: DataTypes.INTEGER, defaultValue: 0},
    business: {type: DataTypes.JSON, defaultValue: {
            id: 0,
            checks: 0,
            percent: 0
        }
    },
    worktime: {type: DataTypes.INTEGER, defaultValue: 0},
    slottime: {type: DataTypes.INTEGER, defaultValue: 0},
    shoprobcd: {type: DataTypes.INTEGER, defaultValue: 0},
    pocketstealcd: {type: DataTypes.INTEGER, defaultValue: 0}
})

module.exports = User;
