from django.db import migrations, models


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="MollieWebhookEvent",
            fields=[
                (
                    "id",
                    models.BigAutoField(primary_key=True, serialize=False),
                ),
                ("provider_reference", models.CharField(max_length=64)),
                ("fingerprint", models.CharField(max_length=64)),
                ("status", models.CharField(max_length=32)),
                ("received_at", models.DateTimeField(auto_now_add=True)),
                ("processed_at", models.DateTimeField(blank=True, null=True)),
                ("failure_reason", models.CharField(blank=True, max_length=255)),
            ],
            options={"ordering": ("-received_at",)},
        ),
        migrations.AddConstraint(
            model_name="molliewebhookevent",
            constraint=models.UniqueConstraint(
                fields=("provider_reference", "fingerprint"),
                name="payment_mollie_webhook_event_once",
            ),
        ),
    ]
