# Generated by Django 5.0.3 on 2024-03-21 11:57

import datetime
import django.db.models.deletion
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="RechargeType",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("is_active", models.BooleanField(default=True, editable=False)),
                (
                    "created_on",
                    models.DateField(default=datetime.datetime.now, editable=False),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Recharge Type",
                "verbose_name_plural": "Recharge Type",
            },
        ),
        migrations.CreateModel(
            name="Retailer",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=150)),
                ("url", models.SlugField(blank=True, editable=False, null=True)),
                (
                    "profile",
                    models.ImageField(blank=True, null=True, upload_to="profile/"),
                ),
                ("mobile", models.CharField(max_length=20)),
                ("email", models.EmailField(max_length=250)),
                ("address", models.TextField(blank=True, null=True)),
                ("pincode", models.CharField(max_length=250)),
                ("is_active", models.BooleanField(default=True, editable=False)),
                (
                    "created_on",
                    models.DateField(default=datetime.datetime.now, editable=False),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Retailer",
                "verbose_name_plural": "Retailers",
            },
        ),
        migrations.CreateModel(
            name="Recharge",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("amount", models.DecimalField(decimal_places=2, max_digits=12)),
                ("date", models.DateTimeField(default=datetime.datetime.now)),
                ("is_active", models.BooleanField(default=True, editable=False)),
                (
                    "created_on",
                    models.DateField(default=datetime.datetime.now, editable=False),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "recharge_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="retailers.rechargetype",
                    ),
                ),
                (
                    "retailer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="retailers.retailer",
                    ),
                ),
            ],
            options={
                "verbose_name": "Recharge",
                "verbose_name_plural": "Recharge",
            },
        ),
        migrations.CreateModel(
            name="Transaction",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("amount", models.DecimalField(decimal_places=2, max_digits=12)),
                (
                    "transaction_type",
                    models.IntegerField(
                        choices=[(1, "Credit"), (2, "Debit")], default=1
                    ),
                ),
                ("date", models.DateTimeField(default=datetime.datetime.now)),
                ("remark", models.TextField(blank=True, null=True)),
                ("is_active", models.BooleanField(default=True, editable=False)),
                (
                    "created_on",
                    models.DateField(default=datetime.datetime.now, editable=False),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "recharge_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="retailers.rechargetype",
                    ),
                ),
                (
                    "retailer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="retailers.retailer",
                    ),
                ),
            ],
            options={
                "verbose_name": "Transaction",
                "verbose_name_plural": "Transactions",
            },
        ),
        migrations.CreateModel(
            name="Wallet",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("amount", models.DecimalField(decimal_places=2, max_digits=12)),
                ("is_active", models.BooleanField(default=True, editable=False)),
                (
                    "created_on",
                    models.DateField(default=datetime.datetime.now, editable=False),
                ),
                (
                    "created_by",
                    models.ForeignKey(
                        blank=True,
                        editable=False,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "retailer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="retailers.retailer",
                    ),
                ),
            ],
            options={
                "verbose_name": "Wallet",
                "verbose_name_plural": "Wallet",
            },
        ),
    ]
