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

const Purchase = sequelize.define('Purchase', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    supplier_name: {
        type: DataTypes.STRING,
        allowNull: true
    },
    total_cost: {
        type: DataTypes.DECIMAL(15, 2), // Updated precision based on assumption or standard
        allowNull: true
    }
    // removed total_items as it wasn't in the latest text list
}, {
    timestamps: true,
    tableName: 'purchases',
    underscored: true
});

module.exports = Purchase;
