# Generated by Django 5.2 on 2025-04-23 12:46

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('base', '0004_initial'),
        ('healthcareservices', '0001_initial'),
        ('patients', '0001_initial'),
        ('practitioners', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Schedule',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('active', models.BooleanField(default=True)),
                ('name', models.CharField(max_length=255, null=True)),
                ('slots_duration', models.IntegerField(default=30)),
                ('comment', models.TextField(null=True)),
                ('identifier', models.ManyToManyField(blank=True, related_name='schedule_identifier', to='base.identifier')),
                ('planning_horizon', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='base.period')),
                ('service_category', models.ManyToManyField(related_name='schedule_category', to='base.codeableconcept')),
                ('service_type', models.ManyToManyField(related_name='schedule_servicetype', to='healthcareservices.healthcareservicecodeablereference')),
                ('specialty', models.ManyToManyField(related_name='schedule_specialty', to='base.codeableconcept')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='ScheduleReference',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('identifier', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='schedule_reference_identifier', to='base.identifier')),
                ('schedule', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='schedule_reference_schedule', to='schedules.schedule')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SchedulesActorReference',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('reference', models.CharField(max_length=255, null=True)),
                ('type', models.CharField(max_length=255, null=True)),
                ('display', models.CharField(max_length=255, null=True)),
                ('healthcareservice', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='schedules_actor_healthcareservice', to='healthcareservices.healthcareservice')),
                ('identifier', models.ManyToManyField(blank=True, related_name='schedules_actor_identifier', to='base.identifier')),
                ('patient', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='schedules_actor_patient', to='patients.patient')),
                ('practitioner', models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='schedules_actor_practitioner', to='practitioners.practitioner')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='schedule',
            name='actor',
            field=models.ManyToManyField(related_name='schedule_actor', to='schedules.schedulesactorreference'),
        ),
    ]
