Entferne Projektbezogene Logik bzw. Verweise auf Baugruppen, da nicht benötigt. Überarbeitung Exporter: Aufnahme von Parts aus Subassemblies.

This commit is contained in:
Marcel Diegelmann 2025-09-12 16:05:42 +02:00
parent 360fed1f5e
commit 4251b2ab46
22 changed files with 267 additions and 169 deletions

View file

@ -36,7 +36,6 @@ use ApiPlatform\OpenApi\Model\Operation;
use ApiPlatform\Serializer\Filter\PropertyFilter;
use App\ApiPlatform\Filter\LikeFilter;
use App\Entity\Contracts\TimeStampableInterface;
use App\Entity\ProjectSystem\Project;
use App\Repository\DBElementRepository;
use App\Validator\Constraints\AssemblySystem\AssemblyCycle;
use App\Validator\Constraints\AssemblySystem\AssemblyInvalidBomEntry;
@ -252,17 +251,6 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
return $this;
}
public function getProject(): ?Project
{
return $this->project;
}
public function setProject(?Project $project): AssemblyBOMEntry
{
$this->project = $project;
return $this;
}
/**
* Returns the price of this BOM entry, if existing.
* Prices are only valid on non-Part BOM entries.
@ -300,6 +288,15 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
return $this->part instanceof Part;
}
/**
* Checks whether this BOM entry is a assembly associated BOM entry or not.
* @return bool True if this BOM entry is a assembly associated BOM entry, false otherwise.
*/
public function isAssemblyBomEntry(): bool
{
return $this->referencedAssembly !== null;
}
#[Assert\Callback]
public function validate(ExecutionContextInterface $context, $payload): void
{
@ -335,7 +332,7 @@ class AssemblyBOMEntry extends AbstractDBElement implements UniqueValidatableInt
return [
'name' => $this->getName(),
'part' => $this->getPart()?->getID(),
'project' => $this->getProject()?->getID(),
'referencedAssembly' => $this->getReferencedAssembly()?->getID(),
];
}
}