Add choices API endpoint and OpenAPI client setup
Introduces a new /api/choices/ endpoint for fetching model choices with multilingual labels. Updates Django models to use 'cz#' prefix for Czech labels. Adds OpenAPI client generation via orval, refactors frontend API structure, and provides documentation and helper scripts for dynamic choices and OpenAPI usage.
This commit is contained in:
12
backend/thirdparty/stripe/models.py
vendored
12
backend/thirdparty/stripe/models.py
vendored
@@ -7,12 +7,12 @@ from .client import StripeClient
|
||||
|
||||
class StripeModel(models.Model):
|
||||
class STATUS_CHOICES(models.TextChoices):
|
||||
PENDING = "pending", "Čeká se na platbu"
|
||||
PAID = "paid", "Zaplaceno"
|
||||
FAILED = "failed", "Neúspěšné"
|
||||
CANCELLED = "cancelled", "Zrušeno"
|
||||
REFUNDING = "refunding", "Platba se vrací"
|
||||
REFUNDED = "refunded", "Platba úspěšně vrácena"
|
||||
PENDING = "pending", "cz#Čeká se na platbu"
|
||||
PAID = "paid", "cz#Zaplaceno"
|
||||
FAILED = "failed", "cz#Neúspěšné"
|
||||
CANCELLED = "cancelled", "cz#Zrušeno"
|
||||
REFUNDING = "refunding", "cz#Platba se vrací"
|
||||
REFUNDED = "refunded", "cz#Platba úspěšně vrácena"
|
||||
|
||||
status = models.CharField(max_length=20, choices=STATUS_CHOICES.choices, default=STATUS_CHOICES.PENDING)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user