# Copyright 2026 EcoFuture Technology Services LLC and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Generated by Django 5.0.6 on 2024-07-04 12:25

import bazis.contrib.statusy.models_abstract
import django.contrib.postgres.fields
import django.db.models.deletion
import model_clone.mixin
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
    ]

    operations = [
        migrations.CreateModel(
            name='Status',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False, verbose_name='Label')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
            ],
            options={
                'verbose_name': 'Status',
                'verbose_name_plural': 'Statuses',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
        migrations.CreateModel(
            name='StatusyContentType',
            fields=[
            ],
            options={
                'verbose_name': 'Status model',
                'verbose_name_plural': 'Status models',
                'proxy': True,
                'indexes': [],
                'constraints': [],
            },
            bases=('contenttypes.contenttype',),
            managers=[
                ('objects', bazis.contrib.statusy.models_abstract.StatusyContentTypeManager()),
            ],
        ),
        migrations.CreateModel(
            name='Transit',
            fields=[
                ('id', models.CharField(max_length=255, primary_key=True, serialize=False, verbose_name='Label')),
                ('name', models.CharField(max_length=255, verbose_name='Name')),
                ('source_link', models.CharField(blank=True, max_length=255, null=True, verbose_name='Transit link in code')),
                ('validators', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None, verbose_name='Transit validators')),
                ('actions_before', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None, verbose_name='Actions before transit')),
                ('actions_after', django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=255), blank=True, default=list, size=None, verbose_name='Actions after transit')),
                ('is_schema_validate', models.BooleanField(default=True, verbose_name='Validate current status data during transition')),
                ('hint', models.TextField(blank=True, null=True, verbose_name='Note')),
                ('status_dst', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transit_dst', to='statusy.status', verbose_name='Destination status')),
                ('status_src', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transit_src', to='statusy.status', verbose_name='Initial status')),
            ],
            options={
                'verbose_name': 'Transit',
                'verbose_name_plural': 'Transits',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
        migrations.CreateModel(
            name='TransitRelation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_selector', models.CharField(max_length=255, verbose_name='Object access selector for child transition')),
                ('transit_child', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transit_relations_as_child', to='statusy.transit')),
                ('transit_parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transit_relations_as_parent', to='statusy.transit')),
            ],
            options={
                'verbose_name': 'Transit relation',
                'verbose_name_plural': 'Transit relations',
                'abstract': False,
            },
            bases=(model_clone.mixin.CloneMixin, models.Model),
        ),
        migrations.AddField(
            model_name='transit',
            name='transits_related',
            field=models.ManyToManyField(blank=True, through='statusy.TransitRelation', to='statusy.transit', verbose_name='Related transits'),
        ),
        migrations.AddField(
            model_name='transit',
            name='model',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transits', to='statusy.statusycontenttype'),
        ),
    ]
