<?php

namespace App\Domains\Forms\Controllers\AdminApp;

use App\Domains\Forms\Resources\MerchandiseFormResource;
use App\Domains\Forms\Services\MerchandiseFormService;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;

class MerchandiseFormController extends Controller
{
    public function __construct(protected MerchandiseFormService $merchandiseFormService) {}

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