# Generated by Django 4.2.17 on 2025-04-21 11:57

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("pretixbase", "0287_organizer_plugins"),
    ]

    operations = [
        migrations.RenameField(
            model_name="invoice",
            old_name="sent_to_customer",
            new_name="transmission_date",
        ),
        migrations.AddField(
            model_name="invoice",
            name="invoice_to_transmission_info",
            field=models.JSONField(null=True),
        ),
        migrations.AddField(
            model_name="invoice",
            name="transmission_info",
            field=models.JSONField(null=True),
        ),
        migrations.AddField(
            model_name="invoice",
            name="transmission_provider",
            field=models.CharField(max_length=255, null=True),
        ),
        migrations.AddField(
            model_name="invoice",
            name="transmission_status",
            field=models.CharField(default="unknown", max_length=255),
        ),
        migrations.AddField(
            model_name="invoice",
            name="created",
            field=models.DateTimeField(auto_now_add=True, null=True),
        ),
        migrations.AddField(
            model_name="invoice",
            name="invoice_to_is_business",
            field=models.BooleanField(null=True),
        ),
        migrations.RunSQL(
            "UPDATE pretixbase_invoice SET transmission_status = 'completed' WHERE transmission_date IS NOT NULL",
            migrations.RunSQL.noop,
        ),
        migrations.AddField(
            model_name="invoice",
            name="transmission_type",
            field=models.CharField(default="email", max_length=255),
        ),
        migrations.AddField(
            model_name="invoiceaddress",
            name="transmission_info",
            field=models.JSONField(null=True),
        ),
        migrations.AddField(
            model_name="invoiceaddress",
            name="transmission_type",
            field=models.CharField(default="email", max_length=255),
        ),
        migrations.RunSQL(
            "UPDATE pretixbase_event_settingsstore SET key = 'mail_text_order_invoice' WHERE key = 'payment_banktransfer_invoice_email_text'",
            "UPDATE pretixbase_event_settingsstore SET key = 'payment_banktransfer_invoice_email_text' WHERE key = 'mail_text_order_invoice'",
        ),
        migrations.RunSQL(
            "UPDATE pretixbase_event_settingsstore SET key = 'mail_subject_order_invoice' WHERE key = 'payment_banktransfer_invoice_email_subject'",
            "UPDATE pretixbase_event_settingsstore SET key = 'payment_banktransfer_invoice_email_subject' WHERE key = 'mail_subject_order_invoice'",
        ),
    ]
