'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('CashDrawerActivities', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      registerId: {
        type: Sequelize.INTEGER
      },
          storeId: {
        type: Sequelize.INTEGER
      },
      sessionId: {
        type: Sequelize.INTEGER
      },

      activityType: {
        type: Sequelize.STRING
      },
      amount: {
        type: Sequelize.DECIMAL
      },

       balanceBefore: {
        type: Sequelize.DECIMAL
      },

       balanceAfter: {
        type: Sequelize.DECIMAL
      },
      reason: {
        type: Sequelize.TEXT
      },
      performedBy: {
        type: Sequelize.INTEGER
      },
      performedAt: {
        type: Sequelize.DATE
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('CashDrawerActivities');
  }
};