# Generated by Django 5.2.16 on 2026-08-26 17:04

from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('certificates', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='DigitalSignature',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='Certificado Institucional Lo Justo', max_length=150, verbose_name='Nombre Identificador')),
                ('pfx_file', models.FileField(upload_to='certificates/signatures/', verbose_name='Archivo Certificado Digital (.p12 / .pfx)')),
                ('p12_password', models.CharField(blank=True, max_length=255, verbose_name='Contraseña del Certificado')),
                ('signer_name', models.CharField(default='Director Técnico & Calidad', max_length=200, verbose_name='Nombre del Firmante')),
                ('signer_role', models.CharField(default='Supervisor de Laboratorio y Certificación', max_length=200, verbose_name='Cargo del Firmante')),
                ('is_active', models.BooleanField(default=True, verbose_name='¿Firma Activa por Defecto?')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Cargado el')),
            ],
            options={
                'verbose_name': 'Firma Digital (.p12/.pfx)',
                'verbose_name_plural': 'Firmas Digitales',
                'ordering': ['-created_at'],
            },
        ),
        migrations.AddField(
            model_name='certificate',
            name='is_digitally_signed',
            field=models.BooleanField(default=False, verbose_name='¿Firmado Criptográficamente (PAdES)?'),
        ),
        migrations.AddField(
            model_name='certificate',
            name='pdf_file',
            field=models.FileField(blank=True, null=True, upload_to='certificates/issued_pdfs/', verbose_name='Archivo PDF Oficial Firmado'),
        ),
        migrations.AddField(
            model_name='certificate',
            name='sha256_hash',
            field=models.CharField(blank=True, max_length=64, verbose_name='Hash Criptográfico SHA-256'),
        ),
        migrations.AddField(
            model_name='certificate',
            name='signer_name',
            field=models.CharField(blank=True, max_length=200, verbose_name='Firmante Autorizado'),
        ),
    ]
