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='Account',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('type', models.CharField(choices=[('cash', 'Cash'), ('bank', 'Bank'), ('wallet', 'Wallet'), ('receivable', 'Receivable'), ('payable', 'Payable'), ('other', 'Other')], default='cash', max_length=20)),
                ('opening_balance', models.DecimalField(decimal_places=2, default=0, max_digits=18)),
                ('description', models.CharField(blank=True, default='', max_length=500)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={'ordering': ('name',)},
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transaction_type', models.CharField(choices=[('income', 'Income'), ('expense', 'Expense')], max_length=10)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=18)),
                ('description', models.CharField(blank=True, default='', max_length=500)),
                ('transaction_date', models.DateField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='transactions', to='accounting.account')),
                ('created_by', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='accounting_transactions', to=settings.AUTH_USER_MODEL)),
            ],
            options={'ordering': ('-transaction_date', '-id')},
        ),
    ]
