# Generated by Django 6.0.7 on 2026-07-14 17:23

import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('accounts', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='InvoiceTemplate',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=255)),
                ('category', models.CharField(choices=[('corporate', 'Corporate'), ('modern', 'Modern'), ('minimal', 'Minimal'), ('creative', 'Creative'), ('legal', 'Legal'), ('medical', 'Medical'), ('construction', 'Construction'), ('education', 'Education'), ('luxury', 'Luxury'), ('government', 'Government'), ('church', 'Church'), ('consulting', 'Consulting'), ('restaurant', 'Restaurant'), ('salon', 'Salon'), ('photography', 'Photography')], max_length=32)),
                ('preview_image', models.ImageField(blank=True, null=True, upload_to='template_previews/')),
                ('layout', models.JSONField(blank=True, default=dict)),
                ('price', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('usage_limit', models.PositiveIntegerField(blank=True, null=True)),
                ('min_tier_required', models.CharField(default='free', max_length=32)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='PurchasedTemplate',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('uses_remaining', models.PositiveIntegerField(blank=True, null=True)),
                ('purchased_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='purchased_templates', to='accounts.company')),
                ('template', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='purchases', to='templates.invoicetemplate')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='purchased_templates', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
