<?php

namespace App\Modules\HR\EmployeeSelfService\Services;

use App\Models\User;

class EmployeeSelfProfileService
{
    public function __construct(
        private readonly SelfEmployeeContextService $context,
    ) {}

    /**
     * @return array{employee: \App\Modules\HR\Employees\Models\Employee, show_salary: bool}
     */
    public function profilePayload(User $user): array
    {
        $employee = $this->context->employee();

        return [
            'employee' => $employee,
            'show_salary' => $user->can('employees.salary.view', $employee),
        ];
    }
}
