refactor(api) : remove TypeMachine skeleton system, fix ModelType serialization

- Remove TypeMachine, TypeMachineComponentRequirement, TypeMachinePieceRequirement,
  TypeMachineProductRequirement entities and related repositories/state processor
- Replace MachineSkeletonController with MachineStructureController
- Link CustomField directly to Machine instead of TypeMachine
- Add migration to drop TypeMachine tables and migrate custom fields to machines
- Fix ModelType serialization: Annotation\Groups → Attribute\Groups (Symfony 8 compat)
  and add product:read, composant:read, piece:read groups for embedded category display
- Fix Profile: same Annotation → Attribute import
- Fix SearchFilter: partial → ipartial on Comment and Document
- Update frontend submodule (remove skeleton pages/components, simplify machine creation)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-05 17:26:16 +01:00
parent f2539099bc
commit 0e11f4ad2d
25 changed files with 571 additions and 1694 deletions

View File

@@ -53,10 +53,6 @@ class Machine
#[ORM\JoinColumn(name: 'siteId', referencedColumnName: 'id', nullable: false, onDelete: 'CASCADE')]
private Site $site;
#[ORM\ManyToOne(targetEntity: TypeMachine::class, inversedBy: 'machines')]
#[ORM\JoinColumn(name: 'typeMachineId', referencedColumnName: 'id', nullable: true)]
private ?TypeMachine $typeMachine = null;
/**
* @var Collection<int, Constructeur>
*/
@@ -92,6 +88,12 @@ class Machine
#[ORM\OneToMany(mappedBy: 'machine', targetEntity: Document::class)]
private Collection $documents;
/**
* @var Collection<int, CustomField>
*/
#[ORM\OneToMany(mappedBy: 'machine', targetEntity: CustomField::class, cascade: ['persist', 'remove'])]
private Collection $customFields;
/**
* @var Collection<int, CustomFieldValue>
*/
@@ -111,6 +113,7 @@ class Machine
$this->pieceLinks = new ArrayCollection();
$this->productLinks = new ArrayCollection();
$this->documents = new ArrayCollection();
$this->customFields = new ArrayCollection();
$this->customFieldValues = new ArrayCollection();
}
@@ -192,14 +195,31 @@ class Machine
return $this;
}
public function getTypeMachine(): ?TypeMachine
/**
* @return Collection<int, CustomField>
*/
public function getCustomFields(): Collection
{
return $this->typeMachine;
return $this->customFields;
}
public function setTypeMachine(?TypeMachine $typeMachine): static
public function addCustomField(CustomField $customField): static
{
$this->typeMachine = $typeMachine;
if (!$this->customFields->contains($customField)) {
$this->customFields->add($customField);
$customField->setMachine($this);
}
return $this;
}
public function removeCustomField(CustomField $customField): static
{
if ($this->customFields->removeElement($customField)) {
if ($customField->getMachine() === $this) {
$customField->setMachine(null);
}
}
return $this;
}