Basket Bundle Attributes

This commit is contained in:
Thomas Peterson 2025-12-15 17:01:07 +01:00
parent c504f9e4de
commit 1cc2bc57ba
212 changed files with 2149 additions and 3292 deletions

View File

@ -474,7 +474,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* datetime?: array{ * datetime?: array{
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP" * default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
* default_deserialization_formats?: list<scalar|null>, * default_deserialization_formats?: list<scalar|null>,
* default_timezone?: scalar|null, // Default: "Europe/Berlin" * default_timezone?: scalar|null, // Default: "UTC"
* cdata?: scalar|null, // Default: true * cdata?: scalar|null, // Default: true
* }, * },
* array_collection?: array{ * array_collection?: array{
@ -574,7 +574,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
* datetime?: array{ * datetime?: array{
* default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP" * default_format?: scalar|null, // Default: "Y-m-d\\TH:i:sP"
* default_deserialization_formats?: list<scalar|null>, * default_deserialization_formats?: list<scalar|null>,
* default_timezone?: scalar|null, // Default: "Europe/Berlin" * default_timezone?: scalar|null, // Default: "UTC"
* cdata?: scalar|null, // Default: true * cdata?: scalar|null, // Default: true
* }, * },
* array_collection?: array{ * array_collection?: array{

View File

@ -23,7 +23,7 @@ use PSC\System\UpdateBundle\Service\Migration;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Intl\NumberFormatter\NumberFormatter; use Symfony\Component\Intl\NumberFormatter\NumberFormatter;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\UX\Chartjs\Builder\ChartBuilderInterface; use Symfony\UX\Chartjs\Builder\ChartBuilderInterface;
use Symfony\UX\Chartjs\Model\Chart; use Symfony\UX\Chartjs\Model\Chart;

View File

@ -15,7 +15,7 @@ namespace PSC\Backend\DashboardBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;

View File

@ -16,7 +16,7 @@ namespace PSC\Backend\DashboardBundle\Controller;
use Http\Message\Authentication; use Http\Message\Authentication;
use PSC\System\UpdateBundle\Service\Migration; use PSC\System\UpdateBundle\Service\Migration;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils; use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;

View File

@ -30,7 +30,7 @@ use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -4,7 +4,7 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend;
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
use PSC\Backend\ToolsBundle\Service\ExporterRegistry; use PSC\Backend\ToolsBundle\Service\ExporterRegistry;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -5,7 +5,7 @@ namespace PSC\Backend\ToolsBundle\Controller\Backend;
use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface; use PSC\Backend\ToolsBundle\Interfaces\ConfigurableElementInterface;
use PSC\Backend\ToolsBundle\Service\ImporterRegistry; use PSC\Backend\ToolsBundle\Service\ImporterRegistry;
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -3,65 +3,65 @@
namespace PSC\Component\ApiBundle\Api\Account; namespace PSC\Component\ApiBundle\Api\Account;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input; use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input;
use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output; use PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Shop\Domain;
use PSC\Shop\EntityBundle\Entity\Account;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class GetParentByTitle extends AbstractController class GetParentByTitle extends AbstractController
{ {
private EntityManagerInterface $entityManager; private EntityManagerInterface $entityManager;
private \PSC\System\SettingsBundle\Service\Shop $shopService; private \PSC\System\SettingsBundle\Service\Shop $shopService;
public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService) public function __construct(
{ EntityManagerInterface $entityManager,
\PSC\System\SettingsBundle\Service\Shop $shopService,
) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->shopService = $shopService; $this->shopService = $shopService;
} }
/** #[Response(
* Check account parents by title response: 200,
* description: 'account',
* @OA\Response( content: new JsonContent(
* response=200, ref: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class),
* description="account", ),
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Output::class)) )]
* ) #[RequestBody(
* @OA\RequestBody( description: 'This is a request body',
* description="This is a request body", content: new Model(type: PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class),
* @Model(type=\PSC\Component\ApiBundle\Dto\Account\GetParentByTitle\Input::class)) )]
* ) #[Tag(name: 'Account')]
* @OA\Tag(name="Account") #[IsGranted('ROLE_API')]
* @IsGranted("ROLE_API") #[Security(name: 'ApiKeyAuth')]
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/account/getparentbytitle', methods: ['POST'])] #[Route(path: '/account/getparentbytitle', methods: ['POST'])]
public function existsAction(#[MapRequestPayload] Input $data): JsonResponse public function existsAction(#[MapRequestPayload] Input $data): JsonResponse
{ {
$output = new Output(); $output = new Output();
$account = $this->entityManager $account = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Account') ->getRepository('PSC\Shop\EntityBundle\Entity\Account')
->getAccountByTitle( ->getAccountByTitle($data->title);
$data->title
);
if (!$account) { if (!$account) {
$output->parent = ""; $output->parent = '';
$output->parent_id = 0; $output->parent_id = 0;
return $this->json($output); return $this->json($output);
} }
@ -76,14 +76,7 @@ class GetParentByTitle extends AbstractController
return $this->json($output); return $this->json($output);
} }
/** protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account): Account
* Gets the Parent Account
*
* @param \PSC\Shop\EntityBundle\Entity\Account $account
*
* @return \PSC\Shop\EntityBundle\Entity\Account
*/
protected function recursiveParent(\PSC\Shop\EntityBundle\Entity\Account $account)
{ {
if ($account->getParent()) { if ($account->getParent()) {
$account = $this->recursiveParent($account->getParent()); $account = $this->recursiveParent($account->getParent());

View File

@ -3,9 +3,11 @@
namespace PSC\Component\ApiBundle\Api\Cms; namespace PSC\Component\ApiBundle\Api\Cms;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Cms\Cms\Output; use PSC\Component\ApiBundle\Dto\Cms\Cms\Output;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop;
use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Shop\Domain;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class Get extends AbstractController class Get extends AbstractController
{ {
@ -26,27 +28,24 @@ class Get extends AbstractController
private Cms $hydrateCms; private Cms $hydrateCms;
private \PSC\System\SettingsBundle\Service\Shop $shopService; private \PSC\System\SettingsBundle\Service\Shop $shopService;
public function __construct(EntityManagerInterface $entityManager, \PSC\System\SettingsBundle\Service\Shop $shopService, Cms $hydrateCms) public function __construct(
{ EntityManagerInterface $entityManager,
\PSC\System\SettingsBundle\Service\Shop $shopService,
Cms $hydrateCms,
) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->hydrateCms = $hydrateCms; $this->hydrateCms = $hydrateCms;
$this->shopService = $shopService; $this->shopService = $shopService;
} }
/** #[Response(response: 200, description: 'cms', content: new JsonContent(ref: new Model(type: Output::class)))]
* Cms #[Tag(name: 'Cms')]
*
* @OA\Response(
* response=200,
* description="cms",
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Cms\Cms\Output::class))
* )
* @OA\Tag(name="Cms")
*/
#[Route(path: '/cms', methods: ['GET'])] #[Route(path: '/cms', methods: ['GET'])]
public function allAction(): JsonResponse public function allAction(): JsonResponse
{ {
$cmss = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class)->findAllByShop($this->shopService->getShopByDomain()); $cmss = $this->entityManager
->getRepository(\PSC\Shop\EntityBundle\Entity\Cms::class)
->findAllByShop($this->shopService->getShopByDomain());
$data = []; $data = [];
/** @var \PSC\Shop\EntityBundle\Entity\Cms $cms */ /** @var \PSC\Shop\EntityBundle\Entity\Cms $cms */
@ -57,21 +56,17 @@ class Get extends AbstractController
return $this->json(new Output($data)); return $this->json(new Output($data));
} }
/** #[Response(
* Get One Cms response: 200,
* description: 'found cms',
* @OA\Response( content: new JsonContent(ref: new Model(type: \PSC\Component\ApiBundle\Model\Cms::class)),
* response=200, )]
* description="found cms", #[Response(
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class)) response: 404,
* ) description: 'not found',
* @OA\Response( content: new JsonContent(ref: new Model(type: NotFound::class)),
* response=404, )]
* description="not found", #[Tag(name: 'Cms')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class))
* )
* @OA\Tag(name="Cms")
*/
#[Route(path: '/cms/{id}', methods: ['GET'])] #[Route(path: '/cms/{id}', methods: ['GET'])]
public function one($id): JsonResponse public function one($id): JsonResponse
{ {

View File

@ -4,9 +4,11 @@ namespace PSC\Component\ApiBundle\Api\Plugin;
use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\DocumentManager;
use MongoDB\BSON\ObjectId; use MongoDB\BSON\ObjectId;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
@ -14,11 +16,11 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
use PSC\System\PluginBundle\Interfaces\Plugin; use PSC\System\PluginBundle\Interfaces\Plugin;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class Get extends AbstractController class Get extends AbstractController
{ {
@ -29,16 +31,12 @@ class Get extends AbstractController
$this->documentManager = $documentManager; $this->documentManager = $documentManager;
} }
/** #[Response(
* Layouter Plugins response: 200,
* description: 'shops',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)),
* response=200, )]
* description="shops", #[Tag(name: 'Plugin')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class))
* )
* @OA\Tag(name="Plugin")
*/
#[Route(path: '/plugins/layouter', methods: ['GET'])] #[Route(path: '/plugins/layouter', methods: ['GET'])]
public function layouterAction(): JsonResponse public function layouterAction(): JsonResponse
{ {
@ -61,17 +59,13 @@ class Get extends AbstractController
return $this->json(new Shops\Output($data)); return $this->json(new Shops\Output($data));
} }
/** #[Response(
* Plugins response: 200,
* description: 'shops',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)),
* response=200, )]
* description="shops", #[Tag(name: 'Plugin')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Plugin\Plugins\Output::class)) #[Security(name: 'ApiKeyAuth')]
* )
* @OA\Tag(name="Plugin")
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/plugins', methods: ['GET'])] #[Route(path: '/plugins', methods: ['GET'])]
#[IsGranted('ROLE_API')] #[IsGranted('ROLE_API')]
public function allAction(): JsonResponse public function allAction(): JsonResponse
@ -90,27 +84,25 @@ class Get extends AbstractController
return $this->json(new Shops\Output($data)); return $this->json(new Shops\Output($data));
} }
/** #[Response(
* Get one plugin response: 200,
* description: 'found plugin',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)),
* response=200, )]
* description="found plugin", #[Response(
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class)) response: 404,
* ) description: 'not found',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)),
* response=404, )]
* description="not found", #[Tag(name: 'Plugin')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class)) #[Security(name: 'ApiKeyAuth')]
* )
* @OA\Tag(name="Plugin")
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/plugins/{uuid}', methods: ['GET'])] #[Route(path: '/plugins/{uuid}', methods: ['GET'])]
#[IsGranted('ROLE_API')] #[IsGranted('ROLE_API')]
public function one($uuid): JsonResponse public function one($uuid): JsonResponse
{ {
$plugin = $this->documentManager->getRepository(\PSC\System\PluginBundle\Document\Plugin::class)->findOneBy(['id' => new ObjectId($uuid)]); $plugin = $this->documentManager
->getRepository(\PSC\System\PluginBundle\Document\Plugin::class)
->findOneBy(['id' => new ObjectId($uuid)]);
if (!$plugin) { if (!$plugin) {
return $this->json(new NotFound()); return $this->json(new NotFound());
} }

View File

@ -3,44 +3,44 @@
namespace PSC\Component\ApiBundle\Api\Shop; namespace PSC\Component\ApiBundle\Api\Shop;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Shop\Domain;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class Get extends AbstractController class Get extends AbstractController
{ {
private EntityManagerInterface $entityManager; private EntityManagerInterface $entityManager;
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) public function __construct(
{ EntityManagerInterface $entityManager,
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->hydrateShop = $hydrateShop; $this->hydrateShop = $hydrateShop;
} }
/** #[Response(
* Shops response: 200,
* description: 'shops',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class)),
* response=200, )]
* description="shops", #[Tag(name: 'Shops')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Shop\Shops\Output::class)) #[Security(name: 'ApiKeyAuth')]
* ) #[Security(name: 'Bearer')]
* @OA\Tag(name="Shops")
* @Security(name="ApiKeyAuth")
* @Security(name="Bearer")
*/
#[Route(path: '/shops', methods: ['GET'])] #[Route(path: '/shops', methods: ['GET'])]
#[IsGranted('ROLE_SHOP')] #[IsGranted('ROLE_SHOP')]
public function allAction(): JsonResponse public function allAction(): JsonResponse
@ -56,27 +56,25 @@ class Get extends AbstractController
return $this->json(new Shops\Output($data)); return $this->json(new Shops\Output($data));
} }
/** #[Response(
* Get One Shop response: 200,
* description: 'found shop',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)),
* response=200, )]
* description="found shop", #[Response(
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class)) response: 404,
* ) description: 'not found',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Error\NotFound::class)),
* response=404, )]
* description="not found", #[Tag(name: 'Shops')]
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Error\NotFound::class)) #[Security(name: 'ApiKeyAuth')]
* )
* @OA\Tag(name="Shops")
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/shops/{id}', methods: ['GET'])] #[Route(path: '/shops/{id}', methods: ['GET'])]
#[IsGranted('ROLE_API')] #[IsGranted('ROLE_API')]
public function one($id): JsonResponse public function one($id): JsonResponse
{ {
$shop = $this->entityManager->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class)->findOneBy(['uid' => $id]); $shop = $this->entityManager
->getRepository(\PSC\Shop\EntityBundle\Entity\Shop::class)
->findOneBy(['uid' => $id]);
if ($shop) { if ($shop) {
return $this->json($this->hydrateShop->hydrateToModel($shop)); return $this->json($this->hydrateShop->hydrateToModel($shop));

View File

@ -3,9 +3,12 @@
namespace PSC\Component\ApiBundle\Api\Stockbooking; namespace PSC\Component\ApiBundle\Api\Stockbooking;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Error\PersistFailure; use PSC\Component\ApiBundle\Dto\Error\PersistFailure;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
@ -17,55 +20,58 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
use PSC\Component\ApiBundle\Model\Stockbooking; use PSC\Component\ApiBundle\Model\Stockbooking;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class CreateByNr extends AbstractController class CreateByNr extends AbstractController
{ {
private EntityManagerInterface $entityManager; private EntityManagerInterface $entityManager;
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) public function __construct(
{ EntityManagerInterface $entityManager,
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->hydrateShop = $hydrateShop; $this->hydrateShop = $hydrateShop;
} }
/** #[Response(
* create by nr response: 200,
* description: 'stockbooking',
* @OA\Response( content: new JsonContent(
* response=200, ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class),
* description="stockbooking", ),
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Output::class)) )]
* ) #[RequestBody(
* @OA\RequestBody( description: 'This is a request body',
* description="This is a request body", content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class),
* @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr\Input::class)) )]
* ) #[Tag(name: 'Stockbooking')]
* @OA\Tag(name="Stockbooking") #[IsGranted('ROLE_API')]
* @IsGranted("ROLE_API") #[Security(name: 'ApiKeyAuth')]
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/stockbooking/createbynr', methods: ['POST'])] #[Route(path: '/stockbooking/createbynr', methods: ['POST'])]
public function create(#[MapRequestPayload] Input $data): JsonResponse public function create(#[MapRequestPayload] Input $data): JsonResponse
{ {
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->createQueryBuilder('product')
->andWhere('product.nrIntern = :nr or product.nrExtern = :nr') ->andWhere('product.nrIntern = :nr or product.nrExtern = :nr')
->setParameter('nr', $data->product_nr) ->setParameter('nr', $data->product_nr)
->getQuery()->getOneOrNullResult(); ->getQuery()
->getOneOrNullResult();
if ($product) { if ($product) {
$contact = $this->entityManager $contact = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Contact')->findOneBy(['uid' => $data->contact_id]); ->getRepository('PSC\Shop\EntityBundle\Entity\Contact')
->findOneBy(['uid' => $data->contact_id]);
if (!$contact) { if (!$contact) {
return $this->json(new NotFound("Contact not found")); return $this->json(new NotFound('Contact not found'));
} }
$stBooking = new \PSC\Shop\EntityBundle\Entity\Stockbooking($product); $stBooking = new \PSC\Shop\EntityBundle\Entity\Stockbooking($product);
@ -89,6 +95,6 @@ class CreateByNr extends AbstractController
return $this->json(new Output()); return $this->json(new Output());
} }
return $this->json(new NotFound("Product not found")); return $this->json(new NotFound('Product not found'));
} }
} }

View File

@ -3,9 +3,12 @@
namespace PSC\Component\ApiBundle\Api\Stockbooking; namespace PSC\Component\ApiBundle\Api\Stockbooking;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Component\ApiBundle\Dto\Shop\Shops; use PSC\Component\ApiBundle\Dto\Shop\Shops;
use PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input; use PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input;
@ -16,55 +19,55 @@ use PSC\Component\ApiBundle\Model\Shop\Domain;
use PSC\Component\ApiBundle\Model\Stockbooking; use PSC\Component\ApiBundle\Model\Stockbooking;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class GetByNr extends AbstractController class GetByNr extends AbstractController
{ {
private EntityManagerInterface $entityManager; private EntityManagerInterface $entityManager;
private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop; private \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop;
public function __construct(EntityManagerInterface $entityManager, \PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop) public function __construct(
{ EntityManagerInterface $entityManager,
\PSC\Component\ApiBundle\Hydrate\Shop $hydrateShop,
) {
$this->entityManager = $entityManager; $this->entityManager = $entityManager;
$this->hydrateShop = $hydrateShop; $this->hydrateShop = $hydrateShop;
} }
/** #[Response(
* get all by nr response: 200,
* description: 'account',
* @OA\Response( content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class)),
* response=200, )]
* description="account", #[RequestBody(
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Output::class)) description: 'This is a request body',
* ) content: new Model(type: PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class),
* @OA\RequestBody( )]
* description="This is a request body", #[Tag(name: 'Stockbooking')]
* @Model(type=\PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr\Input::class)) #[IsGranted('ROLE_API')]
* ) #[Security(name: 'ApiKeyAuth')]
* @OA\Tag(name="Stockbooking")
* @IsGranted("ROLE_API")
* @Security(name="ApiKeyAuth")
*/
#[Route(path: '/stockbooking/getallbynr', methods: ['POST'])] #[Route(path: '/stockbooking/getallbynr', methods: ['POST'])]
public function allAction(#[MapRequestPayload] Input $data): JsonResponse public function allAction(#[MapRequestPayload] Input $data): JsonResponse
{ {
$product = $this->entityManager $product = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Product')->createQueryBuilder('product') ->getRepository('PSC\Shop\EntityBundle\Entity\Product')
->createQueryBuilder('product')
->andWhere('product.nrIntern = :nr or product.nrExtern = :nr') ->andWhere('product.nrIntern = :nr or product.nrExtern = :nr')
->setParameter('nr', $data->nr) ->setParameter('nr', $data->nr)
->getQuery()->getOneOrNullResult(); ->getQuery()
->getOneOrNullResult();
if ($product) { if ($product) {
$bookings = $this->entityManager $bookings = $this->entityManager
->getRepository('PSC\Shop\EntityBundle\Entity\Stockbooking') ->getRepository('PSC\Shop\EntityBundle\Entity\Stockbooking')
->findByProduct($product); ->findByProduct($product);
$bookingsTemp = array(); $bookingsTemp = [];
/** @var \PSC\Shop\EntityBundle\Entity\Stockbooking $booking */ /** @var \PSC\Shop\EntityBundle\Entity\Stockbooking $booking */
foreach ($bookings as $booking) { foreach ($bookings as $booking) {
$contact = new Contact(); $contact = new Contact();
@ -85,6 +88,6 @@ class GetByNr extends AbstractController
return $this->json(new Output($bookingsTemp)); return $this->json(new Output($bookingsTemp));
} }
return $this->json(new NotFound("Product not found")); return $this->json(new NotFound('Product not found'));
} }
} }

View File

@ -3,32 +3,28 @@
namespace PSC\Component\ApiBundle\Api\System; namespace PSC\Component\ApiBundle\Api\System;
use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\DocumentManager;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use PSC\Component\ApiBundle\Model\Instance; use PSC\Component\ApiBundle\Model\Instance;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml;
class Info extends AbstractController class Info extends AbstractController
{ {
/** #[Tag(name: 'System')]
* Get system info. #[Response(
* response: 200,
* description: 'Returns system info',
* @Security(name="ApiKeyAuth") content: new JsonContent(ref: new Model(type: Instance::class)),
* @OA\Response( )]
* response=200,
* description="Returns system info",
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Instance::class))
* )
* @OA\Tag(name="System")
*/
#[Route(path: '/system/info', methods: ['GET'])] #[Route(path: '/system/info', methods: ['GET'])]
#[IsGranted('ROLE_API')] #[IsGranted('ROLE_API')]
public function infoAction(DocumentManager $documentManager): JsonResponse public function infoAction(DocumentManager $documentManager): JsonResponse
@ -38,14 +34,13 @@ class Info extends AbstractController
->getRepository(\PSC\Shop\EntityBundle\Document\Instance::class) ->getRepository(\PSC\Shop\EntityBundle\Document\Instance::class)
->findOneBy(['appId' => '1']); ->findOneBy(['appId' => '1']);
$data = new Instance(); $data = new Instance();
$data->sftpHost = getenv('ftpIp'); $data->sftpHost = getenv('ftpIp');
$data->ip = getenv('ftpIp'); $data->ip = getenv('ftpIp');
$data->sftpUserName = getenv('ftpUsername'); $data->sftpUserName = getenv('ftpUsername');
$data->sftpPassword = getenv('ftpPassword'); $data->sftpPassword = getenv('ftpPassword');
$data->sftpPort = getenv('ftpPort'); $data->sftpPort = getenv('ftpPort');
if($instance && $instance->isSmtpOwn()) { if ($instance && $instance->isSmtpOwn()) {
$data->smtpOwn = true; $data->smtpOwn = true;
} }

View File

@ -2,14 +2,16 @@
namespace PSC\Component\ApiBundle\Api\System; namespace PSC\Component\ApiBundle\Api\System;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use OpenApi\Attributes as OA;
use OpenApi\Annotations as OA; use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
class Version extends AbstractController class Version extends AbstractController
@ -21,17 +23,12 @@ class Version extends AbstractController
$this->kernel = $kernel; $this->kernel = $kernel;
} }
/** #[Response(
* Get Release version. response: 200,
* description: 'release version',
* content: new JsonContent(ref: new Model(type: PSC\Component\ApiBundle\Model\Version::class)),
* @OA\Response( )]
* response=200, #[Tag(name: 'System')]
* description="release version",
* @OA\JsonContent(ref=@Model(type=\PSC\Component\ApiBundle\Model\Version::class))
* )
* @OA\Tag(name="System")
*/
#[Route(path: '/system/version', methods: ['GET'])] #[Route(path: '/system/version', methods: ['GET'])]
public function versionAction(): JsonResponse public function versionAction(): JsonResponse
{ {

View File

@ -2,15 +2,12 @@
namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle; namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
final class Input final class Input
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $title; public string $title;
} }

View File

@ -2,22 +2,15 @@
namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle; namespace PSC\Component\ApiBundle\Dto\Account\GetParentByTitle;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
final class Output final class Output
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $parent; public string $parent;
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $parent_id; public int $parent_id;
} }

View File

@ -3,8 +3,10 @@
namespace PSC\Component\ApiBundle\Dto\Cms\Cms; namespace PSC\Component\ApiBundle\Dto\Cms\Cms;
use PSC\Component\ApiBundle\Model\Cms; use PSC\Component\ApiBundle\Model\Cms;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
class Output class Output
{ {
@ -14,17 +16,9 @@ class Output
$this->count = count($cms); $this->count = count($cms);
} }
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Cms::class)))]
* @var Cms[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Cms::class)))
*/
public array $data = []; public array $data = [];
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $count = 0; public int $count = 0;
} }

