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) <noreply@anthropic.com>
This commit is contained in:
Serreau Jovann
2026-04-02 22:27:12 +02:00
parent 3bda43c72f
commit a6e529e643
3 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260402202703 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->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');
}
}

View File

@@ -0,0 +1,72 @@
<?php
namespace App\Entity;
use App\Repository\PriceAutomaticRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: PriceAutomaticRepository::class)]
class PriceAutomatic
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 50)]
private string $type;
#[ORM\Column(length: 255)]
private string $title;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $description = null;
#[ORM\Column(type: 'decimal', precision: 10, scale: 2)]
private string $priceHt;
public function getId(): ?int
{
return $this->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;
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Repository;
use App\Entity\PriceAutomatic;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<PriceAutomatic>
*/
class PriceAutomaticRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, PriceAutomatic::class);
}
}