# Generated by Django 5.2.16 on 2026-07-31 18:34

import django.db.models.deletion
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='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=100, verbose_name='Título')),
                ('slug', models.SlugField(unique=True, verbose_name='Slug (URL)')),
                ('description', models.TextField(blank=True, verbose_name='Descripción')),
                ('icon', models.CharField(default='rmx.book-open', max_length=50, verbose_name='Ícono')),
            ],
            options={
                'verbose_name': 'Categoría',
                'verbose_name_plural': 'Categorías',
                'ordering': ['title'],
            },
        ),
        migrations.CreateModel(
            name='Course',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='Título del Curso')),
                ('slug', models.SlugField(unique=True, verbose_name='Slug (URL)')),
                ('short_description', models.CharField(max_length=300, verbose_name='Resumen Ejecutivo')),
                ('description', models.TextField(verbose_name='Temario y Objetivos')),
                ('thumbnail', models.ImageField(blank=True, null=True, upload_to='courses/thumbnails/', verbose_name='Imagen Portada')),
                ('iso_standard', models.CharField(default='ISO/IEC 17025', max_length=50, verbose_name='Normativa Asociada')),
                ('is_published', models.BooleanField(default=True, verbose_name='Publicado')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Creado el')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Actualizado el')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='courses', to='courses.category', verbose_name='Categoría')),
                ('instructor', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='teaching_courses', to=settings.AUTH_USER_MODEL, verbose_name='Docente / Instructor')),
            ],
            options={
                'verbose_name': 'Curso',
                'verbose_name_plural': 'Cursos',
                'ordering': ['-created_at'],
            },
        ),
        migrations.CreateModel(
            name='Evaluation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='Título del Examen')),
                ('questions', models.JSONField(verbose_name='Preguntas (Estructura JSON)')),
                ('passing_score', models.PositiveIntegerField(default=80, verbose_name='Puntaje Mínimo (%)')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='evaluations', to='courses.course', verbose_name='Curso')),
            ],
            options={
                'verbose_name': 'Evaluación',
                'verbose_name_plural': 'Evaluaciones',
            },
        ),
        migrations.CreateModel(
            name='Module',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='Título del Módulo')),
                ('order', models.PositiveIntegerField(default=1, verbose_name='Orden')),
                ('course', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='modules', to='courses.course', verbose_name='Curso')),
            ],
            options={
                'verbose_name': 'Módulo',
                'verbose_name_plural': 'Módulos',
                'ordering': ['order', 'id'],
            },
        ),
        migrations.CreateModel(
            name='Lesson',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200, verbose_name='Título de la Lección')),
                ('slug', models.SlugField(verbose_name='Slug (URL)')),
                ('video_url', models.URLField(blank=True, verbose_name='URL de Video (MP4/YouTube/Vimeo)')),
                ('content', models.TextField(blank=True, verbose_name='Contenido / Material de Apoyo (Markdown/HTML)')),
                ('order', models.PositiveIntegerField(default=1, verbose_name='Orden en el Módulo')),
                ('module', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='lessons', to='courses.module', verbose_name='Módulo')),
            ],
            options={
                'verbose_name': 'Lección',
                'verbose_name_plural': 'Lecciones',
                'ordering': ['order', 'id'],
                'unique_together': {('module', 'slug')},
            },
        ),
    ]