View File

@ -3,8 +3,9 @@
namespace PSC\Component\ApiBundle\Dto\Error; namespace PSC\Component\ApiBundle\Dto\Error;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class NotFound class NotFound
{ {
@ -13,8 +14,6 @@ class NotFound
$this->message = $message; $this->message = $message;
} }
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $message = ""; public string $message = "";
} }

View File

@ -3,8 +3,9 @@
namespace PSC\Component\ApiBundle\Dto\Error; namespace PSC\Component\ApiBundle\Dto\Error;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class PersistFailure class PersistFailure
{ {
@ -13,8 +14,6 @@ class PersistFailure
$this->message = $message; $this->message = $message;
} }
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $message = ""; public string $message = "";
} }

View File

@ -2,8 +2,10 @@
namespace PSC\Component\ApiBundle\Dto\Plugin\Plugins; namespace PSC\Component\ApiBundle\Dto\Plugin\Plugins;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
use PSC\Component\ApiBundle\Model\Plugin; use PSC\Component\ApiBundle\Model\Plugin;
class Output class Output
@ -14,17 +16,9 @@ class Output
$this->count = count($plugins); $this->count = count($plugins);
} }
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Plugin::class)))]
* @var Plugin[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Plugin::class)))
*/
public array $data = []; public array $data = [];
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $count = 0; public int $count = 0;
} }

