# Generated by Django 4.1.5 on 2023-01-12 03:25

import django.contrib.postgres.fields
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("workforce", "0001_schema"),
    ]

    operations = [
        migrations.CreateModel(
            name="ConstanceSetting",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("slug", models.CharField(max_length=100)),
                ("setting_name", models.TextField()),
                ("setting_value", models.TextField()),
                ("last_reported", models.DateTimeField()),
            ],
            options={
                "db_table": 'workforce"."constance_summary',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="ExtensionSummary",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("name", models.CharField(max_length=100, unique=True)),
                ("is_enabled", models.BooleanField(db_index=True)),
            ],
            options={
                "db_table": 'workforce"."extension_summary',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="FeatureFlagSummary",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("name", models.CharField(max_length=100, unique=True)),
                ("is_enabled", models.BooleanField(db_index=True)),
            ],
            options={
                "db_table": 'workforce"."featureflag_summary',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="OnboardingActionRow",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("last_synced", models.DateTimeField(db_index=True)),
                ("is_active", models.BooleanField(db_index=True)),
                ("name", models.CharField(max_length=150)),
                ("description", models.TextField(blank=True, default="")),
                ("due_date", models.DateField(blank=True, null=True)),
                ("completed_date", models.DateField(blank=True, null=True)),
                ("responsibility", models.CharField(max_length=100)),
                (
                    "assigned_to",
                    models.CharField(blank=True, default="", max_length=100),
                ),
                ("progress", models.IntegerField(blank=True, null=True)),
                ("effort", models.IntegerField(blank=True, null=True)),
                ("group", models.CharField(max_length=100)),
            ],
            options={
                "db_table": 'workforce"."customer_onboarding_actions',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="TemplateChangeRequestSummary",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("tcr_pk", models.PositiveIntegerField()),
                ("created", models.DateTimeField()),
                ("currency", models.CharField(blank=True, max_length=3, null=True)),
                (
                    "requested_changes",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=models.CharField(max_length=100),
                        blank=True,
                        default=list,
                        size=None,
                        verbose_name="Requested modifications",
                    ),
                ),
                ("status", models.CharField(db_index=True, max_length=20)),
                ("status_changed_requested", models.DateTimeField()),
                ("status_changed_approved", models.DateTimeField()),
                ("status_changed_completed", models.DateTimeField()),
                ("template_key", models.CharField(max_length=200)),
                ("template_name", models.CharField(max_length=200)),
                ("template_content_type_model", models.CharField(max_length=200)),
                ("estimated_price", models.PositiveIntegerField()),
                (
                    "estimated_hours",
                    models.DecimalField(decimal_places=4, max_digits=11),
                ),
            ],
            options={
                "db_table": 'workforce"."templates_template_change_request_summary',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="UsageMetrics",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("count_name", models.CharField(db_index=True, max_length=200)),
                ("stat_count", models.BigIntegerField()),
                ("as_of", models.DateTimeField(db_index=True)),
            ],
            options={
                "db_table": 'workforce"."usage_metrics',
            },
        ),
        migrations.CreateModel(
            name="UserSummaryRow",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("last_synced", models.DateTimeField(db_index=True)),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("user_pk", models.PositiveIntegerField(db_index=True)),
                ("email", models.CharField(db_index=True, max_length=255)),
                ("name", models.CharField(max_length=255)),
                ("license", models.CharField(db_index=True, max_length=10)),
                ("is_active", models.BooleanField(db_index=True)),
                ("is_superuser", models.BooleanField(db_index=True)),
                ("created", models.DateTimeField(db_index=True)),
                (
                    "last_access",
                    models.DateTimeField(blank=True, db_index=True, null=True),
                ),
                (
                    "groups",
                    django.contrib.postgres.fields.ArrayField(
                        base_field=models.CharField(max_length=150),
                        blank=True,
                        default=list,
                        size=None,
                    ),
                ),
            ],
            options={
                "db_table": 'workforce"."customer_all_users',
                "default_permissions": (),
            },
        ),
        migrations.CreateModel(
            name="WorkforceAddressSummary",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("tenant", models.CharField(db_index=True, max_length=200)),
                ("last_synced", models.DateTimeField()),
                ("prop_status", models.CharField(blank=True, max_length=30)),
                ("prop_id", models.IntegerField()),
                ("prop_created", models.DateTimeField()),
                (
                    "address",
                    models.CharField(
                        blank=True,
                        help_text="Exact and validated registered postal address.",
                        max_length=1000,
                    ),
                ),
                (
                    "display",
                    models.TextField(
                        help_text="Address that will be used for display purposes.",
                        max_length=1000,
                    ),
                ),
                (
                    "country",
                    models.CharField(
                        blank=True,
                        choices=[("AU", "Australia"), ("NZ", "New Zealand")],
                        default="AU",
                        max_length=2,
                    ),
                ),
                ("gnaf_id", models.CharField(blank=True, default="", max_length=30)),
                (
                    "state",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=50,
                        verbose_name="State or Region",
                    ),
                ),
                (
                    "postal_code",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=15,
                        verbose_name="Postal or Zip code",
                    ),
                ),
                ("coords", models.CharField(blank=True, max_length=40)),
            ],
            options={
                "db_table": 'workforce"."address_summary',
                "default_permissions": (),
            },
        ),
        migrations.AddIndex(
            model_name="usagemetrics",
            index=models.Index(
                fields=["tenant", "count_name", "-as_of"],
                name="usage_metrics_latest_btree",
            ),
        ),
    ]
