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


class Migration(migrations.Migration):

    dependencies = [
        ('sales', '0001_initial'),
        ('tenants', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='ProjectAssessment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('email', models.EmailField(max_length=254)),
                ('phone', models.CharField(blank=True, max_length=30)),
                ('company', models.CharField(blank=True, max_length=150)),
                ('service_type', models.CharField(
                    choices=[
                        ('web', 'Website / Web Portal'),
                        ('ecommerce', 'E-commerce Store'),
                        ('app', 'Mobile App (iOS / Android)'),
                        ('marketing', 'Digital Marketing (SEO / SEM)'),
                        ('portal', 'Client Portal / Dashboard'),
                        ('saas', 'SaaS Platform'),
                        ('other', 'Other / Not Sure'),
                    ],
                    default='web', max_length=30,
                )),
                ('project_description', models.TextField(blank=True, help_text='What the client described')),
                ('features_requested', models.TextField(blank=True, help_text='JSON list of selected features')),
                ('budget', models.CharField(
                    choices=[
                        ('under_2k', 'Under £2,000'),
                        ('2k_5k', '£2,000 – £5,000'),
                        ('5k_15k', '£5,000 – £15,000'),
                        ('15k_50k', '£15,000 – £50,000'),
                        ('over_50k', 'Over £50,000'),
                        ('discuss', 'I prefer to discuss'),
                    ],
                    default='discuss', max_length=20,
                )),
                ('timeline', models.CharField(
                    choices=[
                        ('asap', 'As soon as possible'),
                        ('1_month', 'Within 1 month'),
                        ('3_months', '1 – 3 months'),
                        ('6_months', '3 – 6 months'),
                        ('flexible', 'Flexible / Not urgent'),
                    ],
                    default='flexible', max_length=20,
                )),
                ('reference_sites', models.TextField(blank=True, help_text='Websites the client likes / wants as reference')),
                ('est_weeks_min', models.PositiveSmallIntegerField(blank=True, help_text='Estimated delivery min weeks', null=True)),
                ('est_weeks_max', models.PositiveSmallIntegerField(blank=True, help_text='Estimated delivery max weeks', null=True)),
                ('est_cost_min', models.DecimalField(blank=True, decimal_places=2, help_text='Estimated cost min (GBP)', max_digits=10, null=True)),
                ('est_cost_max', models.DecimalField(blank=True, decimal_places=2, help_text='Estimated cost max (GBP)', max_digits=10, null=True)),
                ('internal_notes', models.TextField(blank=True, help_text='Internal notes — not visible to client')),
                ('status', models.CharField(
                    choices=[
                        ('new', 'New'),
                        ('reviewed', 'Reviewed'),
                        ('quoted', 'Quoted'),
                        ('won', 'Won'),
                        ('lost', 'Lost'),
                    ],
                    default='new', max_length=20,
                )),
                ('ip_address', models.GenericIPAddressField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('tenant', models.ForeignKey(
                    blank=True, null=True,
                    on_delete=django.db.models.deletion.CASCADE,
                    related_name='project_assessments',
                    to='tenants.tenant',
                )),
            ],
            options={
                'verbose_name': 'Project Assessment',
                'verbose_name_plural': 'Project Assessments',
                'ordering': ['-created_at'],
            },
        ),
    ]