View File

@ -3,8 +3,10 @@
namespace PSC\Component\ApiBundle\Dto\Shop\Shops; namespace PSC\Component\ApiBundle\Dto\Shop\Shops;
use PSC\Component\ApiBundle\Model\Shop; use PSC\Component\ApiBundle\Model\Shop;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
class Output class Output
{ {
@ -14,17 +16,9 @@ class Output
$this->count = count($shops); $this->count = count($shops);
} }
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop::class)))]
* @var Shop[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop::class)))
*/
public array $data = []; public array $data = [];
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $count = 0; public int $count = 0;
} }

View File

@ -2,43 +2,24 @@
namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr; namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Input class Input
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $product_nr = ""; public string $product_nr = "";
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $description = ""; public string $description = "";
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $amount = 0; public int $amount = 0;
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $delivery_nr = ""; public string $delivery_nr = "";
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $contact_id = 0; public int $contact_id = 0;
} }

View File

@ -2,16 +2,13 @@
namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr; namespace PSC\Component\ApiBundle\Dto\Stockbooking\CreateByNr;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use PSC\Component\ApiBundle\Model\Stockbooking; use PSC\Component\ApiBundle\Model\Stockbooking;
class Output class Output
{ {
/** #[Property(type: 'boolean')]
* @var bool
*
* @OA\Property(type="boolean")
*/
public bool $success = true; public bool $success = true;
} }

