diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..0d7a883 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "files.autoSave": "afterDelay", + "files.autoSaveDelay": 1000 +} \ No newline at end of file diff --git a/backend/configuration/models.py b/backend/configuration/models.py index 49c7222..9c7c77c 100644 --- a/backend/configuration/models.py +++ b/backend/configuration/models.py @@ -11,7 +11,7 @@ class ShopConfiguration(models.Model): contact_email = models.EmailField(max_length=254, blank=True, null=True) contact_phone = models.CharField(max_length=20, blank=True, null=True) contact_address = models.TextField(blank=True, null=True) - opening_hours = models.JSONField(blank=True, null=True) #FIXME: vytvoř tvar pro otvírací dobu + opening_hours = models.JSONField(blank=True, null=True) #FIXME: vytvoř JSON tvar pro otvírací dobu, přes validátory #Social facebook_url = models.URLField(max_length=200, blank=True, null=True) diff --git a/backend/configuration/views.py b/backend/configuration/views.py index 2aab5b3..1f891af 100644 --- a/backend/configuration/views.py +++ b/backend/configuration/views.py @@ -2,4 +2,5 @@ from django.shortcuts import render # Create your views here. -#TODO: dej public tag pro view, aby to mohl react číst pomocí public axiosu \ No newline at end of file +#TODO: dej public tag pro view +# rozdělit fieldy podle práv aby se třeba neexposelo citlivé údaje \ No newline at end of file diff --git a/backend/thirdparty/zasilkovna/api.png b/backend/thirdparty/zasilkovna/api.png new file mode 100644 index 0000000..a8989c6 Binary files /dev/null and b/backend/thirdparty/zasilkovna/api.png differ diff --git a/backend/thirdparty/zasilkovna/client.py b/backend/thirdparty/zasilkovna/client.py index 196d8d6..9f729ea 100644 --- a/backend/thirdparty/zasilkovna/client.py +++ b/backend/thirdparty/zasilkovna/client.py @@ -10,10 +10,16 @@ logger = logging.getLogger(__name__) WSDL_URL = os.getenv("PACKETA_WSDL_URL", "https://www.zasilkovna.cz/api/soap.wsdl") PACKETA_API_PASSWORD = os.getenv("PACKETA_API_PASSWORD") + zeepZasClient = Client(wsdl=WSDL_URL) class PacketaAPI: + #TODO: zeptat se jestli nepřidat další checkovací parametry ohledně zásilkovny např: blokování podle nastavení webu + # popřemýšlet, jestli api klíče nenastavit přes configurator webu + def __getattribute__(self): + if PACKETA_API_PASSWORD is None: + raise Exception("Packeta API password is not set in environment variables.") # ---------- CREATE PACKET METHODS ---------- @@ -150,6 +156,7 @@ class PacketaAPI: def create_shipment(self, packet_ids: list): """ Vytvoření zásilky (shipment) z více balíků. + packet_ids = ["1234567890", "1234567891", "1234567892"] """ try: