# Generated by Django 6.0.5 on 2026-06-01 08:06

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


class Migration(migrations.Migration):

    dependencies = [
        ("community", "0006_attachmentpost_campuslisting_campusnotice_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.RemoveField(
            model_name="campusnotice",
            name="posted_by",
        ),
        migrations.RenameField(
            model_name="hostellisting",
            old_name="university",
            new_name="near_campus",
        ),
        migrations.AlterField(
            model_name="hostellisting",
            name="distance",
            field=models.CharField(blank=True, max_length=100),
        ),
        migrations.CreateModel(
            name="BusinessProfile",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("shop_name", models.CharField(max_length=200)),
                ("slug", models.SlugField(blank=True, max_length=220, unique=True)),
                (
                    "category",
                    models.CharField(
                        choices=[
                            ("cyber", "Cyber & Printing"),
                            ("food", "Food & Restaurant"),
                            ("boda", "Boda Boda Stage"),
                            ("hostel", "Hostel & Accommodation"),
                            ("retail", "Retail Shop"),
                            ("services", "Professional Services"),
                            ("education", "Education & Tutoring"),
                            ("other", "Other"),
                        ],
                        default="other",
                        max_length=20,
                    ),
                ),
                ("description", models.TextField()),
                ("address", models.CharField(max_length=300)),
                ("neighborhood", models.CharField(blank=True, max_length=50)),
                (
                    "near_campus",
                    models.CharField(
                        blank=True,
                        choices=[
                            ("mku", "Mount Kenya University"),
                            ("dkut", "Dedan Kimathi University"),
                            ("kca", "KCA University"),
                            ("other", "Other"),
                        ],
                        max_length=20,
                    ),
                ),
                ("phone", models.CharField(blank=True, max_length=20)),
                ("whatsapp", models.CharField(blank=True, max_length=20)),
                ("email", models.EmailField(blank=True, max_length=254)),
                (
                    "logo",
                    models.ImageField(
                        blank=True, null=True, upload_to="business/logos/"
                    ),
                ),
                (
                    "cover_image",
                    models.ImageField(
                        blank=True, null=True, upload_to="business/covers/"
                    ),
                ),
                ("is_verified", models.BooleanField(default=False)),
                ("is_active", models.BooleanField(default=True)),
                ("followers_count", models.PositiveIntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "owner",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="business_profile",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-is_verified", "-created_at"],
            },
        ),
        migrations.CreateModel(
            name="BusinessPost",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=200)),
                ("body", models.TextField()),
                (
                    "image",
                    models.ImageField(
                        blank=True, null=True, upload_to="business/posts/"
                    ),
                ),
                ("is_deal", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="posts",
                        to="community.businessprofile",
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
        migrations.CreateModel(
            name="BusinessFollower",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="followed_businesses",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="followers",
                        to="community.businessprofile",
                    ),
                ),
            ],
            options={
                "unique_together": {("business", "user")},
            },
        ),
        migrations.CreateModel(
            name="BusinessService",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=200)),
                ("description", models.CharField(blank=True, max_length=300)),
                ("price", models.CharField(blank=True, max_length=100)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "business",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="services",
                        to="community.businessprofile",
                    ),
                ),
            ],
            options={
                "ordering": ["name"],
            },
        ),
        migrations.CreateModel(
            name="CampusResource",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=200)),
                ("description", models.TextField(blank=True)),
                (
                    "resource_type",
                    models.CharField(
                        choices=[
                            ("past_paper", "Past Paper"),
                            ("notes", "Lecture Notes"),
                            ("tp_ip", "TP/IP File"),
                            ("module", "Module"),
                            ("other", "Other"),
                        ],
                        default="other",
                        max_length=20,
                    ),
                ),
                (
                    "university",
                    models.CharField(
                        choices=[
                            ("mku", "Mount Kenya University"),
                            ("dkut", "Dedan Kimathi University"),
                            ("kca", "KCA University"),
                            ("other", "Other"),
                        ],
                        default="mku",
                        max_length=20,
                    ),
                ),
                ("unit_code", models.CharField(blank=True, max_length=20)),
                ("course", models.CharField(blank=True, max_length=100)),
                ("year", models.CharField(blank=True, max_length=10)),
                (
                    "price",
                    models.DecimalField(
                        blank=True, decimal_places=2, max_digits=8, null=True
                    ),
                ),
                ("is_free", models.BooleanField(default=True)),
                ("phone", models.CharField(blank=True, max_length=20)),
                ("file_url", models.URLField(blank=True)),
                (
                    "image",
                    models.ImageField(
                        blank=True, null=True, upload_to="campus/resources/"
                    ),
                ),
                ("downloads", models.PositiveIntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "business",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="resources",
                        to="community.businessprofile",
                    ),
                ),
                (
                    "posted_by",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="campus_resources",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-created_at"],
            },
        ),
        migrations.DeleteModel(
            name="CampusListing",
        ),
        migrations.DeleteModel(
            name="CampusNotice",
        ),
    ]