View File

@ -2,15 +2,12 @@
namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr; namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Input class Input
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $nr = ""; public string $nr = "";
} }

View File

@ -2,8 +2,10 @@
namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr; namespace PSC\Component\ApiBundle\Dto\Stockbooking\GetByNr;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
use PSC\Component\ApiBundle\Model\Stockbooking; use PSC\Component\ApiBundle\Model\Stockbooking;
class Output class Output
@ -14,17 +16,9 @@ class Output
$this->count = count($shops); $this->count = count($shops);
} }
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Stockbooking::class)))]
* @var Stockbooking[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Stockbooking::class)))
*/
public array $data = []; public array $data = [];
/** #[Property(type: 'integer')]
* @var int
*
* @OA\Property(type="integer")
*/
public int $count = 0; public int $count = 0;
} }

View File

@ -13,25 +13,18 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Cms class Cms
{ {
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
public int $id; public int $id;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255) public string $title = '';
*/ #[Property(type: 'string', maxLength: 255)]
public string $title = ""; public string $text = '';
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255) public string $shopId = '';
*/
public string $text = "";
/**
* @OA\Property(type="string", maxLength=255)
*/
public string $shopId = "";
} }

View File

@ -13,34 +13,23 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Instance class Instance
{ {
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $sftpUserName = ""; public string $sftpUserName = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $sftpPassword; public string $sftpPassword;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $sftpPort; public string $sftpPort;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $sftpHost; public string $sftpHost;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $ip; public string $ip;
/** #[Property(type: 'boolean')]
* @OA\Property(type="boolean")
*/
public bool $smtpOwn = false; public bool $smtpOwn = false;
} }

View File

@ -13,8 +13,9 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Plugin class Plugin
{ {
@ -24,16 +25,10 @@ class Plugin
$this->title = $title; $this->title = $title;
} }
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $uuid = ""; public string $uuid = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $title = ""; public string $title = "";
/** #[Property(type: 'boolean')]
* @OA\Property(type="boolean")
*/
public bool $installed = false; public bool $installed = false;
} }

View File

@ -13,62 +13,38 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
class Shop class Shop
{ {
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
public int $id = 0; public int $id = 0;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $uuid = ""; public string $uuid = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $name = ""; public string $name = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $basketField1 = ""; public string $basketField1 = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $basketField2 = ""; public string $basketField2 = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $logo1 = ""; public string $logo1 = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $logo2 = ""; public string $logo2 = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $browsericon = ""; public string $browsericon = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $basketPosField1 = ""; public string $basketPosField1 = "";
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $basketPosField2 = ""; public string $basketPosField2 = "";
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Component\ApiBundle\Model\Shop\Domain::class)))]
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Component\ApiBundle\Model\Shop\Domain::class)))
*/
public array $domains = []; public array $domains = [];
/** #[Property(type: 'boolean')]
* @OA\Property(type="boolean")
*/
public bool $disabled = false; public bool $disabled = false;
/** #[Property(type: 'boolean')]
* @OA\Property(type="boolean")
*/
public bool $private = false; public bool $private = false;
/** /**

View File

@ -13,8 +13,9 @@
namespace PSC\Component\ApiBundle\Model\Shop; namespace PSC\Component\ApiBundle\Model\Shop;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Domain class Domain
{ {
@ -25,16 +26,10 @@ class Domain
$this->ssl = $ssl; $this->ssl = $ssl;
} }
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
public int $id; public int $id;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $name = ""; public string $name = "";
/** #[Property(type: 'boolean')]
* @OA\Property(type="boolean")
*/
public bool $ssl = false; public bool $ssl = false;
} }

View File

@ -13,37 +13,24 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Stockbooking class Stockbooking
{ {
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $id; public string $id;
/** #[Property(type: 'object')]
* @OA\Property(type="object")
*/
public Contact $contact; public Contact $contact;
/** #[Property(type: 'object')]
* @OA\Property(type="object")
*/
public Product $product; public Product $product;
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
public int $amount = 0; public int $amount = 0;
/** #[Property(type: 'date')]
* @OA\Property(type="date")
*/
public \DateTime $created; public \DateTime $created;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $deliveryNumber; public string $deliveryNumber;
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $description; public string $description;
} }

View File

@ -13,17 +13,15 @@
namespace PSC\Component\ApiBundle\Model; namespace PSC\Component\ApiBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Attribute\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Version class Version
{ {
/** #[Property(type: 'string', maxLength: 255)]
* @OA\Property(type="string", maxLength=255)
*/
public string $datum = ""; public string $datum = "";
/**
* @OA\Property(type="string", maxLength=255) #[Property(type: 'string', maxLength: 255)]
*/
public string $release = ""; public string $release = "";
} }

View File

@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Translation\Exception\NotFoundResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException;

View File

@ -14,7 +14,7 @@
namespace PSC\Component\SteplayouterBundle\Calendar\Type; namespace PSC\Component\SteplayouterBundle\Calendar\Type;
use PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;

View File

@ -14,7 +14,7 @@
namespace PSC\Component\SteplayouterBundle\Calendar\Type; namespace PSC\Component\SteplayouterBundle\Calendar\Type;
use PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;

View File

@ -14,7 +14,7 @@
namespace PSC\Component\SteplayouterBundle\Calendar\Type; namespace PSC\Component\SteplayouterBundle\Calendar\Type;
use PSC\Component\SteplayouterBundle\Calendar\Type; use PSC\Component\SteplayouterBundle\Calendar\Type;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;

View File

@ -18,7 +18,7 @@ use PSC\Component\SteplayouterBundle\Calendar\Type\Quer;
use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch; use PSC\Component\SteplayouterBundle\Calendar\Type\Hoch;
use PSC\Component\SteplayouterBundle\Calendar\Design; use PSC\Component\SteplayouterBundle\Calendar\Design;
use PSC\Component\SteplayouterBundle\Calendar\Generator; use PSC\Component\SteplayouterBundle\Calendar\Generator;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;

View File

@ -13,7 +13,7 @@
namespace PSC\Component\SteplayouterBundle\Controller; namespace PSC\Component\SteplayouterBundle\Controller;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -36,7 +36,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Kernel; use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Translation\Exception\NotFoundResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException;

View File

@ -23,7 +23,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Translation\Exception\NotFoundResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException;
use PSC\Component\SteplayouterBundle\Config\Converter\ToArray; use PSC\Component\SteplayouterBundle\Config\Converter\ToArray;

View File

@ -25,7 +25,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException; use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Translation\Exception\NotFoundResourceException; use Symfony\Component\Translation\Exception\NotFoundResourceException;

View File

@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\FormError; use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -24,7 +24,7 @@ use Symfony\Component\Form\FormError;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;

View File

@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -26,7 +26,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -3,15 +3,13 @@
namespace PSC\Shop\AccountBundle\Dto\All; namespace PSC\Shop\AccountBundle\Dto\All;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
use PSC\Shop\ContactBundle\Model\Contact; use PSC\Shop\ContactBundle\Model\Contact;
class Output class Output
{ {
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\AccountBundle\Model\Account::class)))]
* @var Contact[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\AccountBundle\Model\Account::class)))
*/
public array $data = []; public array $data = [];
} }

View File

