# Generated by Django 4.2.30 on 2026-09-15 13:00

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='NotificationSetting',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.CharField(max_length=20)),
                ('notification_type', models.CharField(choices=[('PRICE_OUT_OF_RANGE', 'Sale priced outside normal range'), ('OUT_OF_STOCK', 'Part out of stock'), ('LOW_STOCK', 'Part low on stock')], max_length=30)),
                ('enabled', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['notification_type', 'role'],
                'unique_together': {('role', 'notification_type')},
            },
        ),
        migrations.CreateModel(
            name='Notification',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('notification_type', models.CharField(choices=[('PRICE_OUT_OF_RANGE', 'Sale priced outside normal range'), ('OUT_OF_STOCK', 'Part out of stock'), ('LOW_STOCK', 'Part low on stock')], max_length=30)),
                ('title', models.CharField(max_length=200)),
                ('message', models.CharField(blank=True, max_length=500)),
                ('link_path', models.CharField(blank=True, max_length=200)),
                ('is_read', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('recipient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='notifications', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-created_at'],
                'indexes': [models.Index(fields=['recipient', 'is_read'], name='notificatio_recipie_4e3567_idx')],
            },
        ),
    ]
