# Generated by Django 5.2.7 on 2026-04-11 01:16

import core.models
import django.db.models.deletion
import django.utils.timezone
import uuid
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Business',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=160)),
                ('slug', models.SlugField(unique=True)),
                ('industry', models.CharField(default='Home Services', max_length=120)),
                ('primary_city', models.CharField(max_length=120)),
                ('primary_state', models.CharField(max_length=2)),
                ('google_review_url', models.URLField(blank=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'verbose_name_plural': 'businesses',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full_name', models.CharField(max_length=160)),
                ('email', models.EmailField(blank=True, max_length=254)),
                ('phone', models.CharField(blank=True, max_length=40)),
                ('city', models.CharField(max_length=120)),
                ('state', models.CharField(max_length=2)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='customers', to='core.business')),
            ],
            options={
                'ordering': ['full_name'],
            },
        ),
        migrations.CreateModel(
            name='Job',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('service_type', models.CharField(max_length=120)),
                ('description', models.TextField(blank=True)),
                ('technician_name', models.CharField(blank=True, max_length=120)),
                ('city', models.CharField(max_length=120)),
                ('state', models.CharField(max_length=2)),
                ('completed_at', models.DateField(default=django.utils.timezone.localdate)),
                ('project_value', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('status', models.CharField(choices=[('completed', 'Completed'), ('review_requested', 'Review requested'), ('proof_ready', 'Proof ready')], default='completed', max_length=32)),
                ('is_verified', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('business', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='core.business')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='jobs', to='core.customer')),
            ],
            options={
                'ordering': ['-completed_at', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='JobMedia',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('media_type', models.CharField(choices=[('before', 'Before'), ('after', 'After')], max_length=16)),
                ('file', models.FileField(blank=True, upload_to=core.models.job_media_upload_path)),
                ('caption', models.CharField(blank=True, max_length=140)),
                ('display_order', models.PositiveSmallIntegerField(default=0)),
                ('job', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='media', to='core.job')),
            ],
            options={
                'verbose_name_plural': 'job media',
                'ordering': ['display_order', 'id'],
            },
        ),
        migrations.CreateModel(
            name='ProofCard',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('customer_display_name', models.CharField(max_length=160)),
                ('is_anonymized', models.BooleanField(default=False)),
                ('testimonial_quote', models.TextField(blank=True)),
                ('rating', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('status', models.CharField(choices=[('draft', 'Draft'), ('published', 'Published'), ('hidden', 'Hidden')], default='draft', max_length=16)),
                ('is_featured', models.BooleanField(default=False)),
                ('attached_widget_label', models.CharField(blank=True, max_length=120)),
                ('attached_pages', models.CharField(blank=True, max_length=200)),
                ('published_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('job', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='proof_card', to='core.job')),
            ],
            options={
                'ordering': ['-is_featured', '-updated_at'],
            },
        ),
        migrations.CreateModel(
            name='ReviewRequest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('status', models.CharField(choices=[('sent', 'Sent'), ('viewed', 'Viewed'), ('responded', 'Responded')], default='sent', max_length=20)),
                ('channel', models.CharField(choices=[('email', 'Email'), ('sms', 'SMS'), ('manual', 'Manual share')], default='email', max_length=16)),
                ('sent_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('last_opened_at', models.DateTimeField(blank=True, null=True)),
                ('reviewed_at', models.DateTimeField(blank=True, null=True)),
                ('delivery_note', models.CharField(blank=True, max_length=200)),
                ('job', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='review_request', to='core.job')),
            ],
            options={
                'ordering': ['-sent_at'],
            },
        ),
        migrations.CreateModel(
            name='Feedback',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('experience', models.CharField(choices=[('great', 'Great'), ('good', 'Good'), ('okay', 'Okay'), ('bad', 'Bad')], max_length=12)),
                ('rating', models.PositiveSmallIntegerField(blank=True, null=True)),
                ('testimonial', models.TextField(blank=True)),
                ('follow_up_required', models.BooleanField(default=False)),
                ('is_public_approved', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('review_request', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='feedback', to='core.reviewrequest')),
            ],
            options={
                'ordering': ['-created_at'],
            },
        ),
    ]