@ -3,33 +3,24 @@
namespace PSC\Shop\AccountBundle\Model; namespace PSC\Shop\AccountBundle\Model;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Account class Account
{ {
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
private int $id = 0; private int $id = 0;
/** #[Property(type: 'integer')]
* @OA\Property(type="integer")
*/
private int $uid = 0; private int $uid = 0;
/** #[Property(type: 'string')]
* @OA\Property(type="string")
*/
private string $uuid = ""; private string $uuid = "";
/** #[Property(type: 'string')]
* @OA\Property(type="string")
*/
private string $appendix; private string $appendix;
/** #[Property(type: 'string')]
* @OA\Property(type="string")
*/
private string $title; private string $title;
public function getUuid(): string public function getUuid(): string

View File

@ -10,41 +10,82 @@ use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag; use OpenApi\Attributes\Tag;
use PSC\Shop\BasketBundle\Dto\Layouter\Input; use PSC\Shop\BasketBundle\Dto\Layouter\Input;
use PSC\Shop\BasketBundle\Dto\Legacy\Output; use PSC\Shop\BasketBundle\Dto\Legacy\Output;
use PSC\Shop\EntityBundle\Entity\LayouterSession;
use PSC\Shop\EntityBundle\Repository\LayouterSessionRepository;
use PSC\Shop\EntityBundle\Repository\ProductRepository;
use Ramsey\Uuid\Nonstandard\Uuid;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Component\Routing\Attribute\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
use TP_Layouter_Item;
class Save extends AbstractController class Save extends AbstractController
{ {
public function __construct( public function __construct(
private readonly EntityManagerInterface $entityManager, private readonly EntityManagerInterface $entityManager,
private readonly LayouterSessionRepository $layouterSessionRepository,
private readonly EventDispatcherInterface $eventDispatcher, private readonly EventDispatcherInterface $eventDispatcher,
private readonly ProductRepository $productRepository,
private readonly TokenStorageInterface $tokenStorage, private readonly TokenStorageInterface $tokenStorage,
) {} ) {}
/**
* change temp basketitem
*
* @deprecated
*/
#[Tag(name: 'Basket')] #[Tag(name: 'Basket')]
#[Response( #[Response(response: 200, description: 'basket', content: new JsonContent(ref: new Model(type: Output::class)))]
response: 200, #[RequestBody(description: 'This is a request body', content: new Model(type: Input::class))]
description: 'basket',
content: new JsonContent(ref: new Model(type: Output::class))
)]
#[RequestBody(
description: 'This is a request body',
content: new Model(type: Input::class)
)]
#[Route(path: '/layouter/save', methods: ['POST'])] #[Route(path: '/layouter/save', methods: ['POST'])]
public function save(#[MapRequestPayload] Input $data): JsonResponse public function save(#[MapRequestPayload] Input $data): JsonResponse
{ {
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Item.php'; include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Item.php';
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Basket_Collection.php'; include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Basket_Collection.php';
include_once __DIR__ . '/../../../../EntityBundle/Lagacy/TP_Util.php'; include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Util.php';
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layouter_Item.php';
include_once __DIR__ . '/../../../EntityBundle/Lagacy/TP_Layoutersession.php';
$product = $this->productRepository->findOneBy(['uuid' => $data->productUUId]);
if ($this->tokenStorage->getToken()) {
$row = new LayouterSession();
$row->setUuid(Uuid::uuid4()->toString());
$row->setContactId(
$this->tokenStorage
->getToken()
->getUser()
->getId(),
);
$row->setProductId($data->productUUId);
$row->setTitle($product->getTitle());
$row->setLayouterModus($data->layouterModus);
// TODO: Store uploadedFiles in session data
$this->entityManager->persist($row);
return $this->json([
'success' => true,
'layouterUUId' => $row->getUuid(),
'auth' => true,
'user' => $this->tokenStorage
->getToken()
->getUser()
->getUsername(),
]);
}
$session = new TP_Layouter_Item();
$session->setTitle($product->getTitle());
$session->setArticleId(Uuid::uuid4()->toString());
$session->setOrgArticleId($data->productUUId);
$session->setIsEdit(true);
$session->setUpdated(date('Y-m-d H:i:s'));
$session->setLayouterModus($data->layouterModus);
// Store uploaded files in session
$_SESSION['Layoutersession']['data'][$session->getArticleId()] = $session;
return $this->json([
'success' => true,
'auth' => false,
'layouterUUId' => $session->getArticleId(),
]);
} }
} }

View File

@ -0,0 +1,91 @@
<?php
namespace PSC\Shop\BasketBundle\Api\Layouter;
use Doctrine\ODM\MongoDB\DocumentManager;
use Nelmio\ApiDocBundle\Attribute\Security;
use OpenApi\Attributes\MediaType;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\RequestBody;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Schema;
use OpenApi\Attributes\Tag;
use PSC\Shop\MediaBundle\Document\Folder;
use PSC\Shop\MediaBundle\Document\Media;
use PSC\Shop\MediaBundle\Helper\MediaManager;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Attribute\Route;
class Upload extends AbstractController
{
#[RequestBody(description: 'PDF file for layouter', content: [
new MediaType(
'multipart/form-data',
new Schema(
properties: [
new Property(
property: 'file',
format: 'binary',
type: 'file',
description: 'PDF file',
),
new Property(
property: 'fileName',
type: 'string',
description: 'Original file name',
),
new Property(
property: 'folder',
type: 'string',
description: 'Folder',
),
],
required: ['file'],
),
),
])]
#[Response(response: 200, description: 'File uploaded successfully')]
#[Response(response: 400, description: 'Bad request - no file provided')]
#[Route(path: '/layouter/upload', methods: ['POST'])]
#[Tag(name: 'Basket')]
public function upload(MediaManager $mediaManager, DocumentManager $documentManager, Request $req): JsonResponse
{
$file = $req->files->get('file');
if (!$file) {
return $this->json(
data: ['error' => 'No file provided'],
status: JsonResponse::HTTP_BAD_REQUEST,
);
}
try {
$selectedFolder = $documentManager->getRepository(Folder::class)->findOneBy(['_id' => $req->get('folder')]);
$handler = $mediaManager->getHandlerForType('pdf');
$media = new Media();
$media->setContent($file);
$media->setFolder($selectedFolder);
$handler->prepareMedia($media);
// Store additional metadata
$media->setTitle($req->get('fileName', $file->getClientOriginalName()));
$documentManager->persist($media);
$documentManager->flush();
return $this->json([
'success' => true,
'uuid' => $media->getId(),
'url' => $media->getUrl(),
]);
} catch (\Exception $e) {
return $this->json(
data: ['error' => 'Upload failed: ' . $e->getMessage()],
status: JsonResponse::HTTP_INTERNAL_SERVER_ERROR,
);
}
}
}

View File

@ -2,6 +2,7 @@
namespace PSC\Shop\BasketBundle\Dto\Layouter; namespace PSC\Shop\BasketBundle\Dto\Layouter;
use OpenApi\Attributes\Items;
use OpenApi\Attributes\Property; use OpenApi\Attributes\Property;
class Input class Input
@ -9,6 +10,6 @@ class Input
#[Property(type: 'string')] #[Property(type: 'string')]
public string $productUUId = ''; public string $productUUId = '';
#[Property(type: 'string')] #[Property(type: 'integer')]
public string $layouterUUId = ''; public int $layouterModus = 0;
} }

View File

