# Generated by Django 5.1.7 on 2025-03-23 10:19

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


class Migration(migrations.Migration):

    dependencies = [
        ('accounts', '0004_company_employee_company'),
        ('overtime', '0012_overtimerequest_supporting_document_and_more'),
    ]

    operations = [
        migrations.AlterField(
            model_name='overtimerequest',
            name='end_time',
            field=models.TimeField(default=datetime.datetime(2025, 3, 23, 19, 0, 0, 637135, tzinfo=datetime.timezone.utc)),
        ),
        migrations.AlterField(
            model_name='overtimerequest',
            name='start_time',
            field=models.TimeField(default=datetime.datetime(2025, 3, 23, 17, 0, 0, 637116, tzinfo=datetime.timezone.utc)),
        ),
        migrations.CreateModel(
            name='CompanyOvertimeConfig',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('working_days_per_month', models.PositiveIntegerField(default=22, help_text='Standard number of working days per month')),
                ('working_hours_per_day', models.PositiveIntegerField(default=8, help_text='Standard number of working hours per day')),
                ('weekday_rate', models.DecimalField(decimal_places=2, default=1.5, help_text='Multiplier for weekday overtime (e.g., 1.5 for 150%)', max_digits=4)),
                ('saturday_rate', models.DecimalField(decimal_places=2, default=1.5, max_digits=4)),
                ('sunday_holiday_rate', models.DecimalField(decimal_places=2, default=2.0, max_digits=4)),
                ('calculation_method', models.CharField(choices=[('STANDARD', 'Standard (Basic Pay / Working Days / Hours × OT Hours × Rate)'), ('FIXED_RATE', 'Fixed Rate per Hour'), ('CUSTOM', 'Custom Formula')], default='STANDARD', max_length=20)),
                ('fixed_weekday_amount', models.DecimalField(blank=True, decimal_places=2, help_text='Fixed amount per hour for weekday overtime', max_digits=10, null=True)),
                ('fixed_saturday_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('fixed_sunday_holiday_amount', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('custom_formula', models.TextField(blank=True, help_text='Python expression for custom calculation. Available variables: basic_pay, hours, rate')),
                ('company', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='accounts.company')),
            ],
            options={
                'verbose_name': 'Company Overtime Configuration',
                'verbose_name_plural': 'Company Overtime Configurations',
            },
        ),
        migrations.CreateModel(
            name='Holiday',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100)),
                ('date', models.DateField()),
                ('recurring', models.BooleanField(default=True, help_text='If True, holiday repeats every year on the same date')),
                ('company', models.ForeignKey(blank=True, help_text='If null, applies to all companies', null=True, on_delete=django.db.models.deletion.CASCADE, to='accounts.company')),
            ],
            options={
                'ordering': ['date'],
                'unique_together': {('date', 'company')},
            },
        ),
    ]
