# Generated by Django 5.2.7 on 2025-11-14 23:02

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='InferenceAuditLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True, verbose_name='เวลาเรียกใช้')),
                ('endpoint_url', models.CharField(max_length=500, verbose_name='FastAPI Endpoint')),
                ('http_status', models.IntegerField(verbose_name='HTTP Status Code')),
                ('latency_ms', models.FloatField(verbose_name='Latency (ms)')),
                ('is_success', models.BooleanField(default=False, verbose_name='สำเร็จหรือไม่')),
                ('response_summary', models.TextField(blank=True, null=True, verbose_name='ผลลัพธ์สรุป/ข้อความ error')),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL, verbose_name='ผู้ใช้งาน')),
            ],
            options={
                'verbose_name': 'Inference Audit Log',
                'verbose_name_plural': 'Inference Audit Logs',
                'ordering': ['-timestamp'],
            },
        ),
    ]
