# Generated by Django 5.1.2 on 2025-05-14 07:22

import custom_base_django.models.choices
import custom_base_django.utils
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='BaseStructure',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='is_active')),
                ('is_deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('struct_name', models.CharField(max_length=255, verbose_name='struct_name')),
                ('extra_non_required_fields', models.JSONField(blank=True, default=list, null=True, verbose_name='extra_non_required_fields')),
                ('nested', models.JSONField(blank=True, default=dict, null=True, verbose_name='nested')),
                ('nested_fields', models.JSONField(blank=True, default=dict, null=True, verbose_name='nested_fields')),
                ('extra_writable_fields', models.JSONField(blank=True, default=list, null=True, verbose_name='extra_writable_fields')),
                ('readonly_fields', models.JSONField(blank=True, default=list, null=True, verbose_name='readonly_fields')),
                ('exclude_fields', models.JSONField(blank=True, default=list, null=True, verbose_name='exclude_fields')),
                ('extra_fields', models.JSONField(blank=True, default=list, null=True, verbose_name='extra_fields')),
                ('extra_validations', models.JSONField(blank=True, default=list, null=True, verbose_name='extra_validations')),
                ('blank_objects', models.JSONField(blank=True, default=dict, null=True, verbose_name='blank_objects')),
                ('pk_field', models.IntegerField(blank=True, null=True, verbose_name='pk')),
                ('model', models.CharField(blank=True, max_length=255, null=True, verbose_name='model')),
                ('must_save', models.BooleanField(default=True, verbose_name='must_save')),
                ('is_authenticated', models.BooleanField(default=False, verbose_name='is_authenticated')),
                ('custom_query', models.JSONField(blank=True, default=dict, null=True, verbose_name='custom_query')),
                ('fields', models.JSONField(blank=True, default=list, null=True, verbose_name='fields')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Choice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='is_active')),
                ('title', models.CharField(max_length=255, verbose_name='Choice Title')),
                ('title_en', models.CharField(max_length=255, verbose_name='Choice Name (English)')),
                ('title_fa', models.CharField(max_length=255, verbose_name='Choice Name (Farsi)')),
                ('title_bz', models.CharField(max_length=255, verbose_name='Choice Name (Native)')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Choices',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='is_active')),
                ('is_deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('choice_title', models.CharField(max_length=150, verbose_name='choice_title')),
                ('choice_value', models.CharField(max_length=150, verbose_name='choice_value')),
            ],
            options={
                'verbose_name': 'Choices',
                'verbose_name_plural': 'Choices',
            },
        ),
        migrations.CreateModel(
            name='PeriodicTasks',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='is_active')),
                ('is_deleted', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('functions', models.JSONField(default=['func1'], verbose_name='Functions')),
                ('description', models.TextField(blank=True, null=True, verbose_name='Description')),
                ('run_parallel', models.BooleanField(default=True, verbose_name='run_parallel')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='RunPeriodicTasks',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True, verbose_name='is_active')),
                ('start_time', models.DateTimeField(auto_now_add=True, null=True, verbose_name='start_time')),
                ('end_time', models.DateTimeField(auto_now=True, null=True, verbose_name='end_time')),
                ('res', models.JSONField(blank=True, null=True, verbose_name='res')),
                ('status', custom_base_django.models.choices.ChoiceForeignKey(blank=True, default=custom_base_django.utils.Defaults.object, limit_choices_to=models.Q(('title', 'task_status')), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='task_status', to='custom_base_django.choice', verbose_name='task_status')),
                ('task', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='runs', to='custom_base_django.periodictasks', verbose_name='task')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
