# Generated by Django 4.2.28 on 2026-02-22 16:06

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    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=100)),
                ('account_type', models.CharField(choices=[('cash', 'Cash'), ('bank', 'Bank'), ('mobile', 'Mobile Money'), ('other', 'Other')], default='cash', max_length=20)),
                ('balance', models.DecimalField(decimal_places=2, default=0, max_digits=15)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='AccountTransaction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tx_type', models.CharField(choices=[('sale', 'Sale'), ('expense', 'Expense'), ('income', 'Other Income'), ('draw', 'Owner Draw'), ('transfer', 'Transfer'), ('adjustment', 'Adjustment')], max_length=20)),
                ('amount', models.DecimalField(decimal_places=2, max_digits=15)),
                ('direction', models.CharField(choices=[('in', 'Money In'), ('out', 'Money Out')], max_length=4)),
                ('description', models.CharField(blank=True, max_length=255)),
                ('reference', models.CharField(blank=True, max_length=100)),
                ('date', models.DateField(default=django.utils.timezone.now)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('account', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='transactions', to='finance.account')),
            ],
        ),
    ]
