# Generated by Django 5.0.2 on 2025-08-10 20:53

import django.db.models.deletion
from decimal import Decimal
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('hr', '0003_employeedocument'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AddField(
            model_name='employee',
            name='contract_end_date',
            field=models.DateField(blank=True, help_text='Contract end date (for fixed-term contracts)', null=True),
        ),
        migrations.AddField(
            model_name='employee',
            name='contract_start_date',
            field=models.DateField(blank=True, help_text='Contract start date', null=True),
        ),
        migrations.AddField(
            model_name='employee',
            name='daily_rate',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Daily rate for casual workers', max_digits=10, null=True),
        ),
        migrations.AddField(
            model_name='employee',
            name='hourly_rate',
            field=models.DecimalField(blank=True, decimal_places=2, help_text='Hourly rate for hourly workers', max_digits=10, null=True),
        ),
        migrations.AddField(
            model_name='employee',
            name='pay_frequency',
            field=models.CharField(choices=[('monthly', 'Monthly'), ('weekly', 'Weekly'), ('daily', 'Daily'), ('hourly', 'Hourly')], default='monthly', help_text='How often the employee is paid', max_length=20),
        ),
        migrations.AlterField(
            model_name='employee',
            name='basic_salary',
            field=models.DecimalField(decimal_places=2, help_text='Basic salary amount', max_digits=12),
        ),
        migrations.AlterField(
            model_name='employee',
            name='employment_type',
            field=models.CharField(choices=[('permanent', 'Permanent'), ('contract', 'Contract'), ('internship', 'Internship'), ('temporary', 'Temporary'), ('casual', 'Casual/Daily')], default='permanent', max_length=20),
        ),
        migrations.CreateModel(
            name='Attendance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('status', models.CharField(choices=[('present', 'Present'), ('absent', 'Absent'), ('late', 'Late'), ('half_day', 'Half Day'), ('leave', 'On Leave'), ('sick', 'Sick Leave')], default='present', max_length=20)),
                ('check_in_time', models.TimeField(blank=True, null=True)),
                ('check_out_time', models.TimeField(blank=True, null=True)),
                ('hours_worked', models.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
                ('overtime_hours', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=5)),
                ('notes', models.TextField(blank=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='attendance_records', to='hr.employee')),
                ('recorded_by', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='recorded_attendance', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ['-date', 'employee'],
                'unique_together': {('employee', 'date')},
            },
        ),
    ]
