# Generated by Django 3.2.13 on 2025-12-13 16:27

import datetime
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('authentication', '0060_auto_20251213_1627'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('panel', '0374_auto_20251208_1019'),
    ]

    operations = [
        migrations.AddField(
            model_name='posdevicesession',
            name='pos_unique_id',
            field=models.CharField(max_length=6, null=True, unique=True),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='current_user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='current_pos', to='authentication.systemuserprofile'),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='ip',
            field=models.CharField(default='0.0.0.0', max_length=15),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='mac',
            field=models.CharField(max_length=50, null=True),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='name',
            field=models.TextField(default=''),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='owner',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='owned_pos', to='authentication.systemuserprofile'),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='pos_unique_id',
            field=models.CharField(max_length=6, null=True, unique=True),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='sdk',
            field=models.TextField(default=''),
        ),
        migrations.AddField(
            model_name='posmachine',
            name='version',
            field=models.IntegerField(default=0),
        ),
        migrations.AddField(
            model_name='poultrysciencereport',
            name='chicken_age',
            field=models.IntegerField(null=True),
        ),
        migrations.AddField(
            model_name='poultrysciencereport',
            name='report_id',
            field=models.IntegerField(null=True),
        ),
        migrations.AddField(
            model_name='steward',
            name='user',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='steward_user', to='authentication.systemuserprofile'),
        ),
        migrations.AlterField(
            model_name='functionexecutor',
            name='compare_time',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 454576)),
        ),
        migrations.AlterField(
            model_name='operatorlasttimeenter',
            name='assignment_last_time_check',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 394441)),
        ),
        migrations.AlterField(
            model_name='operatorlasttimeenter',
            name='city_operator_last_time_check',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 394441)),
        ),
        migrations.AlterField(
            model_name='operatorlasttimeenter',
            name='kill_house_last_time_check',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 394441)),
        ),
        migrations.AlterField(
            model_name='operatorlasttimeenter',
            name='province_operator_last_time_check',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 394441)),
        ),
        migrations.AlterField(
            model_name='posdevicesession',
            name='session_create_date',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 530182)),
        ),
        migrations.AlterField(
            model_name='posdevicesession',
            name='session_last_seen_date',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 530182)),
        ),
        migrations.AlterField(
            model_name='poultry',
            name='date_of_register',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 398817)),
        ),
        migrations.AlterField(
            model_name='poultry',
            name='hatching_date',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 398817)),
        ),
        migrations.AlterField(
            model_name='poultry',
            name='last_party_date',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 398817)),
        ),
        migrations.AlterField(
            model_name='totalpoultryrequestquantity',
            name='date',
            field=models.DateTimeField(default=datetime.datetime(2025, 12, 13, 16, 27, 37, 409788)),
        ),
        migrations.CreateModel(
            name='Representative',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('create_date', models.DateTimeField(auto_now_add=True)),
                ('modify_date', models.DateTimeField(auto_now=True)),
                ('trash', models.BooleanField(default=False)),
                ('first_name', models.CharField(max_length=200, null=True)),
                ('last_name', models.CharField(max_length=200, null=True)),
                ('mobile', models.CharField(max_length=15, null=True)),
                ('city', models.CharField(max_length=100, null=True)),
                ('Kill_house', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='kill_house_representative', to='panel.killhouse')),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='representative_createdby', to=settings.AUTH_USER_MODEL)),
                ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='representative_modifiedby', to=settings.AUTH_USER_MODEL)),
                ('steward', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='steward_representative', to='panel.steward')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='POSAuditLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('action', models.CharField(choices=[('CHANGE_OWNER', 'تغییر مالک'), ('CHANGE_CURRENT_USER', 'تغییر توزیع کننده'), ('CHANGE_CURRENT_REPRESENTATIVE', 'تغییر نماینده'), ('ACCESSLEVEL_UPDATE', 'بروزرسانی سطح دسترسی')], max_length=50)),
                ('old_value', models.JSONField(blank=True, null=True)),
                ('new_value', models.JSONField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('performed_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
                ('pos', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='audit_logs', to='panel.posmachine')),
            ],
        ),
        migrations.CreateModel(
            name='POSAccessLevel',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.UUIDField(default=uuid.uuid4, editable=False, unique=True)),
                ('create_date', models.DateTimeField(auto_now_add=True)),
                ('modify_date', models.DateTimeField(auto_now=True)),
                ('trash', models.BooleanField(default=False)),
                ('name', models.CharField(max_length=100, null=True)),
                ('in_province_sale', models.BooleanField(default=True)),
                ('out_province_sale', models.BooleanField(default=True)),
                ('cutting', models.BooleanField(default=True)),
                ('freezing', models.BooleanField(default=True)),
                ('warehouse', models.BooleanField(default=True)),
                ('retail', models.BooleanField(default=True)),
                ('active', models.BooleanField(default=True)),
                ('created_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posaccesslevel_createdby', to=settings.AUTH_USER_MODEL)),
                ('modified_by', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='posaccesslevel_modifiedby', to=settings.AUTH_USER_MODEL)),
                ('pos', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='access_levels', to='panel.posmachine')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='posmachine',
            name='current_representative',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='representative_pos', to='panel.representative'),
        ),
    ]
