# Generated by Django 5.2.11 on 2026-04-20 00:25

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


class Migration(migrations.Migration):

    dependencies = [
        ('companies', '0005_add_enable_audit_log'),
        ('core', '0016_delete_old_models'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AIChatLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('prompt', models.TextField()),
                ('response', models.TextField()),
                ('tokens_used', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ai_chat_logs', to='companies.company')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'AI Chat Log',
                'verbose_name_plural': 'AI Chat Logs',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='AIPrompt',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.CharField(max_length=255)),
                ('is_global', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('company', models.ForeignKey(blank=True, help_text='If blank, this is a global prompt for everyone.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='ai_prompts', to='companies.company')),
            ],
            options={
                'verbose_name': 'AI Prompt',
                'verbose_name_plural': 'AI Prompts',
                'ordering': ['-is_global', '-created_at'],
            },
        ),
    ]
