# Generated manually for MentorClientInvitation

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


class Migration(migrations.Migration):

    dependencies = [
        ('users', '0002_add_universal_code'),
    ]

    operations = [
        migrations.CreateModel(
            name='MentorClientInvitation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.CharField(
                    choices=[
                        ('pending', 'Ожидает подтверждения'),
                        ('student_confirmed', 'Студент подтвердил'),
                        ('parent_confirmed', 'Родитель подтвердил'),
                        ('confirmed', 'Подтверждено'),
                        ('rejected', 'Отклонено'),
                    ],
                    db_index=True,
                    default='pending',
                    max_length=20,
                    verbose_name='Статус',
                )),
                ('confirm_token', models.CharField(blank=True, max_length=64, null=True, unique=True, verbose_name='Токен подтверждения')),
                ('student_confirmed_at', models.DateTimeField(blank=True, null=True, verbose_name='Подтверждено студентом')),
                ('parent_confirmed_at', models.DateTimeField(blank=True, null=True, verbose_name='Подтверждено родителем')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата создания')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Дата обновления')),
                ('mentor', models.ForeignKey(
                    limit_choices_to={'role': 'mentor'},
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='sent_invitations',
                    to=settings.AUTH_USER_MODEL,
                    verbose_name='Ментор',
                )),
                ('student', models.ForeignKey(
                    limit_choices_to={'role': 'client'},
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='mentor_invitations',
                    to=settings.AUTH_USER_MODEL,
                    verbose_name='Студент',
                )),
            ],
            options={
                'verbose_name': 'Приглашение ментор—студент',
                'verbose_name_plural': 'Приглашения ментор—студент',
                'db_table': 'mentor_client_invitations',
                'ordering': ['-created_at'],
                'unique_together': {('mentor', 'student')},
            },
        ),
    ]
