<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Concerns\DestroysCatalogItem;
use App\Models\TipoServicio;
use App\Support\CatalogDeletionGuard;
use Illuminate\Http\JsonResponse;

class TipoServicioAdminController extends Controller
{
    use DestroysCatalogItem;

    public function destroy(TipoServicio $tipoServicio): JsonResponse
    {
        $this->authorize('delete', $tipoServicio);

        return $this->destroyCatalogItem(
            CatalogDeletionGuard::tipoServicio($tipoServicio),
            fn () => $tipoServicio->delete(),
        );
    }
}
