<?php

namespace Database\Seeders;

use App\Models\Icd;
use App\Models\Member;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Str;

class DummyClaimSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $members = Member::limit(10)->get();

        foreach ($members as $member) {
            for ($x = 0; $x < 10; $x++) {
                $member->claims()->create([
                    'code' => Str::random('16'),
                    'member_id' => $member->id,
                    'diagnosis_id' => Icd::inRandomOrder()->first()->id,
                    'total_claim' => 5000000,
                    'currency' => 'IDR',
                    'plan_id' => $member->currentPlan->id,
                    'benefit_id' => $member->currentPlan->benefits()->inRandomOrder()->first()->id,
                ]);
            }
        }
    }
}
