import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';

class FalukantStock extends Model { }

FalukantStock.init({
    branchId: {
        type: DataTypes.INTEGER,
        allowNull: false
    },
    stockTypeId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    quantity: {
        type: DataTypes.INTEGER,
        allowNull: false},
    productQuality: {
        type: DataTypes.INTEGER,
        allowNull: true,
        comment: 'Quality of the stored product (0-100)'
    }
}, {
    sequelize,
    modelName: 'StockData',
    tableName: 'stock',
    schema: 'falukant_data',
    timestamps: false,
    underscored: true});

export default FalukantStock;
