'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 插入离栏记录数据
    await queryInterface.bulkInsert('cattle_exit_records', [
      {
        record_id: 'EX202501001',
        animal_id: 1,
        exit_date: new Date('2025-01-15'),
        exit_reason: '出售',
        original_pen_id: 1,
        destination: '某肉类加工厂',
        disposal_method: '屠宰',
        handler: '张三',
        status: '已确认',
        remark: '正常出售，已确认收款',
        farm_id: 1,
        created_at: new Date('2025-01-15 10:30:00'),
        updated_at: new Date('2025-01-15 10:30:00')
      },
      {
        record_id: 'EX202501002',
        animal_id: 2,
        exit_date: new Date('2025-01-16'),
        exit_reason: '死亡',
        original_pen_id: 1,
        destination: '无害化处理中心',
        disposal_method: '掩埋',
        handler: '李四',
        status: '已确认',
        remark: '因病死亡，已进行无害化处理',
        farm_id: 1,
        created_at: new Date('2025-01-16 14:20:00'),
        updated_at: new Date('2025-01-16 14:20:00')
      },
      {
        record_id: 'EX202501003',
        animal_id: 3,
        exit_date: new Date('2025-01-17'),
        exit_reason: '淘汰',
        original_pen_id: 2,
        destination: '淘汰牛处理场',
        disposal_method: '屠宰',
        handler: '王五',
        status: '待确认',
        remark: '因年龄过大淘汰，待确认处理',
        farm_id: 1,
        created_at: new Date('2025-01-17 09:15:00'),
        updated_at: new Date('2025-01-17 09:15:00')
      },
      {
        record_id: 'EX202501004',
        animal_id: 4,
        exit_date: new Date('2025-01-18'),
        exit_reason: '转场',
        original_pen_id: 3,
        destination: '其他养殖场',
        disposal_method: '转售',
        handler: '赵六',
        status: '已确认',
        remark: '转场到其他养殖场继续饲养',
        farm_id: 1,
        created_at: new Date('2025-01-18 11:00:00'),
        updated_at: new Date('2025-01-18 11:00:00')
      },
      {
        record_id: 'EX202501005',
        animal_id: 5,
        exit_date: new Date('2025-01-19'),
        exit_reason: '其他',
        original_pen_id: 4,
        destination: '科研机构',
        disposal_method: '其他',
        handler: '孙七',
        status: '已取消',
        remark: '原计划用于科研，后取消',
        farm_id: 1,
        created_at: new Date('2025-01-19 15:30:00'),
        updated_at: new Date('2025-01-19 15:30:00')
      }
    ], {});
  },

  down: async (queryInterface, Sequelize) => {
    await queryInterface.bulkDelete('cattle_exit_records', null, {});
  }
};
