# Generated by Django 5.2.14 on 2026-07-04 09:38

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('eveuniverse', '0012_alter_evebloodline_eve_ship_type'),
        ('shop', '0017_bpclisting_featured_bpclisting_featured_at_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='Buyer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('character_id', models.PositiveBigIntegerField(unique=True)),
                ('character_name', models.CharField(max_length=255)),
                ('discord_handle', models.CharField(blank=True, max_length=100)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('reference', models.CharField(default='', editable=False, max_length=5, unique=True)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('accepted', 'Accepted'), ('completed', 'Completed'), ('declined', 'Declined'), ('cancelled', 'Cancelled')], default='pending', max_length=10)),
                ('additional_info', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('buyer', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='orders', to='shop.buyer')),
                ('shop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='orders', to='shop.shop')),
            ],
        ),
        migrations.CreateModel(
            name='OrderLine',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('section', models.CharField(max_length=20)),
                ('quantity', models.PositiveIntegerField()),
                ('unit_price', models.PositiveBigIntegerField(default=0)),
                ('listing_id', models.PositiveIntegerField(blank=True, null=True)),
                ('eve_type', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='eveuniverse.evetype')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lines', to='shop.order')),
            ],
        ),
    ]
