From a6e529e64361795c7284cc23c920737824621d69 Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Thu, 2 Apr 2026 22:27:12 +0200 Subject: [PATCH] feat: ajout entity PriceAutomatic pour les tarifs automatiques src/Entity/PriceAutomatic.php (nouveau): - id: int auto-increment - type: string(50), categorie du tarif (ex: esy-web, esy-mail, ndd) - title: string(255), intitule du tarif - description: text nullable, detail du tarif - priceHt: decimal(10,2), prix hors taxes src/Repository/PriceAutomaticRepository.php (nouveau) migrations/Version20260402202703.php: - Table price_automatic avec colonnes type, title, description, price_ht Co-Authored-By: Claude Opus 4.6 (1M context) --- migrations/Version20260402202703.php | 31 +++++++++ src/Entity/PriceAutomatic.php | 72 +++++++++++++++++++++ src/Repository/PriceAutomaticRepository.php | 18 ++++++ 3 files changed, 121 insertions(+) create mode 100644 migrations/Version20260402202703.php create mode 100644 src/Entity/PriceAutomatic.php create mode 100644 src/Repository/PriceAutomaticRepository.php diff --git a/migrations/Version20260402202703.php b/migrations/Version20260402202703.php new file mode 100644 index 0000000..7155224 --- /dev/null +++ b/migrations/Version20260402202703.php @@ -0,0 +1,31 @@ +addSql('CREATE TABLE price_automatic (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, type VARCHAR(50) NOT NULL, title VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, price_ht NUMERIC(10, 2) NOT NULL, PRIMARY KEY (id))'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP TABLE price_automatic'); + } +} diff --git a/src/Entity/PriceAutomatic.php b/src/Entity/PriceAutomatic.php new file mode 100644 index 0000000..7f0a60f --- /dev/null +++ b/src/Entity/PriceAutomatic.php @@ -0,0 +1,72 @@ +id; + } + + public function getType(): string + { + return $this->type; + } + + public function setType(string $type): void + { + $this->type = $type; + } + + public function getTitle(): string + { + return $this->title; + } + + public function setTitle(string $title): void + { + $this->title = $title; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(?string $description): void + { + $this->description = $description; + } + + public function getPriceHt(): string + { + return $this->priceHt; + } + + public function setPriceHt(string $priceHt): void + { + $this->priceHt = $priceHt; + } +} diff --git a/src/Repository/PriceAutomaticRepository.php b/src/Repository/PriceAutomaticRepository.php new file mode 100644 index 0000000..9f48f10 --- /dev/null +++ b/src/Repository/PriceAutomaticRepository.php @@ -0,0 +1,18 @@ + + */ +class PriceAutomaticRepository extends ServiceEntityRepository +{ + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, PriceAutomatic::class); + } +}