Refactor Stripe payment handling and order status

Refactored Stripe payment integration to use a dedicated Stripe model for session data, updating the PaymentSerializer accordingly. Renamed Order.Status to Order.OrderStatus for clarity. Updated configuration app to ensure SiteConfiguration singleton is created post-migration. Removed obsolete seed_app_config command from docker-compose. Adjusted frontend API generated files and moved orval config.
This commit is contained in:
2025-12-19 14:08:40 +01:00
parent 2498386477
commit 713c94d7e9
12 changed files with 377 additions and 56 deletions

View File

@@ -104,7 +104,7 @@ class ProductImage(models.Model):
# ------------------ OBJEDNÁVKY ------------------
class Order(models.Model):
class Status(models.TextChoices):
class OrderStatus(models.TextChoices):
CREATED = "created", "cz#Vytvořeno"
CANCELLED = "cancelled", "cz#Zrušeno"
COMPLETED = "completed", "cz#Dokončeno"
@@ -113,7 +113,7 @@ class Order(models.Model):
REFUNDED = "refunded", "cz#Vráceno"
status = models.CharField(
max_length=20, choices=Status.choices, null=True, blank=True, default=Status.CREATED
max_length=20, choices=OrderStatus.choices, null=True, blank=True, default=OrderStatus.CREATED
)
# Stored order grand total; recalculated on save