<?php

namespace DMD\LaLigaApi\Controller;

use DMD\LaLigaApi\Service\Season\addTeam\HandleAddTeamList;
use DMD\LaLigaApi\Service\Season\createFacilities\HandleCreateFacilities;
use DMD\LaLigaApi\Service\Season\createGameCalendar\HandleCreateGameCalendarRequest;
use DMD\LaLigaApi\Service\Season\createSeason\HandleCreateSeason;
use DMD\LaLigaApi\Service\Season\getAllFacilities\HandleGetAllFacilities;
use DMD\LaLigaApi\Service\Season\getAllTeams\HandleGetAllTeams;
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, HandleAddTeamList $handleAddTeam, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleAddTeam($request, $leagueId, $seasonId);
    }
    #[Route('/api/league/{leagueId}/season/{seasonId}/team', name: 'app_get_all_teams', methods: ['GET'])]
    public function getAllTeam(Request $request, HandleGetAllTeams $handleGetAllTeams, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleGetAllTeams($request, $leagueId, $seasonId);
    }
    #[Route('/api/league/{leagueId}/season/{seasonId}/facilities/create', name: 'app_create_facilities', methods: ['POST'])]
    public function createFacilities(Request $request, HandleCreateFacilities $handleCreateFacilities, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleCreateFacilities($request, $leagueId, $seasonId);
    }
    #[Route('/api/league/{leagueId}/season/{seasonId}/facilities/', name: 'app_get_all_facilities', methods: ['GET'])]
    public function getAllFacilities(Request $request, HandleGetAllFacilities $handleGetAllFacilities, int $leagueId, int $seasonId): JsonResponse
    {
        return $handleGetAllFacilities($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);
    }

}
