const mongoose = require('mongoose');

const Schema = mongoose.Schema;

const modelUser = new Schema(
    {
        fullName: { type: String, required: true },
        email: { type: String, required: true },
        password: { type: String, required: true },
        isAdmin: { type: Boolean, default: false },
        phone: { type: String, required: false, default: '' },
        typeLogin: { type: String, enum: ['email', 'google'] },
        balance: { type: Number, default: 0 },
        balanceHistory: { type: Number, default: 0 },
    },
    {
        timestamps: true,
    },
);

module.exports = mongoose.model('user', modelUser);
