'use strict';

module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.addColumn('purchase_requisition_item', 'gross_required_quantity', {
      type: Sequelize.DECIMAL(18, 3),
      allowNull: true,
      comment: 'Gross required quantity from MRP (before deducting available stock)'
    });

    await queryInterface.addColumn('purchase_requisition_item', 'available_stock_at_pr_creation', {
      type: Sequelize.DECIMAL(18, 3),
      allowNull: true,
      comment: 'Available stock at the time of PR creation (for reference)'
    });
  },

  async down(queryInterface, Sequelize) {
    await queryInterface.removeColumn('purchase_requisition_item', 'gross_required_quantity');
    await queryInterface.removeColumn('purchase_requisition_item', 'available_stock_at_pr_creation');
  }
};

