diff --git a/migrations/Version20260302120000.php b/migrations/Version20260302120000.php new file mode 100644 index 0000000..7849310 --- /dev/null +++ b/migrations/Version20260302120000.php @@ -0,0 +1,28 @@ +addSql('ALTER TABLE pieces ADD COLUMN IF NOT EXISTS description TEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE composants ADD COLUMN IF NOT EXISTS description TEXT DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE pieces DROP COLUMN IF EXISTS description'); + $this->addSql('ALTER TABLE composants DROP COLUMN IF EXISTS description'); + } +} diff --git a/src/Entity/Composant.php b/src/Entity/Composant.php index ffa0f66..dee68b9 100644 --- a/src/Entity/Composant.php +++ b/src/Entity/Composant.php @@ -55,6 +55,10 @@ class Composant #[Groups(['composant:read'])] private ?string $reference = null; + #[ORM\Column(type: Types::TEXT, nullable: true)] + #[Groups(['composant:read'])] + private ?string $description = null; + #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] #[Groups(['composant:read'])] private ?string $prix = null; @@ -175,6 +179,18 @@ class Composant return $this; } + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(?string $description): static + { + $this->description = $description; + + return $this; + } + public function getPrix(): ?string { return $this->prix; diff --git a/src/Entity/Piece.php b/src/Entity/Piece.php index 88b5f7f..a32f466 100644 --- a/src/Entity/Piece.php +++ b/src/Entity/Piece.php @@ -57,6 +57,10 @@ class Piece #[Groups(['piece:read'])] private ?string $reference = null; + #[ORM\Column(type: Types::TEXT, nullable: true)] + #[Groups(['piece:read'])] + private ?string $description = null; + #[ORM\Column(type: Types::DECIMAL, precision: 10, scale: 2, nullable: true)] #[Groups(['piece:read'])] private ?string $prix = null; @@ -177,6 +181,18 @@ class Piece return $this; } + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(?string $description): static + { + $this->description = $description; + + return $this; + } + public function getPrix(): ?string { return $this->prix;