@ -34,7 +34,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -24,7 +24,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -19,7 +19,7 @@ use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -43,7 +43,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -13,7 +13,7 @@ use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
class Crud extends AbstractController { class Crud extends AbstractController {

View File

@ -13,7 +13,7 @@ use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
class GetAllForType extends AbstractController class GetAllForType extends AbstractController

View File

@ -13,7 +13,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;

View File

@ -14,7 +14,7 @@ use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
class AllByShop extends AbstractController class AllByShop extends AbstractController

View File

@ -14,7 +14,7 @@ use setasign\Fpdi\PdfReader\DataStructure\Rectangle;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;
class Crud extends AbstractController { class Crud extends AbstractController {

View File

@ -5,7 +5,11 @@ namespace PSC\Shop\ContactBundle\Api;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Shop\ContactBundle\Dto\Exists\Input; use PSC\Shop\ContactBundle\Dto\Exists\Input;
use PSC\Shop\ContactBundle\Dto\Exists\Output; use PSC\Shop\ContactBundle\Dto\Exists\Output;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
@ -14,9 +18,9 @@ use PSC\Component\ApiBundle\Model\Shop;
use PSC\Component\ApiBundle\Model\Shop\Domain; use PSC\Component\ApiBundle\Model\Shop\Domain;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -35,16 +39,16 @@ class Exists extends AbstractController
/** /**
* User exists in database * User exists in database
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="contact", * description: 'contact',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Output::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Input::class)) * content: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Input::class)
* ) * )]
* @OA\Tag(name="Contact") #[Tag(name: 'Contact')]
* @IsGranted("ROLE_API") * @IsGranted("ROLE_API")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
*/ */
@ -71,16 +75,16 @@ class Exists extends AbstractController
/** /**
* User exists in database * User exists in database
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="contact", * description: 'contact',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\ContactBundle\Dto\Exists\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\ContactBundle\Dto\Exists\Output::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\ContactBundle\Dto\ExistsWithPassword\Input::class)) * content: new Model(type: PSC\Shop\ContactBundle\Dto\ExistsWithPassword\Input::class)
* ) * )]
* @OA\Tag(name="Contact") #[Tag(name: 'Contact')]
* @IsGranted("ROLE_API") * @IsGranted("ROLE_API")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
*/ */

View File

@ -13,7 +13,7 @@ use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;

View File

@ -7,7 +7,7 @@ use Nelmio\ApiDocBundle\Annotation\Security;
use PSC\Shop\ContactBundle\Dto\Refresh\Output; use PSC\Shop\ContactBundle\Dto\Refresh\Output;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface; use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
use OpenApi\Attributes as OA; use OpenApi\Attributes as OA;

View File

@ -15,7 +15,7 @@ use PSC\System\SettingsBundle\Service\History;
use PSC\System\SettingsBundle\Service\Log; use PSC\System\SettingsBundle\Service\Log;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -33,7 +33,7 @@ use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -44,7 +44,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -21,7 +21,7 @@ use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -3,15 +3,13 @@
namespace PSC\Shop\ContactBundle\Dto\Address\GetAllForType; namespace PSC\Shop\ContactBundle\Dto\Address\GetAllForType;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
use PSC\Shop\ContactBundle\Model\Address; use PSC\Shop\ContactBundle\Model\Address;
class Output class Output
{ {
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ContactBundle\Model\Address::class)))]
* @var Address[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ContactBundle\Model\Address::class)))
*/
public array $data = []; public array $data = [];
} }

View File

@ -3,15 +3,13 @@
namespace PSC\Shop\ContactBundle\Dto\All; namespace PSC\Shop\ContactBundle\Dto\All;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Items;
use PSC\Shop\ContactBundle\Model\Contact; use PSC\Shop\ContactBundle\Model\Contact;
class Output class Output
{ {
/** #[Property(type: 'array', items: new Items(ref: new Model(type: PSC\Shop\ContactBundle\Model\Contact::class)))]
* @var Contact[]
*
* @OA\Property(type="array", @OA\Items(ref=@Model(type=\PSC\Shop\ContactBundle\Model\Contact::class)))
*/
public array $data = []; public array $data = [];
} }

View File

@ -3,14 +3,11 @@
namespace PSC\Shop\ContactBundle\Dto\Exists; namespace PSC\Shop\ContactBundle\Dto\Exists;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Input class Input
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $username = ""; public string $username = "";
} }

View File

@ -3,14 +3,11 @@
namespace PSC\Shop\ContactBundle\Dto\Exists; namespace PSC\Shop\ContactBundle\Dto\Exists;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Output class Output
{ {
/** #[Property(type: 'boolean')]
* @var bool
*
* @OA\Property(type="boolean")
*/
public string $exists; public string $exists;
} }

View File

@ -3,21 +3,14 @@
namespace PSC\Shop\ContactBundle\Dto\ExistsWithPassword; namespace PSC\Shop\ContactBundle\Dto\ExistsWithPassword;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Input class Input
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $username = ""; public string $username = "";
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $password = ""; public string $password = "";
} }

View File

@ -3,14 +3,11 @@
namespace PSC\Shop\ContactBundle\Dto\Login; namespace PSC\Shop\ContactBundle\Dto\Login;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Output class Output
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $token; public string $token;
} }

View File

@ -3,29 +3,18 @@
namespace PSC\Shop\ContactBundle\Dto\Refresh; namespace PSC\Shop\ContactBundle\Dto\Refresh;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
class Output class Output
{ {
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $token; public string $token;
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $userName; public string $userName;
/** #[Property(type: 'string')]
* @var string
*
* @OA\Property(type="string")
*/
public string $email; public string $email;
} }

View File

@ -22,7 +22,7 @@ use PSC\Shop\EntityBundle\Entity\ShopAccount;
use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\ShopContact;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -14,7 +14,7 @@ use PSC\Shop\EntityBundle\Entity\Shop;
use PSC\Shop\EntityBundle\Entity\ShopAccount; use PSC\Shop\EntityBundle\Entity\ShopAccount;
use PSC\Shop\EntityBundle\Entity\ShopContact; use PSC\Shop\EntityBundle\Entity\ShopContact;
use Ramsey\Uuid\Uuid; use Ramsey\Uuid\Uuid;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;

View File

@ -17,6 +17,29 @@ class LayouterSession
#[ORM\Column(name: 'uuid', type: 'string', length: 255, nullable: true)] #[ORM\Column(name: 'uuid', type: 'string', length: 255, nullable: true)]
protected string $uuid; protected string $uuid;
#[ORM\Column(name: 'layouter_modus', type: 'integer')]
protected int $layouterModus = 0;
#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: true)]
protected string $title;
#[ORM\Column(name: 'org_article_id', type: 'integer')]
protected string $productId;
#[ORM\Column(name: 'contact_id', type: 'integer')]
protected string $contactId;
#[ORM\Column(name: 'created', type: 'datetime', nullable: true)]
protected \DateTime $createdAt;
#[ORM\Column(name: 'updated', type: 'datetime', nullable: true)]
protected \DateTime $updatedAt;
public function __construct()
{
$this->createdAt = new \DateTime();
$this->updatedAt = new \DateTime();
}
public function getUid(): int public function getUid(): int
{ {
return $this->uid; return $this->uid;
@ -36,4 +59,64 @@ class LayouterSession
{ {
$this->uuid = $uuid; $this->uuid = $uuid;
} }
public function getLayouterModus(): int
{
return $this->layouterModus;
}
public function setLayouterModus(int $layouterModus): void
{
$this->layouterModus = $layouterModus;
}
public function getTitle(): string
{
return $this->title;
}
public function setTitle(string $title): void
{
$this->title = $title;
}
public function getProductId(): string
{
return $this->productId;
}
public function setProductId(string $productId): void
{
$this->productId = $productId;
}
public function getContactId(): string
{
return $this->contactId;
}
public function setContactId(string $contactId): void
{
$this->contactId = $contactId;
}
public function getCreatedAt(): \DateTime
{
return $this->createdAt;
}
public function setCreatedAt(\DateTime $createdAt): void
{
$this->createdAt = $createdAt;
}
public function getUpdatedAt(): \DateTime
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTime $updatedAt): void
{
$this->updatedAt = $updatedAt;
}
} }

View File

