# Generated by Django 6.0.4 on 2026-06-09 07:34

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


class Migration(migrations.Migration):

    dependencies = [
        ('administrations', '0003_letternumber_document_request'),
    ]

    operations = [
        migrations.CreateModel(
            name='LetterPrefix',
            fields=[
                ('id', models.UUIDField(default=apps.administrations.models.uuid7, editable=False, primary_key=True, serialize=False)),
                ('code', models.CharField(help_text='Short code shown in the number, e.g. EKON.', max_length=20, unique=True)),
                ('label', models.CharField(help_text='Full name, e.g. Departemen Ekonomi.', max_length=120)),
                ('description', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name_plural': 'letter prefixes',
                'db_table': 'letter_prefixes',
                'ordering': ['code'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='letternumber',
            unique_together=set(),
        ),
        migrations.AlterField(
            model_name='letternumber',
            name='prefix',
            field=models.ForeignKey(help_text='Department/unit code this letter belongs to.', on_delete=django.db.models.deletion.PROTECT, related_name='letters', to='administrations.letterprefix'),
        ),
        migrations.AlterUniqueTogether(
            name='letternumber',
            unique_together={('prefix', 'year', 'sequence')},
        ),
    ]
