# Generated by Django 5.2.1 on 2026-01-14 10:47

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('cms', '0010_add_gbp_models'),
    ]

    operations = [
        migrations.CreateModel(
            name='LocalCitation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('directory_name', models.CharField(help_text='Name of the directory', max_length=255)),
                ('directory_type', models.CharField(choices=[('google_business', 'Google Business'), ('bing_places', 'Bing Places'), ('apple_maps', 'Apple Maps'), ('trustpilot', 'Trustpilot'), ('yelp', 'Yelp'), ('facilities_management_dir', 'Facilities Management Directory'), ('business_directory', 'Business Directory'), ('industry_association', 'Industry Association'), ('chamber_of_commerce', 'Chamber of Commerce'), ('local_directory', 'Local Directory'), ('other', 'Other')], help_text='Type of directory', max_length=50)),
                ('directory_url', models.URLField(help_text='URL of the directory')),
                ('business_name', models.CharField(help_text='Business name as listed in directory', max_length=255)),
                ('address', models.CharField(help_text='Address as listed in directory', max_length=255)),
                ('phone', models.CharField(help_text='Phone number as listed in directory', max_length=20)),
                ('website', models.URLField(blank=True, help_text='Website URL as listed in directory')),
                ('email', models.EmailField(blank=True, help_text='Email as listed in directory', max_length=254)),
                ('status', models.CharField(choices=[('not_listed', 'Not Listed'), ('pending', 'Pending'), ('active', 'Active'), ('needs_update', 'Needs Update'), ('suspended', 'Suspended'), ('removed', 'Removed')], default='not_listed', help_text='Current status of the citation', max_length=50)),
                ('citation_url', models.URLField(blank=True, help_text='Direct URL to the business listing')),
                ('listing_id', models.CharField(blank=True, help_text='Directory-specific listing ID', max_length=255)),
                ('nap_consistent', models.BooleanField(default=False, help_text='Is NAP (Name, Address, Phone) consistent with primary listing?')),
                ('nap_issues', models.JSONField(blank=True, default=list, help_text='List of NAP inconsistencies found')),
                ('is_verified', models.BooleanField(default=False, help_text='Has the citation been verified?')),
                ('verification_date', models.DateTimeField(blank=True, help_text='Date the citation was verified', null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('last_checked', models.DateTimeField(blank=True, help_text='Last time citation was checked for consistency', null=True)),
            ],
            options={
                'verbose_name': 'Local Citation',
                'verbose_name_plural': 'Local Citations',
                'ordering': ['directory_type', 'directory_name'],
                'unique_together': {('directory_name', 'listing_id')},
            },
        ),
        migrations.CreateModel(
            name='NAPConsistencyReport',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('report_name', models.CharField(help_text='Name of the NAP consistency report', max_length=255)),
                ('description', models.TextField(blank=True, help_text='Description of the report')),
                ('primary_business_name', models.CharField(help_text='Primary business name to check against', max_length=255)),
                ('primary_address', models.CharField(help_text='Primary address to check against', max_length=255)),
                ('primary_phone', models.CharField(help_text='Primary phone number to check against', max_length=20)),
                ('status', models.CharField(choices=[('pending', 'Pending'), ('in_progress', 'In Progress'), ('completed', 'Completed'), ('archived', 'Archived')], default='pending', help_text='Current status of the report', max_length=50)),
                ('total_citations', models.IntegerField(default=0, help_text='Total number of citations checked')),
                ('consistent_citations', models.IntegerField(default=0, help_text='Number of citations with consistent NAP')),
                ('inconsistent_citations', models.IntegerField(default=0, help_text='Number of citations with inconsistent NAP')),
                ('consistency_percentage', models.FloatField(default=0.0, help_text='Percentage of consistent citations')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('completed_at', models.DateTimeField(blank=True, help_text='When the report was completed', null=True)),
                ('citations_checked', models.ManyToManyField(blank=True, help_text='Citations included in this report', to='cms.localcitation')),
            ],
            options={
                'verbose_name': 'NAP Consistency Report',
                'verbose_name_plural': 'NAP Consistency Reports',
                'ordering': ['-created_at'],
            },
        ),
    ]
