# Generated by Django 5.2.4 on 2025-07-31 04:22 import django.db.models.deletion import uuid from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name="AgentCategory", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("name", models.CharField(max_length=100)), ("slug", models.SlugField(unique=True)), ("description", models.TextField(blank=True)), ( "icon", models.CharField( blank=True, help_text="Icon class or emoji", max_length=50 ), ), ("is_active", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ], options={ "ordering": ["name"], }, ), migrations.CreateModel( name="Agent", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("name", models.CharField(max_length=200)), ("slug", models.SlugField(unique=True)), ("short_description", models.CharField(max_length=300)), ("description", models.TextField()), ("price", models.DecimalField(decimal_places=2, max_digits=10)), ( "form_schema", models.JSONField(help_text="JSON schema for agent input form"), ), ( "webhook_url", models.URLField(help_text="n8n webhook URL for execution"), ), ("is_active", models.BooleanField(default=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("updated_at", models.DateTimeField(auto_now=True)), ( "category", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="agents", to="agents.agentcategory", ), ), ], options={ "ordering": ["name"], }, ), migrations.CreateModel( name="AgentExecution", fields=[ ( "id", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("input_data", models.JSONField()), ("output_data", models.JSONField(blank=True, null=True)), ( "status", models.CharField( choices=[ ("pending", "Pending"), ("running", "Running"), ("completed", "Completed"), ("failed", "Failed"), ], default="pending", max_length=20, ), ), ("fee_charged", models.DecimalField(decimal_places=2, max_digits=10)), ("webhook_response", models.JSONField(blank=True, null=True)), ("error_message", models.TextField(blank=True)), ("execution_time", models.DurationField(blank=True, null=True)), ("created_at", models.DateTimeField(auto_now_add=True)), ("completed_at", models.DateTimeField(blank=True, null=True)), ( "agent", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, related_name="executions", to="agents.agent", ), ), ( "user", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], options={ "ordering": ["-created_at"], }, ), ]