# Generated by Django 6.0 on 2026-03-06 20:33

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('students', '0002_alter_student_date_of_birth'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ParentSession',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('login_time', models.DateTimeField(auto_now_add=True)),
                ('logout_time', models.DateTimeField(blank=True, null=True)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('user_agent', models.TextField(blank=True)),
                ('is_active', models.BooleanField(default=True)),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sessions', to='students.parentguardian')),
            ],
            options={
                'verbose_name': 'Parent Session',
                'verbose_name_plural': 'Parent Sessions',
                'ordering': ['-login_time'],
            },
        ),
        migrations.CreateModel(
            name='ParentFeedback',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('subject', models.CharField(max_length=200)),
                ('message', models.TextField()),
                ('submitted_at', models.DateTimeField(auto_now_add=True)),
                ('is_read', models.BooleanField(default=False)),
                ('response', models.TextField(blank=True)),
                ('responded_at', models.DateTimeField(blank=True, null=True)),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='feedbacks', to='students.parentguardian')),
                ('responded_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='feedback_responses', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Parent Feedback',
                'verbose_name_plural': 'Parent Feedbacks',
                'ordering': ['-submitted_at'],
                'indexes': [models.Index(fields=['submitted_at'], name='parents_par_submitt_64a06a_idx'), models.Index(fields=['is_read'], name='parents_par_is_read_4705e8_idx')],
            },
        ),
        migrations.CreateModel(
            name='ParentNotification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
                ('message', models.TextField()),
                ('sent_at', models.DateTimeField(auto_now_add=True)),
                ('is_read', models.BooleanField(default=False)),
                ('read_at', models.DateTimeField(blank=True, null=True)),
                ('notification_type', models.CharField(choices=[('fee_reminder', 'Fee Reminder'), ('attendance_alert', 'Attendance Alert'), ('exam_notice', 'Exam Notice'), ('event', 'School Event'), ('general', 'General Announcement')], default='general', max_length=20)),
                ('link', models.CharField(blank=True, max_length=200)),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to='students.parentguardian')),
            ],
            options={
                'verbose_name': 'Parent Notification',
                'verbose_name_plural': 'Parent Notifications',
                'ordering': ['-sent_at'],
                'indexes': [models.Index(fields=['sent_at'], name='parents_par_sent_at_996a43_idx'), models.Index(fields=['is_read'], name='parents_par_is_read_805206_idx'), models.Index(fields=['notification_type'], name='parents_par_notific_8b7ff6_idx')],
            },
        ),
    ]
