From 85b3f631d12e221c4781843dd32d570ead378b3f Mon Sep 17 00:00:00 2001 From: Serreau Jovann Date: Fri, 16 Jan 2026 13:55:11 +0100 Subject: [PATCH] =?UTF-8?q?```=20=E2=9C=A8=20feat(Product):=20Ajoute=20un?= =?UTF-8?q?=20champ=20productId=20pour=20la=20synchronisation=20Stripe.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🎨 style(product/products.twig): Affiche l'état de synchronisation Stripe. ``` --- migrations/Version20260116125355.php | 32 ++++++++++++++++++++++ src/Entity/Product.php | 15 +++++++++++ templates/product/products.twig | 40 +++++++++++++++++----------- 3 files changed, 72 insertions(+), 15 deletions(-) create mode 100644 migrations/Version20260116125355.php diff --git a/migrations/Version20260116125355.php b/migrations/Version20260116125355.php new file mode 100644 index 0000000..ddee10b --- /dev/null +++ b/migrations/Version20260116125355.php @@ -0,0 +1,32 @@ +addSql('ALTER TABLE product ADD product_id VARCHAR(255) DEFAULT NULL'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('CREATE SCHEMA public'); + $this->addSql('ALTER TABLE product DROP product_id'); + } +} diff --git a/src/Entity/Product.php b/src/Entity/Product.php index 5a25833..e057099 100644 --- a/src/Entity/Product.php +++ b/src/Entity/Product.php @@ -49,6 +49,9 @@ class Product #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $updatedAt = null; + #[ORM\Column(length: 255, nullable: true)] + private ?string $productId = null; + public function getId(): ?int { return $this->id; @@ -173,4 +176,16 @@ class Product { return $this->imageSize; } + + public function getProductId(): ?string + { + return $this->productId; + } + + public function setProductId(?string $productId): static + { + $this->productId = $productId; + + return $this; + } } diff --git a/templates/product/products.twig b/templates/product/products.twig index 2c03072..5c353d9 100644 --- a/templates/product/products.twig +++ b/templates/product/products.twig @@ -44,28 +44,43 @@ {# CONTENU #}
- {# REF, NOM #} + {# REF, NOM & STRIPE SYNC #}

{{ product.ref }}

-

+

{{ product.name }}

+ + {# ETAT SYNCHRO STRIPE (Même style que Client) #} +
+ {% if product.productId %} +
+ + Stripe synchronisé +
+ {% else %} +
+ + Non synchronisé Stripe +
+ {% endif %} +
{# GRILLE TARIFS (priceDay & priceSup) #}
-
+

Prix Journée

{{ product.priceDay|number_format(2, ',', ' ') }}€

-
+

Jour Sup.

{{ product.priceSup|number_format(2, ',', ' ') }}€

{# CAUTION & INSTALLATION #} -
+
@@ -86,19 +101,19 @@ {# ACTIONS #}
- {# Bouton Modifier (Redirection vers la fiche) #} + {# Bouton Modifier #} - Modifier le produit + Modifier - {# Bouton Supprimer (Identique aux clients) #} + {# Bouton Supprimer #}
{% else %} -
-
- -
-

Le catalogue est actuellement vide

-
+ {# ... vide ... #} {% endfor %}