# Generated by Django 6.0 on 2025-12-20 11:12

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


class Migration(migrations.Migration):

    dependencies = [
        ('endoreg_db', '0007_remove_videofile_uuid'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AIDataSet',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(blank=True, help_text='Human-readable identifier, e.g. "Legacy multilabel dataset v1".', max_length=255, null=True)),
                ('description', models.TextField(blank=True, help_text='Optional notes / explanation about this dataset.', null=True)),
                ('ai_model_type', models.CharField(default='image_multilabel_classification', help_text='AI model family this dataset is for, e.g. "image_multilabel_classification". Used to pick the correct architecture and output dimension logic.', max_length=255)),
                ('dataset_type', models.CharField(choices=[('image', 'Image')], default='image', help_text='Controls which annotation table will be used. Currently only "image" is implemented; later "video", "text", etc.', max_length=32)),
                ('created_at', models.DateTimeField(auto_now_add=True, help_text='When this AIDataSet was created.')),
                ('updated_at', models.DateTimeField(auto_now=True, help_text='When this AIDataSet was last modified.')),
                ('is_active', models.BooleanField(default=True, help_text='Soft toggle to enable/disable this dataset for training.')),
                ('image_annotations', models.ManyToManyField(blank=True, help_text="For dataset_type='image', this is the set of ImageClassificationAnnotation rows that define this AIDataSet. Each annotation has frame_id and label_id.", related_name='image_ai_datasets', to='endoreg_db.imageclassificationannotation')),
            ],
        ),
        migrations.CreateModel(
            name='OperationLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('actor_username', models.CharField(blank=True, max_length=150)),
                ('actor_email', models.EmailField(blank=True, max_length=254)),
                ('actor_keycloak_id', models.CharField(blank=True, help_text='Keycloak subject/ID if you later want to store it.', max_length=255)),
                ('action', models.CharField(help_text="e.g. 'anonymization.start', 'anonymization.validate'", max_length=100)),
                ('http_method', models.CharField(blank=True, max_length=10)),
                ('path', models.CharField(blank=True, max_length=512)),
                ('resource_type', models.CharField(blank=True, help_text="e.g. 'video', 'pdf'", max_length=50)),
                ('resource_id', models.IntegerField(blank=True, help_text='ID of VideoFile / RawPdfFile etc.', null=True)),
                ('status_before', models.CharField(blank=True, max_length=50)),
                ('status_after', models.CharField(blank=True, max_length=50)),
                ('meta', models.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('actor_user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operation_logs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Operation Log',
                'verbose_name_plural': 'Operation Logs',
                'ordering': ['-created_at'],
            },
        ),
    ]
