<?php

namespace App\Http\Requests\HR;

class UpdateEmployeeRequest extends StoreEmployeeRequest
{
    public function rules(): array
    {
        $rules = parent::rules();
        $rules['full_name'] = ['sometimes', 'string', 'max:255'];

        return $rules;
    }

    /** Only the fields actually sent are applied. @return array<string, mixed> */
    public function modelAttributes(): array
    {
        return array_intersect_key(parent::modelAttributes(), $this->all());
    }
}
