feat : Expedition dev back-end WIP
This commit is contained in:
@@ -7,8 +7,6 @@ namespace App\Entity;
|
||||
use ApiPlatform\Metadata\ApiResource;
|
||||
use ApiPlatform\Metadata\Get;
|
||||
use ApiPlatform\Metadata\GetCollection;
|
||||
use ApiPlatform\Metadata\Patch;
|
||||
use ApiPlatform\Metadata\Post;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Serializer\Attribute\Groups;
|
||||
|
||||
@@ -23,15 +21,7 @@ use Symfony\Component\Serializer\Attribute\Groups;
|
||||
new GetCollection(
|
||||
normalizationContext: ['groups' => ['bovin-shipment:read']],
|
||||
),
|
||||
new Post(
|
||||
normalizationContext: ['groups' => ['bovin-shipment:read']],
|
||||
denormalizationContext: ['groups' => ['bovin-shipment:write']],
|
||||
),
|
||||
new Patch(
|
||||
requirements: ['id' => '\d+'],
|
||||
normalizationContext: ['groups' => ['bovin-shipment:read']],
|
||||
denormalizationContext: ['groups' => ['bovin-shipment:write']],
|
||||
),
|
||||
|
||||
// new Get(
|
||||
// uriTemplate: '/receptions/weigh',
|
||||
// openapi: new OpenApiOperation(
|
||||
@@ -62,16 +52,16 @@ class BovinShipment
|
||||
#[Groups(['shipment:read', 'bovine-shipment:read'])]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'shipment')]
|
||||
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])]
|
||||
private ?Shipment $Shipment = null;
|
||||
#[ORM\ManyToOne(inversedBy: 'shipment_types')]
|
||||
#[Groups(['bovine-shipment:read'])]
|
||||
private ?Shipment $shipment = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'bovinShipments')]
|
||||
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])]
|
||||
private ?BovineTypeShipment $BovineType = null;
|
||||
#[ORM\ManyToOne]
|
||||
#[Groups(['shipment:read', 'bovine-shipment:read'])]
|
||||
private ?ShipmentType $shipmentType = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[Groups(['shipment:read', 'shipment:write', 'bovine-shipment:read', 'bovine-shipment:write'])]
|
||||
#[Groups(['shipment:read', 'bovine-shipment:read'])]
|
||||
private ?int $nbBovinSend = null;
|
||||
|
||||
public function getId(): ?int
|
||||
@@ -79,28 +69,24 @@ class BovinShipment
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getIdShipment(): ?Shipment
|
||||
public function getShipment(): ?Shipment
|
||||
{
|
||||
return $this->Shipment;
|
||||
return $this->shipment;
|
||||
}
|
||||
|
||||
public function setIdShipment(?Shipment $Shipment): static
|
||||
public function setShipment(?Shipment $shipment): void
|
||||
{
|
||||
$this->Shipment = $Shipment;
|
||||
|
||||
return $this;
|
||||
$this->shipment = $shipment;
|
||||
}
|
||||
|
||||
public function getIdType(): ?BovineTypeShipment
|
||||
public function getShipmentType(): ?ShipmentType
|
||||
{
|
||||
return $this->BovineType;
|
||||
return $this->shipmentType;
|
||||
}
|
||||
|
||||
public function setIdType(?BovineTypeShipment $BovineType): static
|
||||
public function setShipmentType(?ShipmentType $shipmentType): void
|
||||
{
|
||||
$this->BovineType = $BovineType;
|
||||
|
||||
return $this;
|
||||
$this->shipmentType = $shipmentType;
|
||||
}
|
||||
|
||||
public function getNbBovinSend(): ?int
|
||||
@@ -108,10 +94,8 @@ class BovinShipment
|
||||
return $this->nbBovinSend;
|
||||
}
|
||||
|
||||
public function setNbBovinSend(int $nbBovinSend): static
|
||||
public function setNbBovinSend(?int $nbBovinSend): void
|
||||
{
|
||||
$this->nbBovinSend = $nbBovinSend;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user