# Generated by Django 5.2.7 on 2026-02-17 06:12

import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='BiometricDevice',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('ip_address', models.GenericIPAddressField()),
                ('port', models.IntegerField(default=4370)),
                ('is_active', models.BooleanField(default=True)),
                ('last_sync', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.AddField(
            model_name='employee',
            name='biometric_id',
            field=models.CharField(blank=True, help_text='ID on the ZKTeco device', max_length=20, null=True, unique=True),
        ),
        migrations.CreateModel(
            name='AttendanceLog',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField()),
                ('uid', models.IntegerField(help_text='Internal ID from device log')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.employee')),
                ('device', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='core.biometricdevice')),
            ],
            options={
                'ordering': ['-timestamp'],
                'unique_together': {('employee', 'timestamp')},
            },
        ),
    ]
