From bbe0a9fdd4c6b167628e1dc1392cbf5065554e17 Mon Sep 17 00:00:00 2001 From: tristan Date: Fri, 30 Jan 2026 11:48:29 +0100 Subject: [PATCH] =?UTF-8?q?feat=20:=20ajout=20de=20colonne=20pour=20les=20?= =?UTF-8?q?Supplier,=20Address=20et=20modification=20du=20num=C3=A9ro=20de?= =?UTF-8?q?=20r=C3=A9ception?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Entity/Address.php | 18 +++++++++++++++++- src/Entity/Reception.php | 2 +- src/Entity/Supplier.php | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/Entity/Address.php b/src/Entity/Address.php index 18e2481..81903d4 100644 --- a/src/Entity/Address.php +++ b/src/Entity/Address.php @@ -42,6 +42,10 @@ class Address #[Groups(['address:read', 'supplier:read', 'reception:read'])] private string $street = ''; + #[ORM\Column(name: 'street2', length: 180, nullable: true)] + #[Groups(['address:read', 'supplier:read', 'reception:read'])] + private ?string $street2 = null; + #[ORM\Column(name: 'postal_code', length: 20)] #[Groups(['address:read', 'supplier:read', 'reception:read'])] private string $postalCode = ''; @@ -94,6 +98,18 @@ class Address return $this; } + public function getStreet2(): ?string + { + return $this->street2; + } + + public function setStreet2(?string $street2): self + { + $this->street2 = $street2; + + return $this; + } + public function getPostalCode(): string { return $this->postalCode; @@ -135,8 +151,8 @@ class Address { $parts = array_filter([ $this->street, + $this->street2, trim(sprintf('%s %s', $this->postalCode, $this->city)), - $this->countryCode, ]); return implode(', ', $parts); diff --git a/src/Entity/Reception.php b/src/Entity/Reception.php index 7a90ff8..636dc3d 100644 --- a/src/Entity/Reception.php +++ b/src/Entity/Reception.php @@ -455,7 +455,7 @@ class Reception return; } - $number = sprintf('N-BR-%04d', $this->id); + $number = sprintf('P-BR-%04d', $this->id); $this->identificationNumber = $number; $args->getObjectManager() diff --git a/src/Entity/Supplier.php b/src/Entity/Supplier.php index 9ce348f..189f001 100644 --- a/src/Entity/Supplier.php +++ b/src/Entity/Supplier.php @@ -39,6 +39,14 @@ class Supplier #[Groups(['supplier:read', 'reception:read'])] private string $name = ''; + #[ORM\Column(length: 180, nullable: true)] + #[Groups(['supplier:read', 'reception:read'])] + private ?string $email = null; + + #[ORM\Column(length: 40, nullable: true)] + #[Groups(['supplier:read', 'reception:read'])] + private ?string $phone = null; + /** * @var Collection */ @@ -70,6 +78,30 @@ class Supplier return $this; } + public function getEmail(): ?string + { + return $this->email; + } + + public function setEmail(?string $email): self + { + $this->email = $email; + + return $this; + } + + public function getPhone(): ?string + { + return $this->phone; + } + + public function setPhone(?string $phone): self + { + $this->phone = $phone; + + return $this; + } + /** * @return Collection */