Add shopping cart and product review features
Introduces Cart and CartItem models, admin, serializers, and API endpoints for shopping cart management for both authenticated and anonymous users. Adds Review model, serializers, and endpoints for product reviews, including public creation and retrieval. Updates ProductImage ordering, enhances order save logic with notification, and improves product and order endpoints with new actions and filters. Includes related migrations for commerce, configuration, social chat, and Deutsche Post integration.
This commit is contained in:
62
backend/thirdparty/deutschepost/migrations/0001_initial.py
vendored
Normal file
62
backend/thirdparty/deutschepost/migrations/0001_initial.py
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
# Generated by Django 5.2.7 on 2026-01-17 01:37
|
||||
|
||||
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', 'cz#Vytvořeno'), ('FINALIZED', 'cz#Dokončeno'), ('SHIPPED', 'cz#Odesláno'), ('DELIVERED', 'cz#Doručeno'), ('CANCELLED', 'cz#Zrušeno'), ('ERROR', 'cz#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')),
|
||||
],
|
||||
),
|
||||
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', 'cz#Vytvořeno'), ('PROCESSING', 'cz#Zpracovává se'), ('COMPLETED', 'cz#Dokončeno'), ('ERROR', 'cz#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')),
|
||||
('deutschepost_orders', models.ManyToManyField(blank=True, related_name='bulk_orders', to='deutschepost.deutschepostorder')),
|
||||
],
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user