# Generated by Django 5.1.4 on 2026-02-10 20:24

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 = [
        ("billing", "0002_initial"),
        ("core", "0002_initial"),
        ("members", "0001_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Event",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("name", models.CharField(max_length=255)),
                ("description", models.TextField(blank=True)),
                (
                    "event_type",
                    models.CharField(
                        choices=[
                            ("workshop", "Workshop"),
                            ("seminar", "Seminar"),
                            ("competition", "Competition"),
                            ("social", "Social"),
                            ("charity", "Charity"),
                            ("open_day", "Open Day"),
                            ("other", "Other"),
                        ],
                        default="other",
                        max_length=20,
                    ),
                ),
                ("venue", models.CharField(blank=True, max_length=255)),
                ("start_date", models.DateTimeField()),
                ("end_date", models.DateTimeField()),
                ("capacity", models.PositiveIntegerField(default=0)),
                ("registered_count", models.PositiveIntegerField(default=0)),
                (
                    "price",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=10, null=True
                    ),
                ),
                (
                    "image",
                    models.ImageField(
                        blank=True, null=True, upload_to="events/images/"
                    ),
                ),
                ("is_free", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                ("registration_deadline", models.DateTimeField(blank=True, null=True)),
                (
                    "location",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="events",
                        to="core.location",
                    ),
                ),
                (
                    "organizer",
                    models.ForeignKey(
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="organized_events",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Event",
                "verbose_name_plural": "Events",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="EventRegistration",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("guest_name", models.CharField(blank=True, max_length=255)),
                ("guest_email", models.EmailField(blank=True, max_length=254)),
                ("guest_phone", models.CharField(blank=True, max_length=20)),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("registered", "Registered"),
                            ("confirmed", "Confirmed"),
                            ("attended", "Attended"),
                            ("cancelled", "Cancelled"),
                            ("waitlisted", "Waitlisted"),
                        ],
                        default="registered",
                        max_length=20,
                    ),
                ),
                ("ticket_code", models.CharField(max_length=100, unique=True)),
                ("paid", models.BooleanField(default=False)),
                ("checked_in", models.BooleanField(default=False)),
                ("checked_in_at", models.DateTimeField(blank=True, null=True)),
                (
                    "event",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="registrations",
                        to="events.event",
                    ),
                ),
                (
                    "member",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="event_registrations",
                        to="members.memberprofile",
                    ),
                ),
                (
                    "payment",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="event_registrations",
                        to="billing.payment",
                    ),
                ),
            ],
            options={
                "verbose_name": "Event Registration",
                "verbose_name_plural": "Event Registrations",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="EventTicketType",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("name", models.CharField(max_length=255)),
                (
                    "price",
                    models.DecimalField(decimal_places=2, default=0, max_digits=10),
                ),
                ("capacity", models.PositiveIntegerField(default=0)),
                ("sold_count", models.PositiveIntegerField(default=0)),
                ("description", models.TextField(blank=True)),
                (
                    "event",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="ticket_types",
                        to="events.event",
                    ),
                ),
            ],
            options={
                "verbose_name": "Event Ticket Type",
                "verbose_name_plural": "Event Ticket Types",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="KidsEnrollment",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("child_name", models.CharField(max_length=255)),
                ("child_age", models.PositiveIntegerField(default=0)),
                (
                    "emergency_contact_name",
                    models.CharField(blank=True, max_length=255),
                ),
                (
                    "emergency_contact_phone",
                    models.CharField(blank=True, max_length=20),
                ),
                ("medical_notes", models.TextField(blank=True)),
                ("allergies", models.TextField(blank=True)),
                (
                    "pickup_authorized_persons",
                    models.JSONField(
                        blank=True,
                        default=list,
                        help_text="List of persons authorized to pick up the child",
                    ),
                ),
                (
                    "status",
                    models.CharField(
                        choices=[
                            ("active", "Active"),
                            ("inactive", "Inactive"),
                            ("waitlisted", "Waitlisted"),
                        ],
                        default="active",
                        max_length=20,
                    ),
                ),
                ("start_date", models.DateField()),
                ("end_date", models.DateField(blank=True, null=True)),
                (
                    "parent",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="kids_enrollments",
                        to="members.memberprofile",
                    ),
                ),
            ],
            options={
                "verbose_name": "Kids Enrollment",
                "verbose_name_plural": "Kids Enrollments",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="KidsAttendance",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("date", models.DateField()),
                ("check_in", models.DateTimeField()),
                ("check_out", models.DateTimeField(blank=True, null=True)),
                ("picked_up_by", models.CharField(blank=True, max_length=255)),
                ("notes", models.TextField(blank=True)),
                (
                    "enrollment",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="attendance_records",
                        to="events.kidsenrollment",
                    ),
                ),
            ],
            options={
                "verbose_name": "Kids Attendance",
                "verbose_name_plural": "Kids Attendance Records",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.CreateModel(
            name="KidsProgram",
            fields=[
                (
                    "id",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("name", models.CharField(max_length=255)),
                ("description", models.TextField(blank=True)),
                ("age_min", models.PositiveIntegerField(default=0)),
                ("age_max", models.PositiveIntegerField(default=0)),
                ("capacity", models.PositiveIntegerField(default=0)),
                (
                    "schedule",
                    models.JSONField(
                        blank=True,
                        default=dict,
                        help_text="Weekly schedule configuration",
                    ),
                ),
                (
                    "price_per_session",
                    models.DecimalField(decimal_places=2, default=0, max_digits=10),
                ),
                (
                    "monthly_price",
                    models.DecimalField(decimal_places=2, default=0, max_digits=10),
                ),
                ("is_active", models.BooleanField(default=True)),
                (
                    "image",
                    models.ImageField(
                        blank=True, null=True, upload_to="kids/programs/"
                    ),
                ),
                (
                    "instructor",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="kids_programs",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "location",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="kids_programs",
                        to="core.location",
                    ),
                ),
            ],
            options={
                "verbose_name": "Kids Program",
                "verbose_name_plural": "Kids Programs",
                "ordering": ["-created_at"],
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="kidsenrollment",
            name="program",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="enrollments",
                to="events.kidsprogram",
            ),
        ),
    ]
