# Generated by Django 5.0.6 on 2026-05-01 14:08

import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('landing_pages', '0001_initial'),
        ('properties', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Lead',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=120)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('phone', models.CharField(blank=True, max_length=30)),
                ('message', models.TextField(blank=True)),
                ('interested_in', models.CharField(blank=True, help_text='e.g. "3-bed in Lekki"', max_length=200)),
                ('budget_min', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('budget_max', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('source', models.CharField(choices=[('inquiry_form', 'Inquiry Form'), ('property_inquiry', 'Property Inquiry'), ('contact_form', 'Contact Form'), ('exit_popup', 'Exit Popup'), ('newsletter', 'Newsletter'), ('chatbot', 'Chatbot'), ('whatsapp', 'WhatsApp'), ('phone', 'Phone Call'), ('landing_page', 'Landing Page'), ('other', 'Other')], default='inquiry_form', max_length=30)),
                ('status', models.CharField(choices=[('new', 'New'), ('contacted', 'Contacted'), ('qualified', 'Qualified'), ('viewing_scheduled', 'Viewing Scheduled'), ('negotiating', 'Negotiating'), ('won', 'Won — Closed'), ('lost', 'Lost'), ('spam', 'Spam')], default='new', max_length=30)),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('user_agent', models.CharField(blank=True, max_length=255)),
                ('referrer', models.URLField(blank=True, max_length=500)),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('contacted_at', models.DateTimeField(blank=True, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('assigned_to', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='leads', to=settings.AUTH_USER_MODEL)),
                ('landing_page', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='leads', to='landing_pages.landingpage')),
                ('property', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='leads', to='properties.property')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
