# Generated by Django 5.2.7 on 2026-04-20 17:54

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='GoPayPayment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gopay_id', models.CharField(db_index=True, max_length=64, unique=True)),
                ('order_number', models.CharField(blank=True, default='', max_length=128)),
                ('amount', models.BigIntegerField(help_text='Amount in minor units (e.g., CZK in haléř).')),
                ('currency', models.CharField(max_length=10)),
                ('status', models.CharField(db_index=True, default='', max_length=64)),
                ('preauthorized', models.BooleanField(default=False)),
                ('captured_amount', models.BigIntegerField(default=0)),
                ('request_payload', models.JSONField(blank=True, default=dict)),
                ('response_payload', models.JSONField(blank=True, default=dict)),
                ('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='gopay_payments', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='GoPayRefund',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gopay_refund_id', models.CharField(blank=True, default='', max_length=64)),
                ('amount', models.BigIntegerField(help_text='Amount in minor units.')),
                ('status', models.CharField(blank=True, default='', max_length=64)),
                ('payload', models.JSONField(blank=True, default=dict)),
                ('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
                ('payment', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='refunds', to='gopay.gopaypayment')),
            ],
        ),
        migrations.CreateModel(
            name='GoPaySubscription',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recurrence_id', models.CharField(blank=True, default='', max_length=64)),
                ('status', models.CharField(blank=True, default='', max_length=64)),
                ('interval', models.CharField(blank=True, default='', max_length=64)),
                ('next_payment_on', models.DateTimeField(blank=True, null=True)),
                ('payload', models.JSONField(blank=True, default=dict)),
                ('canceled', models.BooleanField(default=False)),
                ('canceled_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(db_index=True, default=django.utils.timezone.now)),
                ('parent_payment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='subscriptions', to='gopay.gopaypayment')),
            ],
        ),
    ]
