feat : écran bovins, refacto cases, enrichissement bovins, migrations
- Ajout page infrastructure/bovine avec CRUD - Refacto BuildingCase (suppression Statut, simplification) - Commande EnrichBovinesCommand pour enrichir les données bovins - 4 migrations Doctrine - Mise à jour composables shipment/weighing - Mise à jour README et CHANGELOG Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@ use Symfony\Component\Serializer\Attribute\SerializedName;
|
||||
operations: [
|
||||
new Get(
|
||||
requirements: ['id' => '\d+'],
|
||||
normalizationContext: ['groups' => ['building:read']],
|
||||
normalizationContext: ['groups' => ['building_case:read', 'building:summary']],
|
||||
),
|
||||
new Get(
|
||||
uriTemplate: '/building_cases/{id}/weights-report',
|
||||
@@ -39,20 +39,20 @@ class BuildingCase
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column]
|
||||
#[Groups(['building:read'])]
|
||||
#[Groups(['building:read', 'building_case:read'])]
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[Groups(['building:read'])]
|
||||
#[Groups(['building:read', 'building_case:read'])]
|
||||
#[SerializedName('caseNumber')]
|
||||
private ?int $case_number = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
#[Groups(['building:read'])]
|
||||
#[Groups(['building:read', 'building_case:read'])]
|
||||
private ?string $code = null;
|
||||
|
||||
#[ORM\Column]
|
||||
#[Groups(['building:read'])]
|
||||
#[Groups(['building:read', 'building_case:read'])]
|
||||
private ?int $capacity = null;
|
||||
|
||||
/**
|
||||
@@ -62,16 +62,15 @@ class BuildingCase
|
||||
private Collection $id_case_position;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'buildingCases')]
|
||||
#[Groups(['building_case:read'])]
|
||||
#[SerializedName('building')]
|
||||
private ?Building $id_building = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'id_case')]
|
||||
#[Groups(['building:read'])]
|
||||
private ?Statut $statut = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Bovine>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Bovine::class, mappedBy: 'buildingCase')]
|
||||
#[Groups(['building_case:read'])]
|
||||
private Collection $bovines;
|
||||
|
||||
public function __construct()
|
||||
@@ -170,16 +169,17 @@ class BuildingCase
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getStatut(): ?Statut
|
||||
/**
|
||||
* @return array{label: string, couleur: string}
|
||||
*/
|
||||
#[Groups(['building:read', 'building_case:read'])]
|
||||
public function getStatut(): array
|
||||
{
|
||||
return $this->statut;
|
||||
}
|
||||
if ($this->bovines->count() > 0) {
|
||||
return ['label' => 'Occupé', 'couleur' => '#3A506B'];
|
||||
}
|
||||
|
||||
public function setStatut(?Statut $statut): static
|
||||
{
|
||||
$this->statut = $statut;
|
||||
|
||||
return $this;
|
||||
return ['label' => 'Libre', 'couleur' => '#A3B18A'];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user