Files
vontor-cz/backend/thirdparty/zasilkovna/migrations/0001_initial.py
Vontor Bruno 72155d4560 Refactor Zasilkovna client, update imports and cleanup
Refactored the Zasilkovna SOAP client to use a singleton pattern with caching and lazy loading, improving reliability and startup performance. Updated invoice PDF generation to import WeasyPrint lazily, preventing startup failures on systems missing dependencies. Cleaned up unused imports and code in several frontend components, removed unused state and variables, and adjusted Docker frontend port mapping. Also updated Django migration files to reflect a new generation timestamp.
2025-12-18 16:23:35 +01:00

40 lines
2.8 KiB
Python

# Generated by Django 5.2.7 on 2025-12-18 15:11
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ZasilkovnaPacket',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('state', models.CharField(choices=[('WAITING_FOR_ORDERING_SHIPMENT', 'cz#Čeká na objednání zásilkovny'), ('PENDING', 'cz#Podáno'), ('SENDED', 'cz#Odesláno'), ('ARRIVED', 'cz#Doručeno'), ('CANCELED', 'cz#Zrušeno'), ('RETURNING', 'cz#Posláno zpátky'), ('RETURNED', 'cz#Vráceno')], default='PENDING', max_length=35)),
('addressId', models.IntegerField(blank=True, help_text='ID adresy/pointu, ve Widgetu zásilkovny který si vybere uživatel.', null=True)),
('packet_id', models.IntegerField(blank=True, help_text='Číslo zásilky v Packetě (vraceno od API od Packety)', null=True)),
('barcode', models.CharField(blank=True, help_text='Čárový kód zásilky od Packety', max_length=64, null=True)),
('weight', models.IntegerField(default=0, help_text='Hmotnost zásilky v gramech')),
('return_routing', models.JSONField(blank=True, default=list, help_text='Seznam 2 routing stringů pro vrácení zásilky', null=True)),
('size_of_pdf', models.CharField(choices=[('A6 on A6', '105x148 mm (A6) label on a page of the same size'), ('A7 on A7', '105x74 mm (A7) label on a page of the same size'), ('A6 on A4', '105x148 mm (A6) label on a page of size 210x297 mm (A4)'), ('A7 on A4', '105x74 mm (A7) label on a page of size 210x297 mm (A4)'), ('A8 on A8', '50x74 mm (A8) label on a page of the same size')], default='A6 on A6', max_length=20)),
],
),
migrations.CreateModel(
name='ZasilkovnaShipment',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created_at', models.DateTimeField(auto_now_add=True)),
('shipment_id', models.CharField(editable=False, help_text='ID zásilky v Packetě', max_length=255, unique=True)),
('barcode', models.CharField(help_text='Čárový kód zásilky v Packetě (format: )', max_length=64, validators=[django.core.validators.RegexValidator('D-***-XM-<id>', message='Neplatný formát čárového kódu.')])),
('packets', models.ManyToManyField(help_text='Seznam zásilek v této zásilce (packet_id)', related_name='shipments', to='zasilkovna.zasilkovnapacket')),
],
),
]