# Generated by Django 4.0.10 on 2026-03-25 23:49

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('cart', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='PendingCheckout',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('session_key', models.CharField(blank=True, default='', max_length=200)),
                ('customer_name', models.CharField(max_length=200)),
                ('customer_email', models.EmailField(max_length=254)),
                ('customer_phone', models.CharField(blank=True, default='', max_length=30)),
                ('delivery_address', models.TextField()),
                ('total_amount', models.DecimalField(decimal_places=2, max_digits=12)),
                ('lines', models.JSONField(help_text='List of {product_id, quantity, product_price, product_name, currency, vendor_id}')),
                ('paystack_reference', models.CharField(blank=True, db_index=True, default='', max_length=200)),
                ('status', models.CharField(choices=[('pending_payment', 'Awaiting payment'), ('paid', 'Paid — order created')], db_index=True, default='pending_payment', max_length=30)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('cart', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pending_checkouts', to='cart.cart')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='pending_checkouts', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
