'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    // 插入批次设置数据
    await queryInterface.bulkInsert('cattle_batches', [
      {
        name: '2025年春季育成批次',
        code: 'BATCH2025001',
        type: '育成批次',
        start_date: new Date('2025-01-01'),
        expected_end_date: new Date('2025-06-30'),
        actual_end_date: null,
        target_count: 100,
        current_count: 85,
        manager: '张三',
        status: '进行中',
        remark: '春季育成批次，主要饲养育成母牛',
        farm_id: 1,
        created_at: new Date('2025-01-01 09:00:00'),
        updated_at: new Date('2025-01-01 09:00:00')
      },
      {
        name: '2024年冬季繁殖批次',
        code: 'BATCH2024001',
        type: '繁殖批次',
        start_date: new Date('2024-10-01'),
        expected_end_date: new Date('2025-03-31'),
        actual_end_date: new Date('2025-03-31'),
        target_count: 50,
        current_count: 50,
        manager: '李四',
        status: '已完成',
        remark: '冬季繁殖批次，已完成所有繁殖任务',
        farm_id: 1,
        created_at: new Date('2024-10-01 09:00:00'),
        updated_at: new Date('2024-10-01 09:00:00')
      },
      {
        name: '2025年育肥批次',
        code: 'BATCH2025002',
        type: '育肥批次',
        start_date: new Date('2025-02-01'),
        expected_end_date: new Date('2025-08-31'),
        actual_end_date: null,
        target_count: 80,
        current_count: 45,
        manager: '王五',
        status: '进行中',
        remark: '育肥批次，主要饲养肉牛',
        farm_id: 1,
        created_at: new Date('2025-02-01 09:00:00'),
        updated_at: new Date('2025-02-01 09:00:00')
      },
      {
        name: '2025年隔离批次',
        code: 'BATCH2025003',
        type: '隔离批次',
        start_date: new Date('2025-01-10'),
        expected_end_date: new Date('2025-02-10'),
        actual_end_date: null,
        target_count: 20,
        current_count: 8,
        manager: '赵六',
        status: '进行中',
        remark: '隔离批次，用于观察新引进牛只',
        farm_id: 1,
        created_at: new Date('2025-01-10 09:00:00'),
        updated_at: new Date('2025-01-10 09:00:00')
      },
      {
        name: '2025年治疗批次',
        code: 'BATCH2025004',
        type: '治疗批次',
        start_date: new Date('2025-01-15'),
        expected_end_date: new Date('2025-03-15'),
        actual_end_date: null,
        target_count: 15,
        current_count: 5,
        manager: '孙七',
        status: '进行中',
        remark: '治疗批次，用于病牛康复治疗',
        farm_id: 1,
        created_at: new Date('2025-01-15 09:00:00'),
        updated_at: new Date('2025-01-15 09:00:00')
      }
    ], {});
  },

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