# Generated by Django 5.2.15 on 2026-06-15 08:28

import django.db.models.deletion
import simple_history.models
import uuid
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PortalConfiguration',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('public_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Criado em')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Atualizado em')),
                ('company_name', models.CharField(default='Gestão de Serviços Web', max_length=180, verbose_name='Nome da empresa')),
                ('company_email', models.EmailField(blank=True, max_length=254, verbose_name='Email')),
                ('company_phone', models.CharField(blank=True, max_length=40, verbose_name='Telefone')),
                ('company_nif', models.CharField(blank=True, max_length=20, verbose_name='NIF')),
                ('mbway_phone', models.CharField(blank=True, max_length=40, verbose_name='Número MB WAY')),
                ('iban', models.CharField(blank=True, max_length=40, verbose_name='IBAN')),
                ('default_notice_days', models.PositiveSmallIntegerField(default=30, verbose_name='Primeiro aviso (dias)')),
                ('second_notice_days', models.PositiveSmallIntegerField(default=15, verbose_name='Segundo aviso (dias)')),
                ('final_notice_days', models.PositiveSmallIntegerField(default=7, verbose_name='Aviso final (dias)')),
                ('internal_notification_email', models.EmailField(blank=True, max_length=254, verbose_name='Email para alertas internos')),
                ('notes', models.TextField(blank=True, verbose_name='Notas')),
            ],
            options={
                'verbose_name': 'Configuração do portal',
                'verbose_name_plural': 'Configuração do portal',
            },
        ),
        migrations.CreateModel(
            name='Provider',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('public_id', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Criado em')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Atualizado em')),
                ('name', models.CharField(max_length=150, unique=True, verbose_name='Nome')),
                ('provider_type', models.CharField(choices=[('registrar', 'Registador de domínios'), ('hosting', 'Fornecedor de alojamento'), ('server', 'Servidor / cloud'), ('payment', 'Pagamentos'), ('other', 'Outro')], default='other', max_length=20, verbose_name='Tipo')),
                ('website', models.URLField(blank=True, verbose_name='Website')),
                ('support_email', models.EmailField(blank=True, max_length=254, verbose_name='Email de suporte')),
                ('support_phone', models.CharField(blank=True, max_length=40, verbose_name='Telefone')),
                ('account_reference', models.CharField(blank=True, help_text='Identificador ou referência; nunca guardar a password.', max_length=150, verbose_name='Referência da conta')),
                ('notes', models.TextField(blank=True, verbose_name='Notas')),
                ('is_active', models.BooleanField(default=True, verbose_name='Ativo')),
            ],
            options={
                'verbose_name': 'Fornecedor',
                'verbose_name_plural': 'Fornecedores',
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='HistoricalPortalConfiguration',
            fields=[
                ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('public_id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ('created_at', models.DateTimeField(blank=True, editable=False, verbose_name='Criado em')),
                ('updated_at', models.DateTimeField(blank=True, editable=False, verbose_name='Atualizado em')),
                ('company_name', models.CharField(default='Gestão de Serviços Web', max_length=180, verbose_name='Nome da empresa')),
                ('company_email', models.EmailField(blank=True, max_length=254, verbose_name='Email')),
                ('company_phone', models.CharField(blank=True, max_length=40, verbose_name='Telefone')),
                ('company_nif', models.CharField(blank=True, max_length=20, verbose_name='NIF')),
                ('mbway_phone', models.CharField(blank=True, max_length=40, verbose_name='Número MB WAY')),
                ('iban', models.CharField(blank=True, max_length=40, verbose_name='IBAN')),
                ('default_notice_days', models.PositiveSmallIntegerField(default=30, verbose_name='Primeiro aviso (dias)')),
                ('second_notice_days', models.PositiveSmallIntegerField(default=15, verbose_name='Segundo aviso (dias)')),
                ('final_notice_days', models.PositiveSmallIntegerField(default=7, verbose_name='Aviso final (dias)')),
                ('internal_notification_email', models.EmailField(blank=True, max_length=254, verbose_name='Email para alertas internos')),
                ('notes', models.TextField(blank=True, verbose_name='Notas')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField(db_index=True)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical Configuração do portal',
                'verbose_name_plural': 'historical Configuração do portal',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': ('history_date', 'history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
        migrations.CreateModel(
            name='HistoricalProvider',
            fields=[
                ('id', models.BigIntegerField(auto_created=True, blank=True, db_index=True, verbose_name='ID')),
                ('public_id', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False)),
                ('created_at', models.DateTimeField(blank=True, editable=False, verbose_name='Criado em')),
                ('updated_at', models.DateTimeField(blank=True, editable=False, verbose_name='Atualizado em')),
                ('name', models.CharField(db_index=True, max_length=150, verbose_name='Nome')),
                ('provider_type', models.CharField(choices=[('registrar', 'Registador de domínios'), ('hosting', 'Fornecedor de alojamento'), ('server', 'Servidor / cloud'), ('payment', 'Pagamentos'), ('other', 'Outro')], default='other', max_length=20, verbose_name='Tipo')),
                ('website', models.URLField(blank=True, verbose_name='Website')),
                ('support_email', models.EmailField(blank=True, max_length=254, verbose_name='Email de suporte')),
                ('support_phone', models.CharField(blank=True, max_length=40, verbose_name='Telefone')),
                ('account_reference', models.CharField(blank=True, help_text='Identificador ou referência; nunca guardar a password.', max_length=150, verbose_name='Referência da conta')),
                ('notes', models.TextField(blank=True, verbose_name='Notas')),
                ('is_active', models.BooleanField(default=True, verbose_name='Ativo')),
                ('history_id', models.AutoField(primary_key=True, serialize=False)),
                ('history_date', models.DateTimeField(db_index=True)),
                ('history_change_reason', models.CharField(max_length=100, null=True)),
                ('history_type', models.CharField(choices=[('+', 'Created'), ('~', 'Changed'), ('-', 'Deleted')], max_length=1)),
                ('history_user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'historical Fornecedor',
                'verbose_name_plural': 'historical Fornecedores',
                'ordering': ('-history_date', '-history_id'),
                'get_latest_by': ('history_date', 'history_id'),
            },
            bases=(simple_history.models.HistoricalChanges, models.Model),
        ),
    ]
