# Generated by Django 6.0.3 on 2026-03-25 20:20

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 = [
        ('contenttypes', '0002_remove_content_type_name'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PlannerItem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('uuid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
                ('item_type', models.CharField(choices=[('task', 'Task'), ('event', 'Calendar Event'), ('reminder', 'Reminder')], db_index=True, max_length=10)),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True, default='')),
                ('priority', models.CharField(choices=[('low', 'Low'), ('medium', 'Medium'), ('high', 'High')], default='medium', max_length=10)),
                ('object_id', models.PositiveIntegerField(blank=True, null=True)),
                ('due_at', models.DateTimeField(blank=True, db_index=True, help_text='Deadline (task), event start (event), or target time (reminder).', null=True)),
                ('end_at', models.DateTimeField(blank=True, help_text='Event end time. Only used for calendar events.', null=True)),
                ('remind_at', models.DateTimeField(blank=True, db_index=True, help_text='When to fire the push notification. Can differ from due_at.', null=True)),
                ('is_all_day', models.BooleanField(default=False)),
                ('recurrence', models.CharField(blank=True, choices=[('none', 'None'), ('daily', 'Daily'), ('weekly', 'Weekly'), ('monthly', 'Monthly'), ('yearly', 'Yearly')], default='none', max_length=10)),
                ('is_completed', models.BooleanField(db_index=True, default=False)),
                ('is_reminder_sent', models.BooleanField(default=False, help_text='Set to True after reminder push is dispatched.')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('deleted_at', models.DateTimeField(blank=True, db_index=True, help_text='Soft delete timestamp.', null=True)),
                ('content_type', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='contenttypes.contenttype')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='planner_items', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Planner Item',
                'verbose_name_plural': 'Planner Items',
                'ordering': ['-due_at', '-created_at'],
                'indexes': [models.Index(fields=['user', 'item_type', 'is_completed'], name='idx_planner_user_type_done'), models.Index(fields=['remind_at', 'is_reminder_sent'], name='idx_planner_remind_pending')],
            },
        ),
    ]