@ -0,0 +1,257 @@
<?php
if (!class_exists('TP_Layouter_Item')) {
class TP_Layouter_Item
{
private $ref = '';
private $kst = '';
private $templatePrintContactId = 0;
private $_config_xml = '';
private $_page_templates = '';
private $_pages_xml = '';
private $_page_objects = '';
private $_title = '';
private $_xslfo = '';
private $_preview_xslfo = '';
private $_extend_preview_xslfo = '';
private $_article_id = '';
private $_org_article_id = '';
private $is_edit = false;
private $preview_path = '';
private $designer_xml = '';
private $template_print_id = '';
public $layouter_modus = 1;
private $updated;
public function setTemplatePrintId($var)
{
$this->template_print_id = $var;
}
public function getTemplatePrintId()
{
return $this->template_print_id;
}
public function setPreviewPath($xml)
{
$this->preview_path = $xml;
}
public function getPreviewPath()
{
return $this->preview_path;
}
public function setDesignerXML($xml)
{
$this->designer_xml = $xml;
$this->updated = date('Y-m-d H:i:s');
}
public function getDesignerXML()
{
return $this->designer_xml;
}
public function setIsEdit()
{
$this->is_edit = true;
}
public function getIsEdit()
{
return $this->is_edit;
}
public function getArticleId()
{
return $this->_article_id;
}
public function setArticleId($id)
{
$this->_article_id = $id;
}
public function getOrgArticleId()
{
return $this->_org_article_id;
}
public function setOrgArticleId($id)
{
$this->_org_article_id = $id;
}
public function getPageObjects()
{
return $this->_page_objects;
}
public function setPageObjects($xml)
{
$this->_page_objects = $xml;
}
public function setTitle($xml)
{
$this->_title = $xml;
}
public function getTitle()
{
return $this->_title;
}
public function getPageTemplates()
{
return $this->_page_templates;
}
public function setPageTemplates($xml)
{
$this->_page_templates = $xml;
}
public function getConfigXml()
{
return $this->_config_xml;
}
public function setConfigXml($xml)
{
$this->_config_xml = $xml;
}
public function getPagesXml()
{
return $this->_pages_xml;
}
public function setPagesXml($xml)
{
$this->_pages_xml = $xml;
}
public function getXslFo()
{
return $this->_xslfo;
}
public function setXslFo($xml)
{
$this->_xslfo = $xml;
}
public function getPreviewXslFo()
{
return $this->_preview_xslfo;
}
public function setPreviewXslFo($xml)
{
$this->_preview_xslfo = $xml;
}
public function getExtendPreviewXslFo()
{
return $this->_extend_preview_xslfo;
}
public function setExtendPreviewXslFo($xml)
{
$this->_extend_preview_xslfo = $xml;
}
public function getLayouterModus()
{
return $this->layouter_modus;
}
public function setLayouterModus($layouter_modus)
{
$this->layouter_modus = $layouter_modus;
}
/**
* @return bool|string
*/
public function getUpdated()
{
return $this->updated;
}
/**
* @param bool|string $updated
*/
public function setUpdated($updated)
{
$this->updated = $updated;
}
/**
* @return int
*/
public function getTemplatePrintContactId()
{
return $this->templatePrintContactId;
}
/**
* @param int $templatePrintContactId
*/
public function setTemplatePrintContactId($templatePrintContactId)
{
$this->templatePrintContactId = $templatePrintContactId;
}
/**
* @return string
*/
public function getRef()
{
return $this->ref;
}
/**
* @param string $ref
*/
public function setRef($ref)
{
$this->ref = $ref;
}
/**
* @return string
*/
public function getKst()
{
return $this->kst;
}
/**
* @param string $kst
*/
public function setKst($kst)
{
$this->kst = $kst;
}
}
}

View File

@ -0,0 +1,69 @@
<?php
require_once __DIR__ . '/TP_Layouter_Item.php';
if (!class_exists('TP_Layoutersession')) {
class TP_Layoutersession implements IteratorAggregate, Countable
{
/**
* Collection items
*
* @var array
*/
protected $_items = [];
/**
* Item object class name
*
* @var string
*/
protected $_itemObjectClass = 'Varien_Object';
/**
* Current page number for items pager
*
* @var int
*/
protected $_curPage = 1;
/**
* Pager page size
*
* if page size is false, then we works with all items
*
* @var int || false
*/
protected $_pageSize = false;
/**
* Total items number
*
* @var int
*/
protected $_totalRecords;
/**
* Loading state flag
*
* @var bool
*/
protected $_isCollectionLoaded;
public function __construct() {}
/**
* Implementation of IteratorAggregate::getIterator()
*/
#[\Override]
public function getIterator(): ArrayIterator
{
return new ArrayIterator($this->_items);
}
/**
* Retireve count of collection loaded items
*
* @return int
*/
#[\Override]
public function count(): int
{
return count($this->_items);
}
}
}

View File

@ -2,8 +2,14 @@
namespace PSC\Shop\EntityBundle\Repository; namespace PSC\Shop\EntityBundle\Repository;
use Doctrine\ORM\EntityRepository; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
use PSC\Shop\EntityBundle\Entity\LayouterSession;
class LayouterSessionRepository extends EntityRepository class LayouterSessionRepository extends ServiceEntityRepository
{ {
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, LayouterSession::class);
}
} }

View File

@ -5,7 +5,12 @@ namespace PSC\Shop\MediaBundle\Api;
use Doctrine\ODM\MongoDB\DocumentManager; use Doctrine\ODM\MongoDB\DocumentManager;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Property;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Shop\MediaBundle\Document\Embed\Variant; use PSC\Shop\MediaBundle\Document\Embed\Variant;
use PSC\Shop\MediaBundle\Document\Media; use PSC\Shop\MediaBundle\Document\Media;
use PSC\Shop\MediaBundle\Helper\MediaManager; use PSC\Shop\MediaBundle\Helper\MediaManager;
@ -54,7 +59,7 @@ class UploadVariant extends AbstractController
* ) * )
* ) * )
* ) * )
* @OA\Tag(name="Media") #[Tag(name: 'Media')]
* @IsGranted("ROLE_USER") * @IsGranted("ROLE_USER")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -14,7 +14,7 @@ use PSC\Shop\MediaBundle\Helper\FolderManager;
use PSC\Shop\MediaBundle\Helper\Media\AbstractMediaHandler; use PSC\Shop\MediaBundle\Helper\Media\AbstractMediaHandler;
use PSC\Shop\MediaBundle\Helper\MediaManager; use PSC\Shop\MediaBundle\Helper\MediaManager;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;

View File

@ -37,7 +37,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -32,7 +32,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -14,10 +14,10 @@
namespace PSC\Shop\MediaBundle\Document; namespace PSC\Shop\MediaBundle\Document;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany; use Doctrine\ODM\MongoDB\Mapping\Annotations\EmbedMany;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Field; use Doctrine\ODM\MongoDB\Mapping\Annotations\Field;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Id; use Doctrine\ODM\MongoDB\Mapping\Annotations\Id;
use Doctrine\ODM\MongoDB\Mapping\Annotations\Document;
use Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceOne; use Doctrine\ODM\MongoDB\Mapping\Annotations\ReferenceOne;
use Doctrine\ODM\MongoDB\PersistentCollection; use Doctrine\ODM\MongoDB\PersistentCollection;
use PSC\Shop\MediaBundle\Document\Embed\Variant; use PSC\Shop\MediaBundle\Document\Embed\Variant;
@ -41,67 +41,67 @@ class Media implements MediaInterface
#[Field(type: 'string')] #[Field(type: 'string')]
protected $title; protected $title;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $description; protected $description;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $copyright; protected $copyright;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $location; protected $location;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $contentType; protected $contentType;
/** /**
* @var array * @var array
*/ */
#[Field(type: 'hash')] #[Field(type: 'hash')]
protected $metadata = array(); protected $metadata = [];
/** /**
* @var \DateTime * @var \DateTime
*/ */
#[Field(type: 'date')] #[Field(type: 'date')]
protected $createdAt; protected $createdAt;
/** /**
* @var \DateTime * @var \DateTime
*/ */
#[Field(type: 'date')] #[Field(type: 'date')]
protected $updatedAt; protected $updatedAt;
/** /**
* @var Folder * @var Folder
*/ */
#[ReferenceOne(targetDocument: 'PSC\Shop\MediaBundle\Document\Folder')] #[ReferenceOne(targetDocument: 'PSC\Shop\MediaBundle\Document\Folder')]
protected $folder; protected $folder;
/** /**
* @var mixed * @var mixed
*/ */
protected $content; protected $content;
/** /**
* @var int * @var int
*/ */
#[Field(type: 'int')] #[Field(type: 'int')]
protected $filesize; protected $filesize;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $url; protected $url;
/** /**
* @var string * @var string
*/ */
#[Field(type: 'string')] #[Field(type: 'string')]
protected $originalFilename; protected $originalFilename;
/** /**
* @var bool * @var bool
*/ */
#[Field(type: 'bool')] #[Field(type: 'bool')]
protected $deleted; protected $deleted;
#[Field(type: 'string')] #[Field(type: 'string')]
@ -112,6 +112,9 @@ class Media implements MediaInterface
protected $providerReference; protected $providerReference;
#[Field(type: 'hash')] #[Field(type: 'hash')]
protected $providerMetadata = []; protected $providerMetadata = [];
#[Field(type: 'hash')]
protected array $additionalInfos = [];
public function __construct() public function __construct()
{ {
$this->setCreatedAt(new \DateTime()); $this->setCreatedAt(new \DateTime());
@ -151,6 +154,7 @@ class Media implements MediaInterface
{ {
$this->shop = $shop; $this->shop = $shop;
} }
/** /**
* @return string * @return string
*/ */
@ -158,13 +162,13 @@ class Media implements MediaInterface
{ {
$size = $this->filesize; $size = $this->filesize;
if ($size < 1024) { if ($size < 1024) {
return $size . "b"; return $size . 'b';
} else { } else {
$help = $size / 1024; $help = $size / 1024;
if ($help < 1024) { if ($help < 1024) {
return round($help, 1) . "kb"; return round($help, 1) . 'kb';
} else { } else {
return round(($help / 1024), 1) . "mb"; return round($help / 1024, 1) . 'mb';
} }
} }
} }
@ -242,7 +246,7 @@ class Media implements MediaInterface
public function getContentTypeShort() public function getContentTypeShort()
{ {
$contentType = $this->contentType; $contentType = $this->contentType;
$array = explode("/", $contentType); $array = explode('/', $contentType);
$contentType = end($array); $contentType = end($array);
return $contentType; return $contentType;
} }
@ -307,7 +311,7 @@ class Media implements MediaInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setCreatedAt(\DateTime $createdAt = null) public function setCreatedAt(null|\DateTime $createdAt = null)
{ {
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
} }
@ -325,7 +329,7 @@ class Media implements MediaInterface
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function setUpdatedAt(\DateTime $updatedAt = null) public function setUpdatedAt(null|\DateTime $updatedAt = null)
{ {
$this->updatedAt = $updatedAt; $this->updatedAt = $updatedAt;
} }
@ -732,7 +736,7 @@ class Media implements MediaInterface
/** /**
* @inheritDoc * @inheritDoc
*/ */
public function setCdnFlushAt(\DateTime $cdnFlushAt = null) public function setCdnFlushAt(null|\DateTime $cdnFlushAt = null)
{ {
// TODO: Implement setCdnFlushAt() method. // TODO: Implement setCdnFlushAt() method.
} }
@ -847,4 +851,14 @@ class Media implements MediaInterface
{ {
return $this->variants; return $this->variants;
} }
public function getAdditionalInfos(): array
{
return $this->additionalInfos;
}
public function setAdditionalInfos(array $additionalInfos): void
{
$this->additionalInfos = $additionalInfos;
}
} }

