# Generated by Django 5.1.6 on 2025-03-06 10:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('webapp', '0002_invoice'),
    ]

    operations = [
        migrations.CreateModel(
            name='Lottery',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255, verbose_name='Название лотереи')),
                ('description', models.TextField(blank=True, verbose_name='Описание')),
            ],
        ),
        migrations.CreateModel(
            name='Prize',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('prize_place', models.CharField(help_text='Например, 1 место, 2 место и т.д.', max_length=50, verbose_name='Призовое место')),
                ('description', models.TextField(blank=True, verbose_name='Описание приза')),
                ('reward', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10, verbose_name='Награда')),
                ('lottery', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='prizes', to='draw.lottery', verbose_name='Лотерея')),
                ('winner', models.ForeignKey(blank=True, help_text='Выберите счет участника лотереи, который выиграл приз', null=True, on_delete=django.db.models.deletion.SET_NULL, to='webapp.invoice', verbose_name='Победитель (счет)')),
            ],
        ),
    ]
