# Generated by Django 6.0 on 2026-05-22 03:09

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


class Migration(migrations.Migration):

    dependencies = [
        ('lyric', '0007_alter_token_token_type'),
    ]

    operations = [
        migrations.CreateModel(
            name='ShopItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(unique=True)),
                ('name', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True, default='')),
                ('icon', models.CharField(max_length=50)),
                ('badge_text', models.CharField(blank=True, default='', max_length=8)),
                ('price_cents', models.PositiveIntegerField()),
                ('granted_token_type', models.CharField(choices=[('coin', 'Coin-on-a-String'), ('Free', 'Free Token'), ('tithe', 'Tithe Token'), ('pass', 'Backstage Pass'), ('band', 'Wristband'), ('carte', 'Carte Blanche')], max_length=8)),
                ('granted_count', models.PositiveSmallIntegerField(default=1)),
                ('granted_writs', models.PositiveIntegerField(default=0)),
                ('max_owned', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('display_order', models.PositiveSmallIntegerField(default=100)),
                ('active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['display_order', 'slug'],
            },
        ),
        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=255, unique=True)),
                ('status', models.CharField(choices=[('PENDING', 'Pending'), ('SUCCEEDED', 'Succeeded'), ('FAILED', 'Failed'), ('REFUNDED', 'Refunded')], default='PENDING', max_length=10)),
                ('amount_cents', models.PositiveIntegerField()),
                ('granted_writs', models.PositiveIntegerField(default=0)),
                ('granted_token_ids', models.JSONField(blank=True, default=list)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('succeeded_at', models.DateTimeField(blank=True, null=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='purchases', to=settings.AUTH_USER_MODEL)),
                ('shop_item', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='purchases', to='lyric.shopitem')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
