'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
  async up(queryInterface, Sequelize) {
    await queryInterface.createTable('CashDrawerSessions', {
      id: {
        allowNull: false,
        autoIncrement: true,
        primaryKey: true,
        type: Sequelize.INTEGER
      },
      registerId: {
        type: Sequelize.INTEGER
      },
        storeId: {
        type: Sequelize.INTEGER
      },
      openedBy: {
        type: Sequelize.INTEGER
      },
      closedBy: {
        type: Sequelize.INTEGER
      },
      openedAt: {
        type: Sequelize.DATE
      },
      closedAt: {
        type: Sequelize.DATE
      },
      openingCash: {
        type: Sequelize.DECIMAL
      },
      closingCash: {
        type: Sequelize.DECIMAL
      },
      expectedCash: {
        type: Sequelize.DECIMAL
      },
      variance: {
        type: Sequelize.DECIMAL
      },
      totalSales: {
        type: Sequelize.DECIMAL
      },
      totalRefunds: {
        type: Sequelize.DECIMAL
      },
      cashIn: {
        type: Sequelize.DECIMAL
      },
      cashOut: {
        type: Sequelize.DECIMAL
      },
      notes: {
        type: Sequelize.TEXT
      },
      createdAt: {
        allowNull: false,
        type: Sequelize.DATE
      },
      updatedAt: {
        allowNull: false,
        type: Sequelize.DATE
      }
    });
  },
  async down(queryInterface, Sequelize) {
    await queryInterface.dropTable('CashDrawerSessions');
  }
};