<?php

namespace App\Http\Controllers;

use App\Services\ClientCalendarService;
use Illuminate\Http\JsonResponse;

class ClientCalendarController extends Controller
{
    public function __construct(private readonly ClientCalendarService $service) {}

    public function index(): JsonResponse
    {
        try {
            $dados = $this->service->getCalendar();

            return $this->successResponse(payload: $dados);
        } catch (\Exception $e) {
            return $this->errorResponse(message: __('messages.error_fetching_data'), code: 500, exception: $e);
        }
    }
}
