# Generated by Django 5.1.2 on 2024-11-12 01:41

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('currencies', '0006_currency_exchange_currency'),
        ('transactions', '0022_rename_paused_recurringtransaction_is_paused'),
    ]

    operations = [
        migrations.CreateModel(
            name='DCAStrategy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notes')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('payment_currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dca_payment_strategies', to='currencies.currency', verbose_name='Payment Currency')),
                ('target_currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='dca_target_strategies', to='currencies.currency', verbose_name='Target Currency')),
            ],
            options={
                'verbose_name': 'DCA Strategy',
                'verbose_name_plural': 'DCA Strategies',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='DCAEntry',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='Date')),
                ('amount_paid', models.DecimalField(decimal_places=8, max_digits=20, verbose_name='Amount Paid')),
                ('amount_received', models.DecimalField(decimal_places=8, max_digits=20, verbose_name='Amount Received')),
                ('notes', models.TextField(blank=True, null=True, verbose_name='Notes')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('expense_transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dca_expense_entries', to='transactions.transaction', verbose_name='Expense Transaction')),
                ('income_transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='dca_income_entries', to='transactions.transaction', verbose_name='Income Transaction')),
                ('strategy', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='entries', to='dca.dcastrategy', verbose_name='Strategy')),
            ],
            options={
                'verbose_name': 'DCA Entry',
                'verbose_name_plural': 'DCA Entries',
                'ordering': ['-date'],
            },
        ),
    ]