View File

@ -30,7 +30,7 @@ use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -21,7 +21,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Core\SecurityContext; use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bridge\Twig\Attribute\Template;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;

View File

@ -6,7 +6,10 @@ use Doctrine\ORM\EntityManagerInterface;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use PSC\Shop\EntityBundle\Entity\Order; use PSC\Shop\EntityBundle\Entity\Order;
use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input;
use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output;
@ -15,7 +18,7 @@ use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
class Create extends AbstractController class Create extends AbstractController
{ {
@ -32,12 +35,12 @@ class Create extends AbstractController
/** /**
* create action for order * create action for order
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="order", * description: 'order',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class))
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,15 +5,19 @@ namespace PSC\Shop\OrderBundle\Api\Order;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Model\Order as ModelOrder; use PSC\Shop\OrderBundle\Model\Order as ModelOrder;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -32,16 +36,16 @@ class Calc extends AbstractController
/** /**
* create order * create order
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input; use PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\OrderBundle\Service\Order;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -33,16 +37,16 @@ class ChangeContact extends AbstractController
/** /**
* get order by uuid * get order by uuid
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\ChangeContact\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Dto\Order\Copy\Input; use PSC\Shop\OrderBundle\Dto\Order\Copy\Input;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\OrderBundle\Service\Order;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -33,16 +37,16 @@ class Copy extends AbstractController
/** /**
* get order by uuid * get order by uuid
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Copy\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Copy\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Model\Order as ModelOrder; use PSC\Shop\OrderBundle\Model\Order as ModelOrder;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\OrderBundle\Service\Order;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -33,16 +37,16 @@ class Create extends AbstractController
/** /**
* create order * create order
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new Model(type: PSC\Shop\OrderBundle\Model\Order::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input; use PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\OrderBundle\Service\Order;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -33,16 +37,16 @@ class GetOneByUuid extends AbstractController
/** /**
* get order by uuid * get order by uuid
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Model\Order::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Model\Order::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\GetOneByUuid\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

View File

@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Order\Package;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input; use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input;
use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output; use PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output;
@ -15,9 +19,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -34,16 +38,16 @@ class Nr extends AbstractController
/** /**
* change packagenumber for order * change packagenumber for order
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="order", * description: 'order',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Output::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Package\Nr\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_API") * @IsGranted("ROLE_API")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
*/ */

View File

@ -5,7 +5,11 @@ namespace PSC\Shop\OrderBundle\Api\Order\Status;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Component\ApiBundle\Dto\Error\NotFound; use PSC\Component\ApiBundle\Dto\Error\NotFound;
use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input;
use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output; use PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output;
@ -15,9 +19,9 @@ use PSC\Shop\QueueBundle\Service\Event\Manager;
use PSC\System\SettingsBundle\Service\Shop; use PSC\System\SettingsBundle\Service\Shop;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Security\Http\Attribute\IsGranted as SymfonyIsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted as SymfonyIsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -37,16 +41,16 @@ class Change extends AbstractController
/** /**
* change status for order * change status for order
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="order", * description: 'order',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Output::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\Change\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
*/ */
#[SymfonyIsGranted('ROLE_API')] #[SymfonyIsGranted('ROLE_API')]

View File

@ -5,16 +5,20 @@ namespace PSC\Shop\OrderBundle\Api\Order\Status;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use OpenApi\Attributes\RequestBody;
use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input; use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input;
use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output; use PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output;
use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject; use PSC\Shop\OrderBundle\Model\Order\Position\DummyProductTypeObject;
use PSC\Shop\OrderBundle\Service\Order; use PSC\Shop\OrderBundle\Service\Order;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response as HttpResponse;
use Symfony\Component\HttpKernel\KernelInterface; use Symfony\Component\HttpKernel\KernelInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
use Symfony\Component\HttpKernel\Attribute\MapRequestPayload; use Symfony\Component\HttpKernel\Attribute\MapRequestPayload;
@ -33,16 +37,16 @@ class GetAllByStatus extends AbstractController
/** /**
* get orders by status * get orders by status
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Output::class))
* ) * )]
* @OA\RequestBody( #[RequestBody(
* description="This is a request body", * description: 'This is a request body',
* @Model(type=\PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input::class)) * content: new Model(type: PSC\Shop\OrderBundle\Dto\Order\Status\GetAllByStatus\Input::class)
* ) * )]
* @OA\Tag(name="Order") #[Tag(name: 'Order')]
* @IsGranted("ROLE_API") * @IsGranted("ROLE_API")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
*/ */

View File

@ -7,8 +7,11 @@ use PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\Attribute\TaggedIterator; use Symfony\Component\DependencyInjection\Attribute\TaggedIterator;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
@ -22,12 +25,12 @@ class CheckDownload extends AbstractController
/** /**
* get order by uuid * get order by uuid
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\CheckDownload\Output::class))
* ) * )]
* @OA\Tag(name="Position") #[Tag(name: 'Position')]
*/ */
#[Route(path: '/position/checkdownload/{posUuid}', methods: ['GET'])] #[Route(path: '/position/checkdownload/{posUuid}', methods: ['GET'])]
public function checkDownload(string $posUuid): JsonResponse public function checkDownload(string $posUuid): JsonResponse

View File

@ -7,8 +7,11 @@ use PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output;
use PSC\Shop\OrderBundle\Interface\List\Position; use PSC\Shop\OrderBundle\Interface\List\Position;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Attribute\Route;
use OpenApi\Annotations as OA; use OpenApi\Attributes as OA;
use OpenApi\Attributes\Response;
use OpenApi\Attributes\Tag;
use OpenApi\Attributes\JsonContent;
use Nelmio\ApiDocBundle\Annotation\Model; use Nelmio\ApiDocBundle\Annotation\Model;
use Nelmio\ApiDocBundle\Annotation\Security; use Nelmio\ApiDocBundle\Annotation\Security;
use Symfony\Component\Security\Http\Attribute\IsGranted; use Symfony\Component\Security\Http\Attribute\IsGranted;
@ -25,12 +28,12 @@ class GetPluginListDisplay extends AbstractController
/** /**
* get order by uuid * get order by uuid
* *
* @OA\Response( #[Response(
* response=200, * response: 200,
* description="orders", * description: 'orders',
* @OA\JsonContent(ref=@Model(type=\PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output::class)) * content: new JsonContent(ref: new Model(type: PSC\Shop\OrderBundle\Dto\Position\GetPluginListDisplay\Output::class))
* ) * )]
* @OA\Tag(name="Position") #[Tag(name: 'Position')]
* @IsGranted("ROLE_SHOP") * @IsGranted("ROLE_SHOP")
* @Security(name="ApiKeyAuth") * @Security(name="ApiKeyAuth")
* @Security(name="Bearer") * @Security(name="Bearer")

Some files were not shown because too many files have changed in this diff Show More