# Generated by Django 5.2.12 on 2026-03-03 22:53

import django.db.models.deletion
import django_ckeditor_5.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Amenity',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('icon', models.CharField(blank=True, help_text='FontAwesome class e.g. fa-swimming-pool', max_length=100)),
            ],
            options={
                'verbose_name_plural': 'Amenities',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('slug', models.SlugField(blank=True, max_length=280, unique=True)),
                ('description', django_ckeditor_5.fields.CKEditor5Field()),
                ('listing_type', models.CharField(choices=[('for_sale', 'For Sale'), ('for_rent', 'For Rent'), ('for_lease', 'For Lease'), ('joint_venture', 'Joint Venture')], default='for_sale', max_length=20)),
                ('property_type', models.CharField(choices=[('residential', 'Residential'), ('commercial', 'Commercial'), ('land', 'Land'), ('mixed_use', 'Mixed Use')], default='residential', max_length=20)),
                ('status', models.CharField(choices=[('available', 'Available'), ('sold', 'Sold'), ('rented', 'Rented'), ('off_market', 'Off Market')], default='available', max_length=20)),
                ('price', models.DecimalField(decimal_places=2, max_digits=15)),
                ('price_suffix', models.CharField(blank=True, help_text='e.g. per annum, outright', max_length=50)),
                ('negotiable', models.BooleanField(default=False)),
                ('bedrooms', models.PositiveIntegerField(blank=True, null=True)),
                ('bathrooms', models.PositiveIntegerField(blank=True, null=True)),
                ('toilets', models.PositiveIntegerField(blank=True, null=True)),
                ('area_sqm', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('floors', models.PositiveIntegerField(blank=True, null=True)),
                ('parking_spaces', models.PositiveIntegerField(blank=True, null=True)),
                ('address', models.CharField(max_length=300)),
                ('city', models.CharField(max_length=100)),
                ('state', models.CharField(default='FCT', max_length=100)),
                ('lga', models.CharField(blank=True, max_length=100, verbose_name='LGA')),
                ('latitude', models.DecimalField(blank=True, decimal_places=7, max_digits=10, null=True)),
                ('longitude', models.DecimalField(blank=True, decimal_places=7, max_digits=10, null=True)),
                ('is_featured', models.BooleanField(default=False, help_text='Show on homepage featured section')),
                ('is_published', models.BooleanField(default=True, help_text='Uncheck to hide from public')),
                ('meta_title', models.CharField(blank=True, max_length=160)),
                ('meta_description', models.CharField(blank=True, max_length=300)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('amenities', models.ManyToManyField(blank=True, to='properties.amenity')),
                ('parent', models.ForeignKey(blank=True, help_text='Set this if the property is a unit within a larger estate or development', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='units', to='properties.property')),
            ],
            options={
                'verbose_name_plural': 'Properties',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='PropertyImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='properties/')),
                ('caption', models.CharField(blank=True, max_length=200)),
                ('is_primary', models.BooleanField(default=False, help_text='This image will be the main listing thumbnail')),
                ('order', models.PositiveIntegerField(default=0)),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='images', to='properties.property')),
            ],
            options={
                'ordering': ['order', '-is_primary'],
            },
        ),
    ]
