<?php

declare(strict_types=1);

namespace KupShop\DevelopmentBundle\Controller;

use KupShop\DevelopmentBundle\View\TestCleaningView;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;

class FrontendTestController extends AbstractController
{
    #[Route(path: '/_cypress/resetHard')]
    public function resetDatabase(Request $request, TestCleaningView $cleaningView): Response
    {
        $cleaningView->setRequest($request);
        $cleaningView->runImportDemo();

        return $cleaningView->getResponse();
    }

    #[Route(path: '/_cypress/resetSoft')]
    public function clearSession(Request $request, TestCleaningView $cleaningView): Response
    {
        $cleaningView->setRequest($request);
        $cleaningView->clearSession();

        return $cleaningView->getResponse();
    }
}
