# Generated by Django 6.0.3 on 2026-04-03 14:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('name', models.CharField(max_length=200)),
                ('stripe_customer_id', models.CharField(blank=True, default='', max_length=200)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Hat',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
                ('slug', models.SlugField(unique=True)),
                ('description', models.TextField()),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('image', models.ImageField(upload_to='hats/')),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('first_dibs', 'First Dibs'), ('available', 'Available'), ('sold', 'Sold')], default='draft', max_length=20)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('published_at', models.DateTimeField(blank=True, help_text='When this hat was first made available (for email timing)', null=True)),
                ('sold_at', models.DateTimeField(blank=True, null=True)),
                ('stripe_payment_intent_id', models.CharField(blank=True, default='', max_length=200)),
            ],
            options={
                'verbose_name': 'Hat',
                'verbose_name_plural': 'Hats',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stripe_payment_intent_id', models.CharField(max_length=200)),
                ('amount_paid', models.DecimalField(decimal_places=2, max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='purchases', to='hats.customer')),
                ('hat', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='purchases', to='hats.hat')),
            ],
            options={
                'ordering': ['-created_at'],
                'unique_together': {('customer', 'stripe_payment_intent_id')},
            },
        ),
    ]
