# Generated by Django 5.2.12 on 2026-04-18 11:48

import django.core.validators
import django.db.models.deletion
from decimal import Decimal
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('invest', '0001_initial'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='transaction',
            name='price_per_share',
        ),
        migrations.AlterField(
            model_name='stock',
            name='quantity',
            field=models.DecimalField(decimal_places=6, default=Decimal('0'), max_digits=20, validators=[django.core.validators.MinValueValidator(Decimal('0'))]),
        ),
        migrations.AlterField(
            model_name='stock',
            name='stock_code',
            field=models.CharField(help_text="Stock ticker, e.g. 'NVDA', '9988.HK'", max_length=20),
        ),
        migrations.AlterField(
            model_name='transaction',
            name='quantity',
            field=models.DecimalField(decimal_places=6, max_digits=20, validators=[django.core.validators.MinValueValidator(Decimal('0.000001'))]),
        ),
        migrations.AlterField(
            model_name='transaction',
            name='stock_code',
            field=models.CharField(max_length=20),
        ),
        migrations.CreateModel(
            name='PortfolioSnapshot',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('captured_at', models.DateTimeField()),
                ('total_value', models.DecimalField(decimal_places=2, max_digits=20)),
                ('portfolio', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='snapshots', to='invest.portfolio')),
            ],
            options={
                'ordering': ['-captured_at'],
                'indexes': [models.Index(fields=['portfolio', 'captured_at'], name='invest_port_portfol_2f1f60_idx')],
            },
        ),
    ]
