67 lines
5.0 KiB
Python
67 lines
5.0 KiB
Python
# Generated by Django 5.2.7 on 2026-04-20 17:54
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='DeutschePostOrder',
|
|
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=[('CREATED', 'Vytvořeno'), ('FINALIZED', 'Dokončeno'), ('SHIPPED', 'Odesláno'), ('DELIVERED', 'Doručeno'), ('CANCELLED', 'Zrušeno'), ('ERROR', 'Chyba')], default='CREATED', max_length=20)),
|
|
('order_id', models.CharField(blank=True, help_text='Deutsche Post order ID from API', max_length=50, null=True)),
|
|
('customer_ekp', models.CharField(blank=True, max_length=20, null=True)),
|
|
('recipient_name', models.CharField(max_length=200)),
|
|
('recipient_phone', models.CharField(blank=True, max_length=20)),
|
|
('recipient_email', models.EmailField(blank=True, max_length=254)),
|
|
('address_line1', models.CharField(max_length=255)),
|
|
('address_line2', models.CharField(blank=True, max_length=255)),
|
|
('address_line3', models.CharField(blank=True, max_length=255)),
|
|
('city', models.CharField(max_length=100)),
|
|
('address_state', models.CharField(blank=True, help_text='State/Province for shipping address', max_length=100)),
|
|
('postal_code', models.CharField(max_length=20)),
|
|
('destination_country', models.CharField(help_text='ISO 2-letter country code', max_length=2)),
|
|
('product_type', models.CharField(default='GPT', help_text='Deutsche Post product type (GPT, GMP, etc.)', max_length=10)),
|
|
('service_level', models.CharField(default='PRIORITY', help_text='PRIORITY, STANDARD', max_length=20)),
|
|
('shipment_gross_weight', models.PositiveIntegerField(help_text='Weight in grams')),
|
|
('shipment_amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
|
|
('shipment_currency', models.CharField(default='EUR', max_length=3)),
|
|
('sender_tax_id', models.CharField(blank=True, help_text='IOSS number or sender tax ID', max_length=50)),
|
|
('importer_tax_id', models.CharField(blank=True, help_text='IOSS number or importer tax ID', max_length=50)),
|
|
('return_item_wanted', models.BooleanField(default=False)),
|
|
('cust_ref', models.CharField(blank=True, help_text='Customer reference', max_length=100)),
|
|
('awb_number', models.CharField(blank=True, help_text='Air Waybill number', max_length=50, null=True)),
|
|
('barcode', models.CharField(blank=True, help_text='Item barcode', max_length=50, null=True)),
|
|
('tracking_url', models.URLField(blank=True, null=True)),
|
|
('metadata', models.JSONField(blank=True, default=dict, help_text='Raw API response data')),
|
|
('last_error', models.TextField(blank=True, help_text='Last API error message')),
|
|
('label_pdf', models.FileField(blank=True, help_text='Shipping label PDF', null=True, upload_to='deutschepost/labels/')),
|
|
('label_size', models.CharField(choices=[('A4', 'A4 (210x297mm)'), ('A5', 'A5 (148x210mm)'), ('A6', 'A6 (105x148mm)')], default='A4', max_length=10)),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name='DeutschePostBulkOrder',
|
|
fields=[
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
|
('status', models.CharField(choices=[('CREATED', 'Vytvořeno'), ('PROCESSING', 'Zpracovává se'), ('COMPLETED', 'Dokončeno'), ('ERROR', 'Chyba')], default='CREATED', max_length=20)),
|
|
('bulk_order_id', models.CharField(blank=True, help_text='Deutsche Post bulk order ID from API', max_length=50, null=True)),
|
|
('bulk_order_type', models.CharField(default='MIXED_BAG', help_text='MIXED_BAG, etc.', max_length=20)),
|
|
('description', models.CharField(blank=True, max_length=255)),
|
|
('metadata', models.JSONField(blank=True, default=dict, help_text='Raw API response data')),
|
|
('last_error', models.TextField(blank=True, help_text='Last API error message')),
|
|
('bulk_label_pdf', models.FileField(blank=True, help_text='Bulk shipment label PDF', null=True, upload_to='deutschepost/bulk_labels/')),
|
|
('paperwork_pdf', models.FileField(blank=True, help_text='Bulk shipment paperwork PDF', null=True, upload_to='deutschepost/paperwork/')),
|
|
('deutschepost_orders', models.ManyToManyField(blank=True, related_name='bulk_orders', to='deutschepost.deutschepostorder')),
|
|
],
|
|
),
|
|
]
|