feat : Ajout de la sélection des bovins étape 3 d'une réception

This commit is contained in:
2026-02-05 09:08:30 +01:00
parent 81c2a5802b
commit 33563addbe
8 changed files with 164 additions and 52 deletions

View File

@@ -172,9 +172,16 @@ class Reception
* @var Collection<int, ReceptionBovine>
*/
#[ORM\OneToMany(targetEntity: ReceptionBovine::class, mappedBy: 'reception', cascade: ['persist', 'remove'], orphanRemoval: true)]
#[Assert\Range(
min: 0
)]
#[Groups(['reception:read', 'reception:write'])]
private Collection $bovines_types;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['reception:read', 'reception:write'])]
private ?string $bovineDetail = null;
public function __construct(
?DateTimeImmutable $receptionDate = null,
) {
@@ -507,4 +514,16 @@ class Reception
return $this;
}
public function getBovineDetail(): ?string
{
return $this->bovineDetail;
}
public function setBovineDetail(?string $bovineDetail): static
{
$this->bovineDetail = $bovineDetail;
return $this;
}
}

View File

@@ -60,11 +60,9 @@ class ReceptionBovine
private ?BovineType $bovineType = null;
#[ORM\Column(options: ['default' => 0])]
// #[Assert\Range(
// min: 0,
// max: 10,
// notInRangeMessage: 'La quantité doit être comprise entre {{ min }} et {{ max }}.'
// )]
#[Assert\Range(
min: 0
)]
#[Groups(['reception-bovine:read', 'reception-bovine:write', 'reception:read'])]
private ?int $quantity = null;