<?php

namespace App\Domains\Forms\Controllers\AdminApp;

use App\Domains\Forms\Resources\StaffFormResource;
use App\Domains\Forms\Services\StaffFormService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class StaffFormController extends Controller
{
    public function __construct(protected StaffFormService $staffFormService) {}

    public function __invoke(Request $request): StaffFormResource
    {
        return StaffFormResource::make(
            $this->staffFormService->get(
                $request->user('sanctum')->tenant()->firstOrFail()
            )
        );
    }
}
