# Generated by Django 3.1.3 on 2021-02-15 02:20

import app.core.db.model_mixin
import app.core.util.base
import app.managers.user.user_manager
import app.models.core.agent.agent_stats
from django.conf import settings
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0012_alter_user_first_name_max_length'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=150, unique=True, validators=[django.contrib.auth.validators.UnicodeUsernameValidator()], verbose_name='username')),
                ('first_name', models.CharField(blank=True, max_length=150, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', app.managers.user.user_manager.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='AgentCustomer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('agent_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('age', models.IntegerField()),
                ('continent', models.CharField(max_length=255)),
                ('place', models.CharField(max_length=255)),
                ('company_name', models.CharField(max_length=255, null=True)),
                ('salary', models.DecimalField(decimal_places=4, default=0, max_digits=20)),
                ('hour_of_work_per_day', models.IntegerField(default=0)),
                ('is_rest', models.BooleanField(default=True)),
                ('is_employed', models.BooleanField(default=False)),
                ('is_producing', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(editable=False)),
            ],
        ),
        migrations.CreateModel(
            name='BuildingType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('buy_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('rent_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('cost_growth', models.DecimalField(decimal_places=3, max_digits=5)),
                ('upgrade_growth', models.DecimalField(decimal_places=3, max_digits=5)),
                ('base_employees', models.IntegerField()),
                ('employees_growth', models.DecimalField(decimal_places=3, max_digits=5)),
                ('base_storage', models.IntegerField()),
                ('storage_growth', models.DecimalField(decimal_places=3, max_digits=5)),
                ('can_sell', models.BooleanField()),
                ('can_produce', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='CommunityBank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance', models.DecimalField(decimal_places=4, max_digits=30)),
            ],
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('company_name', models.CharField(max_length=255)),
                ('owner_name', models.CharField(max_length=255)),
                ('continent', models.CharField(default='alantica', max_length=255)),
                ('balance', models.DecimalField(decimal_places=4, default=300, max_digits=20)),
                ('popularity', models.IntegerField(default=0)),
                ('reputation', models.IntegerField(default=0)),
                ('qualification', models.IntegerField(default=0)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
                ('deleted_at', models.DateTimeField(editable=False, null=True)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
            bases=(models.Model, app.core.db.model_mixin.ModelMixin),
        ),
        migrations.CreateModel(
            name='Continent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('gdp_capita', models.DecimalField(decimal_places=4, max_digits=20, null=True)),
                ('cpi', models.DecimalField(decimal_places=2, max_digits=8, null=True)),
                ('inflation_rate', models.DecimalField(decimal_places=2, max_digits=4, null=True)),
                ('update_at', models.DateTimeField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='GlobalStore',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_name', models.CharField(max_length=255)),
                ('number_of_products', models.PositiveIntegerField(default=0)),
                ('max_number_of_products', models.PositiveIntegerField(default=2000)),
                ('total_money', models.DecimalField(decimal_places=4, default=0, max_digits=20)),
                ('registered_at', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('updated_at', models.DateTimeField()),
                ('company', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.company')),
            ],
        ),
        migrations.CreateModel(
            name='Item',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('cost_attempt', models.DecimalField(decimal_places=4, max_digits=20)),
                ('probability_per_attempt', models.DecimalField(decimal_places=2, max_digits=5)),
                ('raw_quality', models.IntegerField()),
                ('employees_needed', models.IntegerField()),
                ('quantity_per_attempt', models.IntegerField()),
                ('category_type', models.CharField(max_length=255)),
                ('building_type', models.TextField()),
                ('continents', models.TextField()),
                ('unit', models.CharField(max_length=255)),
                ('electric_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('water_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('gas_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('unlock_at_building_level', models.IntegerField()),
                ('raw_producing_time', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Land',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('level', models.IntegerField()),
                ('cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('rent', models.DecimalField(decimal_places=4, max_digits=20)),
                ('max_land_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('min_land_cost', models.DecimalField(decimal_places=4, max_digits=20)),
            ],
        ),
        migrations.CreateModel(
            name='Landscape',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('land_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('level', models.IntegerField()),
                ('company_name', models.CharField(max_length=255, null=True)),
                ('continent', models.CharField(max_length=255)),
                ('place', models.CharField(max_length=255)),
                ('buy_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('rent_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('continent_cost', models.DecimalField(decimal_places=4, max_digits=20)),
                ('continent_rent', models.DecimalField(decimal_places=4, max_digits=20)),
                ('is_buy', models.BooleanField(default=False)),
                ('is_rent', models.BooleanField(default=False)),
                ('is_selling', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
                ('last_collected_money_at', models.DateTimeField(null=True)),
                ('company', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app.company')),
            ],
            bases=(models.Model, app.core.db.model_mixin.ModelMixin),
        ),
        migrations.CreateModel(
            name='OwnerBank',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('balance', models.DecimalField(decimal_places=4, max_digits=30)),
            ],
        ),
        migrations.CreateModel(
            name='Place',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('x', models.IntegerField()),
                ('y', models.IntegerField()),
                ('name', models.CharField(max_length=255)),
                ('group', models.CharField(max_length=255)),
                ('continent', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField(default=django.utils.timezone.now)),
                ('total', models.DecimalField(decimal_places=4, max_digits=20)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='TransactionItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='AgentStats',
            fields=[
                ('agent', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='app.agentcustomer')),
                ('qualification', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('productivity', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('communication', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('creativity', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('leadership', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('learning', models.IntegerField(default=app.models.core.agent.agent_stats.random_score)),
                ('stress', models.IntegerField(default=0)),
                ('emotion', models.IntegerField(default=100)),
                ('updated_at', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='Building',
            fields=[
                ('building_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('building_type', models.CharField(max_length=255)),
                ('building_name', models.CharField(max_length=255)),
                ('current_level', models.IntegerField()),
                ('company_name', models.CharField(max_length=255)),
                ('current_storage', models.IntegerField(default=0)),
                ('max_storage', models.IntegerField()),
                ('current_employees', models.IntegerField(default=0)),
                ('max_employees', models.IntegerField()),
                ('is_buy', models.BooleanField(default=False)),
                ('is_rent', models.BooleanField(default=False)),
                ('rent_cost', models.DecimalField(decimal_places=4, max_digits=20, null=True)),
                ('buy_cost', models.DecimalField(decimal_places=4, max_digits=20, null=True)),
                ('landscape', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='app.landscape')),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
                ('last_collected_money_at', models.DateTimeField()),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.company')),
            ],
            bases=(models.Model, app.core.db.model_mixin.ModelMixin),
        ),
        migrations.CreateModel(
            name='TransactionHolder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_id', models.IntegerField()),
                ('sender_id', models.CharField(max_length=255)),
                ('receiver_id', models.CharField(max_length=255)),
                ('buyer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='receiver', to='app.company')),
                ('seller', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sender', to='app.company')),
                ('transaction', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.transaction')),
            ],
        ),
        migrations.CreateModel(
            name='TransactionDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_id', models.IntegerField()),
                ('product_id', models.IntegerField()),
                ('quantity', models.IntegerField()),
                ('unit_price', models.DecimalField(decimal_places=4, max_digits=20)),
                ('discount', models.DecimalField(decimal_places=2, max_digits=5)),
                ('money', models.DecimalField(decimal_places=4, max_digits=20, null=True)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
                ('transaction', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='transaction', to='app.transaction')),
            ],
        ),
        migrations.CreateModel(
            name='ProductProducing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('is_success', models.BooleanField(null=True)),
                ('is_completed', models.BooleanField(default=False)),
                ('expected_quality', models.DecimalField(decimal_places=2, max_digits=10)),
                ('start_time', models.DateTimeField()),
                ('end_time', models.DateTimeField()),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.item')),
                ('building', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.building')),
            ],
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('record_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('price', models.DecimalField(decimal_places=4, max_digits=20)),
                ('quality', models.DecimalField(decimal_places=2, max_digits=10)),
                ('discount', models.DecimalField(decimal_places=4, max_digits=20)),
                ('name', models.CharField(max_length=255)),
                ('company_name', models.CharField(max_length=30)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField(null=True)),
                ('bought_at', models.DateTimeField(null=True)),
                ('deleted_at', models.DateTimeField(null=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.company')),
                ('item_object', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.item')),
            ],
        ),
        migrations.CreateModel(
            name='ProducedItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('record_id', models.CharField(default=app.core.util.base.generate_unique_id, max_length=255)),
                ('name', models.CharField(max_length=255)),
                ('in_global_store', models.BooleanField(default=False)),
                ('quality', models.DecimalField(decimal_places=2, max_digits=10)),
                ('created_at', models.DateTimeField(editable=False)),
                ('updated_at', models.DateTimeField()),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.item')),
                ('building', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.building')),
            ],
        ),
        migrations.CreateModel(
            name='GlobalStoreItem',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('item_id', models.IntegerField()),
                ('price', models.DecimalField(decimal_places=4, max_digits=20)),
                ('is_bought', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
                ('updated_at', models.DateTimeField()),
                ('company_store', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.globalstore')),
                ('produced_item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.produceditem')),
            ],
        ),
        migrations.CreateModel(
            name='AgentTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('payment_id', models.IntegerField()),
                ('customer_id', models.IntegerField()),
                ('producer_id', models.CharField(max_length=255)),
                ('continent', models.CharField(max_length=255)),
                ('total', models.DecimalField(decimal_places=4, max_digits=20)),
                ('created_at', models.DateTimeField(editable=False)),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.agentcustomer')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.company')),
            ],
        ),
        migrations.CreateModel(
            name='AgentStatsTracker',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qualification', models.IntegerField()),
                ('productivity', models.IntegerField()),
                ('communication', models.IntegerField()),
                ('creativity', models.IntegerField()),
                ('leadership', models.IntegerField()),
                ('learning', models.IntegerField()),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.agentcustomer')),
            ],
        ),
        migrations.CreateModel(
            name='AgentProducing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('process_id', models.IntegerField()),
                ('agent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.agentcustomer')),
                ('producing_process', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='app.productproducing')),
            ],
        ),
        migrations.CreateModel(
            name='Storage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('max_capacity', models.IntegerField()),
                ('current_capacity', models.IntegerField(default=0)),
                ('updated_at', models.DateTimeField()),
                ('building', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='app.building')),
            ],
        ),
        migrations.AddField(
            model_name='agentcustomer',
            name='building',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='app.building'),
        ),
    ]
