<?php

namespace Modules\Travel\Database\Seeders;

use Carbon\Carbon;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Illuminate\Database\Eloquent\Model;

class TravelPlanSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $travelPlans = [
            [
                'employee_id' => 2,
                'from_date' => Carbon::now()->subDays(10),
                'to_date' => Carbon::now()->subDays(5),
                'from_location' => 'New York',
                'to_location' => 'Los Angeles',
                'purpose' => 'Business meeting',
                'amount' => 1500.00,
                'signature_path' => null,
                'signature_date' => null,
                'status' => 'Pending',
                'approved_by' => null,
                'approved_at' => null,
                'approved_remarks' => null,
                'rejected_by' => null,
                'rejected_at' => null,
                'rejected_remarks' => null,
                'created_by' => 1,
                'updated_by' => 1,
                'company_id' => 1,
                'branch_id' => 1,
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'employee_id' => 3,
                'from_date' => Carbon::now()->subDays(20),
                'to_date' => Carbon::now()->subDays(15),
                'from_location' => 'Chicago',
                'to_location' => 'San Francisco',
                'purpose' => 'Project discussion',
                'amount' => 2000.00,
                'signature_path' => null,
                'signature_date' => null,
                'status' => 'Approved',
                'approved_by' => 1,
                'approved_at' => Carbon::now()->subDays(10),
                'approved_remarks' => 'Approved by manager',
                'rejected_by' => null,
                'rejected_at' => null,
                'rejected_remarks' => null,
                'created_by' => 1,
                'updated_by' => 1,
                'company_id' => 1,
                'branch_id' => 1,
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'employee_id' => 4,
                'from_date' => Carbon::now()->subDays(5),
                'to_date' => Carbon::now(),
                'from_location' => 'Miami',
                'to_location' => 'Orlando',
                'purpose' => 'Conference',
                'amount' => 1000.00,
                'signature_path' => null,
                'signature_date' => null,
                'status' => 'Rejected',
                'approved_by' => null,
                'approved_at' => null,
                'approved_remarks' => null,
                'rejected_by' => 1,
                'rejected_at' => Carbon::now()->subDays(3),
                'rejected_remarks' => 'Insufficient budget',
                'created_by' => 1,
                'updated_by' => 1,
                'company_id' => 1,
                'branch_id' => 1,
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'employee_id' => 5,
                'from_date' => Carbon::now()->subDays(15),
                'to_date' => Carbon::now()->subDays(12),
                'from_location' => 'Houston',
                'to_location' => 'Austin',
                'purpose' => 'Team building event',
                'amount' => 1200.00,
                'signature_path' => null,
                'signature_date' => null,
                'status' => 'Pending',
                'approved_by' => null,
                'approved_at' => null,
                'approved_remarks' => null,
                'rejected_by' => null,
                'rejected_at' => null,
                'rejected_remarks' => null,
                'created_by' => 1,
                'updated_by' => 1,
                'company_id' => 1,
                'branch_id' => 1,
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
            [
                'employee_id' => 6,
                'from_date' => Carbon::now()->subDays(25),
                'to_date' => Carbon::now()->subDays(22),
                'from_location' => 'Seattle',
                'to_location' => 'Portland',
                'purpose' => 'Client visit',
                'amount' => 1800.00,
                'signature_path' => null,
                'signature_date' => null,
                'status' => 'Approved',
                'approved_by' => 1,
                'approved_at' => Carbon::now()->subDays(20),
                'approved_remarks' => 'Visit confirmed',
                'rejected_by' => null,
                'rejected_at' => null,
                'rejected_remarks' => null,
                'created_by' => 1,
                'updated_by' => 1,
                'company_id' => 1,
                'branch_id' => 1,
                'created_at' => Carbon::now(),
                'updated_at' => Carbon::now(),
            ],
        ];

        DB::table('travel_plans')->insert($travelPlans);
    }
}
