add Basic Shopware API

This commit is contained in:
Marko
2022-06-27 10:50:23 +02:00
parent f35f8adceb
commit f2107b024e
12 changed files with 723 additions and 27 deletions

View File

@@ -2,13 +2,18 @@
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use App\Repository\OrdersRepository;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiResource;
#[ORM\Entity(repositoryClass: OrdersRepository::class)]
#[ApiResource(itemOperations: ["GET"])]
#[ApiResource(
itemOperations: ["GET"],
description: "Manage orders",
normalizationContext: ["groups" => "read"]
)]
class Orders
{
#[ORM\Id]
@@ -19,12 +24,16 @@ class Orders
/** Shopware Order ID */
#[ORM\Column(type: 'string', length: 255)]
#[Assert\NotBlank]
#[ApiProperty(example: "467e9804347c4071942c99b55b108142")]
#[Group("read")]
private $order_id;
#[ORM\Column(type: 'integer')]
#[ApiProperty(example: "1")]
private $status;
#[ORM\Column(type: 'json')]
#[ApiProperty(writable: false)]
private $data = [];
public function getId(): ?int