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

from django.db import migrations


def populate_holidays(apps, schema_editor):
    Holiday = apps.get_model('overtime', 'Holiday')
    
    # List of Zambian public holidays
    zambian_holidays = [
        # Fixed date holidays
        ('New Year\'s Day', '2025-01-01', True),
        ('International Women\'s Day', '2025-03-08', True),
        ('Youth Day', '2025-03-12', True),
        ('Labour Day', '2025-05-01', True),
        ('Africa Freedom Day', '2025-05-25', True),
        ('Heroes Day', '2025-07-01', True),
        ('Unity Day', '2025-07-02', True),
        ('Farmers Day', '2025-08-04', True),
        ('Independence Day', '2025-10-24', True),
        ('Christmas Day', '2025-12-25', True),
        
        # Variable date holidays for 2025
        ('Good Friday', '2025-04-18', False),
        ('Easter Monday', '2025-04-21', False),
    ]
    
    for name, date, recurring in zambian_holidays:
        Holiday.objects.create(
            name=name,
            date=date,
            recurring=recurring,
            company=None  # Global holiday
        )


def reverse_holidays(apps, schema_editor):
    Holiday = apps.get_model('overtime', 'Holiday')
    Holiday.objects.all().delete()


class Migration(migrations.Migration):

    dependencies = [
        ('overtime', '0013_alter_overtimerequest_end_time_and_more'),
    ]

    operations = [
        migrations.RunPython(populate_holidays, reverse_holidays),
    ]
