# Generated by Django 5.2.13 on 2026-04-16 17:16

import django.core.validators
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 = [
        ('appointments', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='PromedioGlobal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('promedio', models.DecimalField(decimal_places=2, default=0, max_digits=3)),
                ('total', models.IntegerField(default=0)),
                ('estrellas_5', models.IntegerField(default=0)),
                ('estrellas_4', models.IntegerField(default=0)),
                ('estrellas_3', models.IntegerField(default=0)),
                ('estrellas_2', models.IntegerField(default=0)),
                ('estrellas_1', models.IntegerField(default=0)),
            ],
            options={
                'verbose_name': 'Promedio Global',
                'verbose_name_plural': 'Promedio Global',
            },
        ),
        migrations.CreateModel(
            name='Valoracion',
            fields=[
                ('created_at', models.DateTimeField(auto_now_add=True, db_index=True, verbose_name='fecha de creación')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='fecha de actualización')),
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('is_active', models.BooleanField(db_index=True, default=True, verbose_name='activo')),
                ('deleted_at', models.DateTimeField(blank=True, null=True, verbose_name='fecha de eliminación')),
                ('estrellas', models.PositiveSmallIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])),
                ('comentario', models.CharField(blank=True, default='', max_length=500)),
                ('estado', models.CharField(choices=[('pendiente', 'Pendiente'), ('aprobada', 'Aprobada'), ('rechazada', 'Rechazada')], default='pendiente', max_length=10)),
                ('respuesta_doctora', models.CharField(blank=True, default='', max_length=500)),
                ('fecha_respuesta', models.DateTimeField(blank=True, null=True)),
                ('cita', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='valoracion', to='appointments.cita')),
                ('paciente', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='valoraciones', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'Valoración',
                'verbose_name_plural': 'Valoraciones',
                'ordering': ['-created_at'],
            },
        ),
    ]
