# Generated by Django 5.2.15 on 2026-06-15 13:52

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


class Migration(migrations.Migration):

    dependencies = [
        ('support', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='historicalsupportmessage',
            name='attachment',
            field=models.TextField(blank=True, max_length=100, verbose_name='Anexo'),
        ),
        migrations.AddField(
            model_name='historicalsupportmessage',
            name='read_by_client_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lida pelo cliente em'),
        ),
        migrations.AddField(
            model_name='historicalsupportmessage',
            name='read_by_staff_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lida pela equipa em'),
        ),
        migrations.AddField(
            model_name='historicalsupportticket',
            name='client_last_read_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lido pelo cliente em'),
        ),
        migrations.AddField(
            model_name='historicalsupportticket',
            name='resolution_note',
            field=models.TextField(blank=True, verbose_name='Nota de resolução'),
        ),
        migrations.AddField(
            model_name='historicalsupportticket',
            name='resolved_by',
            field=models.ForeignKey(blank=True, db_constraint=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='+', to=settings.AUTH_USER_MODEL, verbose_name='Resolvido por'),
        ),
        migrations.AddField(
            model_name='historicalsupportticket',
            name='resolved_by_client',
            field=models.BooleanField(default=False, verbose_name='Resolvido pelo cliente'),
        ),
        migrations.AddField(
            model_name='historicalsupportticket',
            name='staff_last_read_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lido pela equipa em'),
        ),
        migrations.AddField(
            model_name='supportmessage',
            name='attachment',
            field=models.FileField(blank=True, upload_to='support/%Y/%m/', verbose_name='Anexo'),
        ),
        migrations.AddField(
            model_name='supportmessage',
            name='read_by_client_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lida pelo cliente em'),
        ),
        migrations.AddField(
            model_name='supportmessage',
            name='read_by_staff_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lida pela equipa em'),
        ),
        migrations.AddField(
            model_name='supportticket',
            name='client_last_read_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lido pelo cliente em'),
        ),
        migrations.AddField(
            model_name='supportticket',
            name='resolution_note',
            field=models.TextField(blank=True, verbose_name='Nota de resolução'),
        ),
        migrations.AddField(
            model_name='supportticket',
            name='resolved_by',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='resolved_support_tickets', to=settings.AUTH_USER_MODEL, verbose_name='Resolvido por'),
        ),
        migrations.AddField(
            model_name='supportticket',
            name='resolved_by_client',
            field=models.BooleanField(default=False, verbose_name='Resolvido pelo cliente'),
        ),
        migrations.AddField(
            model_name='supportticket',
            name='staff_last_read_at',
            field=models.DateTimeField(blank=True, null=True, verbose_name='Lido pela equipa em'),
        ),
        migrations.AlterField(
            model_name='historicalsupportmessage',
            name='is_internal',
            field=models.BooleanField(default=False, help_text='As notas internas nunca são apresentadas ao cliente.', verbose_name='Nota interna'),
        ),
        migrations.AlterField(
            model_name='historicalsupportticket',
            name='client_visible',
            field=models.BooleanField(default=True, help_text='Quando ativo, o ticket e as mensagens públicas ficam disponíveis na área do cliente.', verbose_name='Visível no portal do cliente'),
        ),
        migrations.AlterField(
            model_name='historicalsupportticket',
            name='status',
            field=models.CharField(choices=[('open', 'Aberto'), ('in_progress', 'Em tratamento'), ('reopened', 'Reaberto'), ('waiting_client', 'A aguardar cliente'), ('waiting_internal', 'A aguardar internamente'), ('resolved', 'Resolvido'), ('closed', 'Fechado')], db_index=True, default='open', max_length=25, verbose_name='Estado'),
        ),
        migrations.AlterField(
            model_name='supportmessage',
            name='is_internal',
            field=models.BooleanField(default=False, help_text='As notas internas nunca são apresentadas ao cliente.', verbose_name='Nota interna'),
        ),
        migrations.AlterField(
            model_name='supportticket',
            name='client_visible',
            field=models.BooleanField(default=True, help_text='Quando ativo, o ticket e as mensagens públicas ficam disponíveis na área do cliente.', verbose_name='Visível no portal do cliente'),
        ),
        migrations.AlterField(
            model_name='supportticket',
            name='status',
            field=models.CharField(choices=[('open', 'Aberto'), ('in_progress', 'Em tratamento'), ('reopened', 'Reaberto'), ('waiting_client', 'A aguardar cliente'), ('waiting_internal', 'A aguardar internamente'), ('resolved', 'Resolvido'), ('closed', 'Fechado')], db_index=True, default='open', max_length=25, verbose_name='Estado'),
        ),
    ]
