# Generated by Django 3.2.12 on 2022-08-15 06:02

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('am', '0001_initial'),
        ('hrm', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Tlog',
            fields=[
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
                ('target', models.CharField(max_length=20, verbose_name='请求目标')),
                ('result', models.CharField(max_length=20, verbose_name='请求结果')),
                ('path', models.CharField(help_text='请求地址', max_length=400)),
                ('requested_at', models.DateTimeField()),
                ('response_ms', models.PositiveIntegerField(default=0)),
                ('response', models.JSONField(blank=True, null=True)),
                ('method', models.CharField(max_length=10)),
                ('url', models.TextField(blank=True, null=True)),
                ('errors', models.TextField(blank=True, null=True)),
                ('params', models.JSONField(blank=True, null=True)),
                ('body', models.JSONField(blank=True, null=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='TDevice',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('type', models.PositiveSmallIntegerField(choices=[(10, '定位基站'), (20, '定位信标'), (30, '定位标签'), (40, 'aoa引擎'), (50, '喇叭'), (60, '视频通道'), (70, '闸机通道'), (80, '面板机')], verbose_name='设备类型')),
                ('code', models.CharField(db_index=True, max_length=50, unique=True, verbose_name='设备唯一标识')),
                ('name', models.CharField(blank=True, max_length=50, null=True, verbose_name='名称')),
                ('location', models.JSONField(blank=True, default=dict, verbose_name='位置信息')),
                ('obj_cate', models.CharField(blank=True, help_text='people/...', max_length=20, null=True, verbose_name='绑定对象')),
                ('is_clock', models.BooleanField(default=False, verbose_name='是否打卡设备')),
                ('access_list', models.JSONField(blank=True, default=list, help_text='employee/remployee/visitor', verbose_name='自动下发人员类型')),
                ('third_info', models.JSONField(blank=True, default=dict, verbose_name='三方信息')),
                ('area', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='am.area', verbose_name='所在区')),
                ('areas', models.ManyToManyField(related_name='tareas', to='am.Area', verbose_name='覆盖区')),
                ('employee', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='hrm.employee', verbose_name='当前绑定人员')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='BltBind',
            fields=[
                ('id', models.CharField(editable=False, help_text='主键ID', max_length=20, primary_key=True, serialize=False, verbose_name='主键ID')),
                ('create_time', models.DateTimeField(default=django.utils.timezone.now, help_text='创建时间', verbose_name='创建时间')),
                ('update_time', models.DateTimeField(auto_now=True, help_text='修改时间', verbose_name='修改时间')),
                ('is_deleted', models.BooleanField(default=False, help_text='删除标记', verbose_name='删除标记')),
                ('type', models.PositiveSmallIntegerField(choices=[(10, '绑定'), (20, '解绑')], default=10, help_text='10(绑定)/20(解绑)', verbose_name='绑定类型')),
                ('obj_cate', models.CharField(blank=True, help_text='people/...', max_length=20, null=True, verbose_name='绑定对象')),
                ('blt', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='third.tdevice', verbose_name='关联标签')),
                ('employee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='hrm.employee', verbose_name='关联人员')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
