# Generated by Django 5.2.4 on 2025-07-21 13:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='Timestamp when this object was created', verbose_name='Created At')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='Timestamp when this object was last modified', verbose_name='Updated At')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, help_text='Unique identifier for this object', primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False, help_text='Whether this object has been soft-deleted', verbose_name='Is Deleted')),
                ('deleted_at', models.DateTimeField(blank=True, help_text='Timestamp when this object was soft-deleted', null=True, verbose_name='Deleted At')),
                ('title', models.CharField(help_text='Notification title', max_length=200, verbose_name='Title')),
                ('message', models.TextField(help_text='Notification message content', verbose_name='Message')),
                ('notification_type', models.CharField(choices=[('info', 'Information'), ('success', 'Success'), ('warning', 'Warning'), ('error', 'Error'), ('system', 'System')], default='info', help_text='Type of notification', max_length=20, verbose_name='Type')),
                ('is_read', models.BooleanField(default=False, help_text='Whether this notification has been read', verbose_name='Is Read')),
                ('read_at', models.DateTimeField(blank=True, help_text='When this notification was read', null=True, verbose_name='Read At')),
                ('action_url', models.URLField(blank=True, help_text='Optional URL for notification action', verbose_name='Action URL')),
                ('created_by', models.ForeignKey(blank=True, help_text='User who created this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_created', to=settings.AUTH_USER_MODEL, verbose_name='Created By')),
                ('deleted_by', models.ForeignKey(blank=True, help_text='User who soft-deleted this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_deleted', to=settings.AUTH_USER_MODEL, verbose_name='Deleted By')),
                ('recipient', models.ForeignKey(help_text='User who should receive this notification', on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL, verbose_name='Recipient')),
                ('updated_by', models.ForeignKey(blank=True, help_text='User who last modified this object', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_updated', to=settings.AUTH_USER_MODEL, verbose_name='Updated By')),
            ],
            options={
                'verbose_name': 'Notification',
                'verbose_name_plural': 'Notifications',
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['recipient', 'is_read'], name='notificatio_recipie_4e3567_idx'), models.Index(fields=['notification_type', 'created_at'], name='notificatio_notific_f2e0f7_idx')],
            },
        ),
    ]
