# Generated by Django 3.2.9 on 2021-11-26 05:55

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import mycarehub.common.models.base_models
import mycarehub.users.models
import uuid


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('common', '0013_alter_facilityattachment_content_type'),
        ('clients', '0015_healthdiaryattachment_healthdiaryentry_healthdiaryquote'),
    ]

    operations = [
        migrations.CreateModel(
            name='ServiceRequest',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('active', models.BooleanField(default=True)),
                ('created', models.DateTimeField(default=django.utils.timezone.now)),
                ('created_by', models.UUIDField(blank=True, null=True)),
                ('updated', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_by', models.UUIDField(blank=True, null=True)),
                ('deleted_at', models.DateTimeField(blank=True, null=True)),
                ('request_type', models.CharField(choices=[('HEALTH_DIARY_ENTRY', 'HEALTH DIARY ENTRY'), ('RED_FLAG', 'RED FLAG')], max_length=36)),
                ('request', models.TextField()),
                ('status', models.CharField(choices=[('PENDING', 'PENDING'), ('IN PROGRESS', 'IN PROGRESS'), ('RESOLVED', 'RESOLVED')], default='PENDING', max_length=36)),
                ('in_progress_at', models.DateTimeField(blank=True, null=True)),
                ('resolved_at', models.DateTimeField(blank=True, null=True)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='clients.client')),
                ('in_progress_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='service_request_in_progress_by_users', to=settings.AUTH_USER_MODEL)),
                ('organisation', models.ForeignKey(default=mycarehub.users.models.default_organisation, on_delete=django.db.models.deletion.PROTECT, related_name='clients_servicerequest_related', to='common.organisation')),
                ('resolved_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='service_request_resolved_by_users', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-updated', '-created'),
                'abstract': False,
            },
            managers=[
                ('objects', mycarehub.common.models.base_models.AbstractBaseManager()),
            ],
        ),
    ]
