# Generated by Django 4.1 on 2024-04-25 06:31

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Distributors',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('code', models.CharField(editable=False, max_length=20, unique=True)),
                ('mobile', models.CharField(max_length=20, unique=True)),
                ('password', models.CharField(max_length=20)),
                ('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': 'Distributors',
                'verbose_name_plural': 'Distributors',
            },
        ),
        migrations.CreateModel(
            name='DistributorWallet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('source', models.IntegerField(choices=[(1, 'Super Distributor'), (2, 'Distributor')], default=1)),
                ('amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('is_active', models.BooleanField(default=True, editable=False)),
                ('created_on', models.DateField(default=datetime.datetime.now, editable=False)),
                ('distributor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='distributors.distributors')),
            ],
            options={
                'verbose_name': 'Wallets',
                'verbose_name_plural': 'Wallets',
            },
        ),
        migrations.CreateModel(
            name='WalletTransaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('type', models.IntegerField(choices=[(1, 'Credit'), (2, 'Debit')], default=1)),
                ('cumulative', models.DecimalField(decimal_places=2, default=0, max_digits=10)),
                ('is_active', models.BooleanField(default=True, editable=False)),
                ('created_on', models.DateField(default=datetime.datetime.now, editable=False)),
                ('wallet', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='distributors.distributorwallet')),
            ],
            options={
                'verbose_name': 'Transactions',
                'verbose_name_plural': 'Transactions',
            },
        ),
        migrations.CreateModel(
            name='SuperDistributors',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('code', models.CharField(editable=False, max_length=20, unique=True)),
                ('mobile', models.CharField(max_length=20, unique=True)),
                ('password', models.CharField(max_length=20)),
                ('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': 'Super Distributors',
                'verbose_name_plural': 'Super Distributors',
            },
        ),
        migrations.AddField(
            model_name='distributorwallet',
            name='super_distributor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='distributors.superdistributors'),
        ),
        migrations.AddField(
            model_name='distributors',
            name='super_distributor',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='distributors.superdistributors'),
        ),
    ]
