<?php

namespace DMD\LaLigaApi\Controller;

use DMD\LaLigaApi\Service\Season\addTeam\HandleAddTeam;
use DMD\LaLigaApi\Service\Season\createGameCalendar\HandleCreateGameCalendarRequest;
use DMD\LaLigaApi\Service\Season\createSeason\HandleCreateSeason;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

class SeasonController extends AbstractController
{
    #[Route('/api/league/{leagueId}/season/create', name: 'app_add_season', methods: ['POST'])]
    public function addSeason(Request $request, HandleCreateSeason $handleCreateSeason, int $leagueId): JsonResponse
    {
        return $handleCreateSeason($request, $leagueId);
    }

    #[Route('/api/league/{leagueId}/season/{seasonId}/team', name: 'app_add_team', methods: ['POST'])]
    public function addTeam(Request $request, HandleAddTeam $handleAddTeam, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleAddTeam($request, $leagueId, $seasonId);
    }

    #[Route('/api/league/{leagueId}/season/{seasonId}/calendar', name: 'app_create_calendar', methods: ['POST'])]
    public function createCalendar(Request $request, HandleCreateGameCalendarRequest $handleCreateGameCalendarRequest, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleCreateGameCalendarRequest($request, $leagueId, $seasonId);
    }

}
