<?php

namespace App\Http\Controllers\Public;

use App\Http\Controllers\Controller;
use App\Enums\TypeService;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;

class ServiceController extends Controller
{
    /**
     * GET /api/public/services
     * Retourne la liste des types de services disponibles
     */
    public function index(Request $request): JsonResponse
    {
        return response()->json([
            'services' => collect(TypeService::cases())->map(fn($case) => [
                'value' => $case->value,
                'label' => str_replace('_', ' ', ucfirst($case->value)),
            ])
        ]);
    }
}
