# Generated by Django 4.2.3 on 2023-08-10 21:47

from django.db import migrations, models
import django.db.models.deletion
import tinymce.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('landlords', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Property',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('address', models.CharField(default='addr', max_length=255)),
                ('city', models.CharField(default='Oyugis', max_length=255)),
                ('country', models.CharField(default='Kenya', max_length=255)),
                ('property_type', models.CharField(choices=[('house', 'House'), ('apartment', 'Apartment'), ('condo', 'Condo'), ('townhouse', 'Townhouse'), ('commercial', 'Commercial')], default='apartment', max_length=20)),
                ('property_name', models.CharField(default='amase', max_length=255)),
                ('description', tinymce.models.HTMLField()),
                ('amenities', tinymce.models.HTMLField()),
                ('property_status', models.CharField(choices=[('available', 'Available'), ('rented', 'Rented'), ('unavailable', 'Unavailable')], default='available', max_length=20)),
                ('year_built', models.PositiveIntegerField(default=2023)),
                ('square_footage', models.PositiveIntegerField(default=0)),
                ('is_featured', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='properties', to='landlords.propertyowner')),
            ],
            options={
                'verbose_name_plural': 'Properties',
                'db_table': 'properties',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PropertyUnitImages',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='property_units/images')),
            ],
            options={
                'verbose_name_plural': 'Property Unit Images',
                'db_table': 'property_unit_images',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Units',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(default='test', max_length=100)),
                ('unit_code', models.CharField(default='001', max_length=100)),
                ('description', tinymce.models.HTMLField()),
                ('rental_price', models.DecimalField(decimal_places=2, max_digits=8)),
                ('square_footage', models.PositiveIntegerField(default=2)),
                ('bedrooms', models.PositiveIntegerField(default=0)),
                ('bathrooms', models.PositiveIntegerField(default=0)),
                ('unit_type', models.CharField(choices=[('studio', 'Studio'), ('1br', '1 Bedroom'), ('2br', '2 Bedrooms'), ('3br', '3 Bedrooms'), ('penthouse', 'Penthouse'), ('office', 'Office Space')], max_length=20)),
                ('is_featured', models.BooleanField(default=False)),
                ('is_available', models.BooleanField(default=True)),
                ('property_unit_images', models.ManyToManyField(blank=True, null=True, to='property.propertyunitimages')),
            ],
            options={
                'verbose_name_plural': 'Units',
                'db_table': 'units',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='propertyunitimages',
            name='property_unit',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='unit_images', to='property.units'),
        ),
        migrations.CreateModel(
            name='PropertyImages',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='property/images')),
                ('property', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='property_images', to='property.property')),
            ],
            options={
                'verbose_name_plural': 'Property Images',
                'db_table': 'property_images',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='property',
            name='units',
            field=models.ManyToManyField(blank=True, null=True, to='property.units'),
        ),
    ]
