# Generated by Django 4.2.28 on 2026-02-24 10:35

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AuditLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.CharField(choices=[('create', 'Create'), ('update', 'Update'), ('delete', 'Delete'), ('approve', 'Approve'), ('export', 'Export'), ('print', 'Print'), ('void', 'Void'), ('reverse', 'Reverse'), ('login', 'Login'), ('logout', 'Logout')], max_length=20)),
                ('app_label', models.CharField(max_length=64)),
                ('model_name', models.CharField(max_length=128)),
                ('object_id', models.CharField(blank=True, max_length=64)),
                ('object_repr', models.CharField(blank=True, max_length=255)),
                ('old_values', models.JSONField(blank=True, default=dict)),
                ('new_values', models.JSONField(blank=True, default=dict)),
                ('changes', models.JSONField(blank=True, default=dict)),
                ('metadata', models.JSONField(blank=True, default=dict)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('actor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='audit_logs', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-created_at', '-id'),
                'indexes': [models.Index(fields=['app_label', 'model_name'], name='core_auditl_app_lab_2f0dea_idx'), models.Index(fields=['action', 'created_at'], name='core_auditl_action_29a2bf_idx'), models.Index(fields=['object_id'], name='core_auditl_object__f4af4b_idx')],
            },
        ),
    ]
