# Generated by Django 4.2 on 2023-11-17 11:12

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


class Migration(migrations.Migration):
    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Checkout",
            fields=[
                (
                    "session_id",
                    models.CharField(
                        max_length=100,
                        primary_key=True,
                        serialize=False,
                        verbose_name="Session ID",
                    ),
                ),
                ("type", models.CharField(max_length=250, verbose_name="Type")),
                (
                    "payment_type",
                    models.CharField(max_length=250, verbose_name="Payment Type"),
                ),
                ("amount", models.CharField(max_length=20, verbose_name="Amount")),
                (
                    "currency_code",
                    models.CharField(max_length=10, verbose_name="Currency Code"),
                ),
                ("state", models.CharField(max_length=250, verbose_name="State")),
                (
                    "customer_id",
                    models.CharField(
                        blank=True,
                        max_length=250,
                        verbose_name="Customer ID",
                    ),
                ),
                (
                    "token",
                    models.CharField(blank=True, max_length=250, verbose_name="Token"),
                ),
                (
                    "agreement",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        verbose_name="Agreement",
                    ),
                ),
                (
                    "extra_params",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        verbose_name="Extra Params",
                    ),
                ),
                (
                    "created_at",
                    models.DateTimeField(auto_now_add=True, verbose_name="Created At"),
                ),
                (
                    "updated_at",
                    models.DateTimeField(auto_now=True, verbose_name="Updated At"),
                ),
            ],
            options={
                "verbose_name": "Checkout",
                "verbose_name_plural": "Checkout",
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="Webhook",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "session_id",
                    models.CharField(max_length=250, verbose_name="Session ID"),
                ),
                (
                    "payload",
                    models.JSONField(blank=True, default=dict, verbose_name="Payload"),
                ),
                (
                    "timestamp",
                    models.DateTimeField(auto_now_add=True, verbose_name="Timestamp"),
                ),
                (
                    "checkout",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="ottu.checkout",
                        verbose_name="Checkout",
                    ),
                ),
            ],
            options={
                "verbose_name": "Webhook",
                "verbose_name_plural": "Webhooks",
                "abstract": False,
            },
        ),
    ]
