<?php

namespace Modules\Patient\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Auth\Models\Role;
use Modules\Core\Enums\RolesEnum;
use Modules\Core\Traits\HasModulePermissions;

class PatientPermissionSeeder extends Seeder
{
    use HasModulePermissions;

    public function run(): void
    {
        $this->seedPermissions('patient', [
            'setting' => [
                'view',
                'manage',
            ],

            'patient' => [
                'view',
                'create',
                // 'update',
                // 'status',
                // 'delete',
            ],
        ]);

        $adminRole = Role::where('name', RolesEnum::ADMIN->value)->first();
        if ($adminRole) {
            $adminRole->givePermissionTo([
                'patient.setting.view',
                'patient.setting.manage',

                'patient.patient.view',
                'patient.patient.create',
            ]);
        }


    }
}
