<?php

namespace App\Domains\Dashboard\Actions\UpdatePersonalData;

use App\Repositories\UserRepository;

class UpdatePersonalDataCommand
{
    public function __construct(
        private readonly UpdatePersonalDataRequest $request,
        private readonly UserRepository $users
    ) {}

    public function execute(): UpdatePersonalDataResponse
    {
        $this->users->updatePersonalData($this->request);

        $response = new UpdatePersonalDataResponse();
        $response->success = true;

        return $response;
    }
}
