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

const Product = sequelize.define('Product', {
    product_id: {
        type: DataTypes.UUID,
        defaultValue: DataTypes.UUIDV4,
        primaryKey: true,
    },
    product_name: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    unit_id: {
        type: DataTypes.UUID,
    },
    product_amount: {
        type: DataTypes.INTEGER,
        allowNull: false,
    },
    product_balance: {
        type: DataTypes.INTEGER,
        allowNull: false,
    },
    status: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    time_date: {
        type: DataTypes.DATE,
        allowNull: false,
    },
    id_product: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    product_remark: {
        type: DataTypes.STRING,
        allowNull: false,
    },
    category: {
        type: DataTypes.STRING,
        allowNull: false,
    }
}, 
{
    tableName: 'product',
    timestamps: false,
    underscored: true,
});

module.exports = Product;