feat : Ajout de la sélection des bovins étape 3 d'une réception
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user