# Generated by Django 4.2.7 on 2025-07-31 11:55

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


class Migration(migrations.Migration):

    dependencies = [
        ("shaoApp", "0007_developmentapplication_first_floor_area_and_more"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="developmentapplication",
            name="first_floor_area",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="ground_floor_area",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="lot_size",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="pos_area",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="site_coverage",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="spos_area",
        ),
        migrations.RemoveField(
            model_name="developmentapplication",
            name="total_area",
        ),
        migrations.CreateModel(
            name="PDFDocument",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("file_path", models.CharField(blank=True, max_length=500, null=True)),
                ("file_name", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "document_type",
                    models.CharField(blank=True, max_length=100, null=True),
                ),
                ("pdf_type", models.CharField(blank=True, max_length=50, null=True)),
                ("confidence", models.CharField(blank=True, max_length=20, null=True)),
                ("text_length", models.IntegerField(blank=True, null=True)),
                ("pages_processed", models.IntegerField(blank=True, null=True)),
                (
                    "extraction_status",
                    models.CharField(default="pending", max_length=50),
                ),
                ("error_message", models.TextField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "application",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="pdf_documents",
                        to="shaoApp.developmentapplication",
                    ),
                ),
            ],
            options={
                "db_table": "pdf_document",
            },
        ),
        migrations.CreateModel(
            name="ExtractedPDFData",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("land_description", models.TextField(blank=True, null=True)),
                ("registered_proprietor", models.TextField(blank=True, null=True)),
                ("encumbrances", models.TextField(blank=True, null=True)),
                ("activity_last_125_days", models.TextField(blank=True, null=True)),
                ("administrative_notices", models.TextField(blank=True, null=True)),
                (
                    "proposed_use",
                    models.CharField(blank=True, max_length=200, null=True),
                ),
                ("description", models.TextField(blank=True, null=True)),
                (
                    "applicant_name",
                    models.CharField(blank=True, max_length=200, null=True),
                ),
                (
                    "contact_name",
                    models.CharField(blank=True, max_length=200, null=True),
                ),
                ("contact_address", models.TextField(blank=True, null=True)),
                (
                    "contact_email",
                    models.EmailField(blank=True, max_length=254, null=True),
                ),
                (
                    "contact_phone",
                    models.CharField(blank=True, max_length=50, null=True),
                ),
                ("applicant_address", models.TextField(blank=True, null=True)),
                (
                    "applicant_email",
                    models.EmailField(blank=True, max_length=254, null=True),
                ),
                (
                    "applicant_phone",
                    models.CharField(blank=True, max_length=50, null=True),
                ),
                ("lot_size", models.CharField(blank=True, max_length=100, null=True)),
                (
                    "site_coverage",
                    models.CharField(blank=True, max_length=100, null=True),
                ),
                ("total_area", models.CharField(blank=True, max_length=100, null=True)),
                (
                    "ground_floor_area",
                    models.CharField(blank=True, max_length=100, null=True),
                ),
                (
                    "first_floor_area",
                    models.CharField(blank=True, max_length=100, null=True),
                ),
                ("pos", models.CharField(blank=True, max_length=100, null=True)),
                ("spos", models.CharField(blank=True, max_length=100, null=True)),
                ("raw_extracted_data", models.JSONField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "pdf_document",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="extracted_data",
                        to="shaoApp.pdfdocument",
                    ),
                ),
            ],
            options={
                "db_table": "extracted_pdf_data",
            },
        ),
    ]
