<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Models\Especiality;
use App\Models\HistoryConfiguration;
use Illuminate\Http\JsonResponse;

class EspecialityConfigurationController extends Controller
{
    public function getConfiguration(Especiality $especiality): JsonResponse
    {
        $configuration = HistoryConfiguration::where('especiality_id', $especiality->id)->first();
        
        return response()->json([
            'configuration' => $configuration ? $configuration->load('section_types') : null
        ]);
    }
} 