# Generated by Django 5.0.6 on 2026-11-02 07:03

import Employee.models
import datetime
import django.db.models.deletion
from decimal import Decimal
from django.db import migrations, models


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='DayOff',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('employee_code', models.CharField(blank=True, max_length=50)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='ExtraOff',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('employee_code', models.CharField(blank=True, max_length=50)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='PerfGoal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('title', models.CharField(max_length=255)),
                ('description', models.TextField(blank=True, default='')),
                ('goal_type', models.CharField(choices=[('Objective', 'Objective'), ('Key Result', 'Key Result'), ('KPI', 'KPI')], default='Objective', max_length=12)),
                ('financial_year', models.CharField(blank=True, default='', max_length=9)),
                ('weight', models.DecimalField(decimal_places=2, default=Decimal('0'), help_text='Weightage (%) of this goal in the appraisal', max_digits=5)),
                ('target_value', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('current_value', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('unit', models.CharField(blank=True, default='', max_length=30)),
                ('progress_percent', models.DecimalField(decimal_places=2, default=Decimal('0'), help_text='0 - 100. Auto-calculated from current/target when both are sent', max_digits=5)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('due_date', models.DateField(blank=True, null=True)),
                ('status', models.CharField(choices=[('Not Started', 'Not Started'), ('In Progress', 'In Progress'), ('At Risk', 'At Risk'), ('Completed', 'Completed'), ('Cancelled', 'Cancelled')], db_index=True, default='Not Started', max_length=12)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['employee_id', 'id'],
            },
        ),
        migrations.CreateModel(
            name='PerfImprovementPlan',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('reason', models.TextField(blank=True, default='')),
                ('coaching_plan', models.TextField(blank=True, default='')),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('status', models.CharField(choices=[('Active', 'Active'), ('Extended', 'Extended'), ('Completed', 'Completed'), ('Cancelled', 'Cancelled')], db_index=True, default='Active', max_length=10)),
                ('outcome', models.TextField(blank=True, default='')),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='PerfManagerFeedback',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('feedback_type', models.CharField(choices=[('1-on-1', '1-on-1'), ('Mid-Year', 'Mid-Year'), ('Annual', 'Annual'), ('Coaching', 'Coaching'), ('Recognition', 'Recognition')], default='1-on-1', max_length=12)),
                ('feedback', models.TextField()),
                ('rating', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
                ('meeting_date', models.DateField(blank=True, null=True)),
                ('visible_to_employee', models.BooleanField(default=False, help_text='False = confidential dossier (HR + manager only)')),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-meeting_date', '-id'],
            },
        ),
        migrations.CreateModel(
            name='PerfRatingHistory',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('period_label', models.CharField(blank=True, default='', max_length=50)),
                ('financial_year', models.CharField(blank=True, default='', max_length=9)),
                ('rating', models.DecimalField(decimal_places=1, max_digits=3)),
                ('rating_bucket', models.PositiveSmallIntegerField(db_index=True, default=1)),
                ('rating_label', models.CharField(blank=True, default='', max_length=60)),
                ('source', models.CharField(choices=[('appraisal', 'Appraisal'), ('manual', 'Manual'), ('import', 'Import')], default='manual', max_length=10)),
                ('remarks', models.TextField(blank=True, default='')),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-created_at', '-id'],
            },
        ),
        migrations.CreateModel(
            name='PerfReviewCycle',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('name', models.CharField(help_text='e.g. Mid-Year Performance Review (H1 2026)', max_length=150)),
                ('cycle_type', models.CharField(choices=[('Mid-Year', 'Mid-Year'), ('Annual', 'Annual'), ('Quarterly', 'Quarterly'), ('Goal Setting', 'Goal Setting'), ('Executive Review', 'Executive Review'), ('Custom', 'Custom')], default='Custom', max_length=20)),
                ('period_label', models.CharField(blank=True, default='', help_text='Short label used by the dashboard, e.g. H1 2026', max_length=50)),
                ('financial_year', models.CharField(blank=True, default='', help_text='April-March, e.g. 2026-27', max_length=9)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('submission_deadline', models.DateField(blank=True, null=True)),
                ('eligible_joined_before', models.DateField(blank=True, help_text='Eligible: all employees who joined before this date. Empty = everyone', null=True)),
                ('description', models.TextField(blank=True, default='')),
                ('status', models.CharField(choices=[('Draft', 'Draft'), ('Active', 'Active'), ('Closed', 'Closed')], db_index=True, default='Draft', max_length=10)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-submission_deadline', '-id'],
            },
        ),
        migrations.CreateModel(
            name='PerfSelfReview',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('summary', models.TextField(help_text="Self-appraisal text, e.g. 'Delivered the 1-Click candidate conversion engine ...'")),
                ('self_score', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
                ('status', models.CharField(choices=[('Draft', 'Draft'), ('Submitted', 'Submitted')], default='Draft', max_length=10)),
                ('submitted_at', models.DateTimeField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
        migrations.CreateModel(
            name='ReportingHierarchy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('Employee_ID', models.CharField(db_index=True, max_length=100)),
                ('manager_code', models.CharField(blank=True, max_length=100, null=True)),
                ('hod_code', models.CharField(blank=True, max_length=100, null=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['Employee_ID'],
            },
        ),
        migrations.CreateModel(
            name='Target',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('titel', models.CharField(max_length=100)),
                ('description', models.TextField(blank=True, null=True)),
                ('create_date', models.DateField()),
                ('target_date', models.DateField()),
                ('completed', models.BooleanField(default=False)),
                ('completed_date', models.DateField(blank=True, null=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='WFHPolicy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('is_enabled', models.BooleanField(default=True)),
                ('weekly_quota_days', models.PositiveIntegerField(default=2, help_text='Max WFH days per week per employee')),
                ('advance_notice_hours', models.PositiveIntegerField(default=24, help_text='WFH must be applied at least this many hours ahead')),
                ('work_start_time', models.TimeField(default=datetime.time(9, 0), help_text='Notice is measured up to this time on the WFH date')),
                ('description', models.TextField(blank=True, default='')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='WFHRequest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('Employee_ID', models.CharField(db_index=True, max_length=100)),
                ('Name', models.CharField(blank=True, max_length=100, null=True)),
                ('wfh_date', models.DateField()),
                ('reason', models.TextField(blank=True, null=True)),
                ('status', models.CharField(choices=[('Pending', 'Pending'), ('Approved', 'Approved'), ('Rejected', 'Rejected'), ('Cancelled', 'Cancelled')], db_index=True, default='Pending', max_length=10)),
                ('notice_hours', models.DecimalField(decimal_places=1, default=Decimal('0'), help_text='Advance notice given when the request was submitted', max_digits=8)),
                ('reviewed_by', models.CharField(blank=True, max_length=150, null=True)),
                ('reviewed_at', models.DateTimeField(blank=True, null=True)),
                ('review_comment', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
            ],
            options={
                'ordering': ['-created_at', '-id'],
            },
        ),
        migrations.CreateModel(
            name='ApprovalAction',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('request_type', models.CharField(choices=[('leave', 'Leave'), ('wfh', 'Work From Home')], max_length=10)),
                ('request_id', models.PositiveIntegerField(db_index=True)),
                ('step_order', models.PositiveIntegerField()),
                ('step_name', models.CharField(max_length=100)),
                ('approver_type', models.CharField(choices=[('reporting_manager', 'Reporting Manager'), ('hod', 'Department HOD'), ('hr', 'HR Compliance & Payroll')], max_length=20)),
                ('approver_code', models.CharField(blank=True, help_text='Employee code of the designated approver (manager / HOD)', max_length=100, null=True)),
                ('sla_hours', models.PositiveIntegerField(default=12)),
                ('due_at', models.DateTimeField(blank=True, null=True)),
                ('status', models.CharField(choices=[('Pending', 'Pending'), ('Approved', 'Approved'), ('Rejected', 'Rejected'), ('Skipped', 'Skipped')], db_index=True, default='Pending', max_length=10)),
                ('acted_by', models.CharField(blank=True, max_length=150, null=True)),
                ('acted_at', models.DateTimeField(blank=True, null=True)),
                ('comment', models.TextField(blank=True, null=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_approval_actions', to='Company.company_details')),
            ],
            options={
                'ordering': ['request_type', 'request_id', 'step_order'],
            },
        ),
        migrations.CreateModel(
            name='ApprovalWorkflowStep',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('request_type', models.CharField(choices=[('leave', 'Leave'), ('wfh', 'Work From Home')], max_length=10)),
                ('step_order', models.PositiveIntegerField()),
                ('name', models.CharField(max_length=100)),
                ('approver_type', models.CharField(choices=[('reporting_manager', 'Reporting Manager'), ('hod', 'Department HOD'), ('hr', 'HR Compliance & Payroll')], max_length=20)),
                ('sla_hours', models.PositiveIntegerField(default=12)),
                ('description', models.CharField(blank=True, default='', max_length=200)),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_workflow_steps', to='Company.company_details')),
            ],
            options={
                'ordering': ['request_type', 'step_order'],
            },
        ),
        migrations.CreateModel(
            name='Department',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150)),
                ('code', models.CharField(blank=True, max_length=50, null=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='departments', to='Company.company_details')),
            ],
            options={
                'ordering': ['name'],
            },
        ),
        migrations.CreateModel(
            name='EMP_check_in_check_out',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Employee_ID', models.CharField(blank=True, max_length=100, null=True)),
                ('Name', models.CharField(blank=True, max_length=100, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='photos/check_in/')),
                ('check_out_image', models.ImageField(blank=True, null=True, upload_to='photos/check_out/')),
                ('login_date', models.DateField(blank=True, null=True, verbose_name='login date')),
                ('login_time', models.CharField(blank=True, max_length=500, null=True)),
                ('logout_date', models.DateField(blank=True, null=True)),
                ('logout_time', models.CharField(blank=True, max_length=500, null=True)),
                ('total_working_hours', models.CharField(blank=True, max_length=50, null=True)),
                ('comment', models.TextField(blank=True, null=True)),
                ('checkin_latitude', models.FloatField(blank=True, null=True)),
                ('checkin_longitude', models.FloatField(blank=True, null=True)),
                ('checkout_latitude', models.FloatField(blank=True, null=True)),
                ('checkout_longitude', models.FloatField(blank=True, null=True)),
                ('checkin_location_type', models.CharField(blank=True, choices=[('office', 'Office'), ('outside', 'Outside Office')], max_length=50, null=True)),
                ('checkout_location_type', models.CharField(blank=True, choices=[('office', 'Office'), ('outside', 'Outside Office')], max_length=50, null=True)),
                ('completed_targets', models.JSONField(blank=True, default=list)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='employee_checkins', to='Company.company_details')),
            ],
        ),
        migrations.CreateModel(
            name='AttendanceEmp',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Employee_ID', models.CharField(blank=True, max_length=100, null=True)),
                ('Name', models.CharField(blank=True, max_length=100, null=True)),
                ('date', models.DateField(blank=True, null=True)),
                ('status', models.CharField(blank=True, choices=[('Present', 'Present'), ('Absent', 'Absent'), ('Half Day', 'Half Day'), ('Holiday', 'Holiday'), ('Paid Leave', 'Paid Leave'), ('Sick Leave', 'Sick Leave'), ('Casual Leave', 'Casual Leave')], max_length=20, null=True)),
                ('total_working_hours', models.CharField(blank=True, max_length=50, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='photos/')),
                ('comment', models.TextField(blank=True, max_length=200, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attendance_records', to='Company.company_details')),
                ('check_in_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='attendance_records', to='Employee.emp_check_in_check_out')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeeDT',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('employee_code', models.CharField(blank=True, default=Employee.models.generate_employee_code, max_length=8, unique=True)),
                ('is_active', models.BooleanField(db_index=True, default=True)),
                ('Work_sift', models.CharField(blank=True, choices=[('Day Shift', 'Day Shift'), ('Night Shift', 'Night Shift')], max_length=90, null=True)),
                ('Employ_check_id', models.CharField(blank=True, max_length=50, null=True)),
                ('check_st', models.CharField(blank=True, max_length=50, null=True)),
                ('verify_image', models.ImageField(blank=True, null=True, upload_to='atendanc/')),
                ('profile_image', models.ImageField(blank=True, null=True, upload_to='profile_images/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(blank=True, max_length=50, null=True)),
                ('email', models.EmailField(blank=True, max_length=254, null=True, unique=True)),
                ('password', models.CharField(blank=True, max_length=50, null=True)),
                ('phone_number', models.CharField(blank=True, max_length=15, null=True)),
                ('verify_code', models.CharField(blank=True, max_length=15, null=True)),
                ('image', models.ImageField(blank=True, null=True, upload_to='photos/')),
                ('Date_of_Birth', models.DateField(blank=True, null=True, verbose_name='Date of Birth')),
                ('Gender', models.CharField(blank=True, max_length=50, null=True)),
                ('Blood_Group', models.CharField(blank=True, max_length=50, null=True)),
                ('Marital_Status', models.CharField(blank=True, max_length=50, null=True)),
                ('Marriage_Anniversary', models.DateField(blank=True, null=True, verbose_name='Marriage Anniversary')),
                ('Personal_Email', models.EmailField(blank=True, max_length=254, null=True)),
                ('Alternate_Phone_Number', models.CharField(blank=True, max_length=15, null=True)),
                ('Current_Address', models.CharField(blank=True, max_length=500, null=True)),
                ('Permanent_Address', models.CharField(blank=True, max_length=500, null=True)),
                ('House_Type', models.CharField(blank=True, max_length=100, null=True)),
                ('Staying_at_Current_Residence_Since', models.CharField(blank=True, max_length=100, null=True)),
                ('Living_in_Current_City_Since', models.CharField(blank=True, max_length=100, null=True)),
                ('Date_of_Joining', models.DateField(blank=True, null=True, verbose_name='Date of Joining')),
                ('Basic_Salary', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('Overtime_Rate', models.DecimalField(blank=True, decimal_places=2, default=Decimal('50.00'), max_digits=5, null=True)),
                ('Work_hours', models.IntegerField(blank=True, null=True)),
                ('PF_Percentage', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=5, null=True)),
                ('TDS_Percentage', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=5, null=True)),
                ('ESI_Percentage', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=5, null=True)),
                ('saturday_policy', models.CharField(choices=[('OFF', 'Saturday Off'), ('HALF', 'Half Day'), ('FULL', 'Full Working Day')], default='FULL', max_length=10)),
                ('aadhaar_number', models.CharField(blank=True, max_length=12, null=True)),
                ('pan_number', models.CharField(blank=True, max_length=10, null=True)),
                ('pf_number', models.CharField(blank=True, max_length=25, null=True)),
                ('esi_number', models.CharField(blank=True, max_length=25, null=True)),
                ('Probation_Period', models.CharField(blank=True, max_length=100, null=True)),
                ('Employee_Type', models.CharField(blank=True, max_length=100, null=True)),
                ('Work_Location', models.CharField(blank=True, max_length=300, null=True)),
                ('Employee_Status', models.CharField(blank=True, max_length=100, null=True)),
                ('Work_Experience', models.CharField(blank=True, max_length=100, null=True)),
                ('Designation', models.CharField(blank=True, max_length=200, null=True)),
                ('Job_Title', models.CharField(blank=True, max_length=200, null=True)),
                ('Department', models.CharField(blank=True, max_length=200, null=True)),
                ('Sub_Department', models.CharField(blank=True, max_length=200, null=True)),
                ('WORK_HISTORY', models.CharField(blank=True, max_length=500, null=True)),
                ('Resignation_Date', models.CharField(blank=True, max_length=500, null=True)),
                ('Resignation_Status', models.CharField(blank=True, max_length=500, null=True)),
                ('Notice_Period', models.CharField(blank=True, max_length=500, null=True)),
                ('Last_Working_Day', models.CharField(blank=True, max_length=500, null=True)),
                ('team_Name', models.CharField(blank=True, max_length=500, null=True)),
                ('team_type', models.CharField(blank=True, max_length=500, null=True)),
                ('team_Department', models.CharField(blank=True, max_length=500, null=True)),
                ('team_Designation', models.CharField(blank=True, max_length=500, null=True)),
                ('EDUCATIONAL_INFO', models.CharField(blank=True, max_length=500, null=True)),
                ('Family_Name', models.CharField(blank=True, max_length=200, null=True)),
                ('Family_Relationship', models.CharField(blank=True, max_length=200, null=True)),
                ('Family_Phone_Number', models.CharField(blank=True, max_length=200, null=True)),
                ('candidate_id', models.CharField(blank=True, db_index=True, default=None, max_length=20, null=True, unique=True)),
                ('applied_position', models.CharField(blank=True, max_length=200, null=True)),
                ('candidate_source', models.CharField(blank=True, max_length=100, null=True)),
                ('recruiter_name', models.CharField(blank=True, max_length=150, null=True)),
                ('expected_joining_date', models.DateField(blank=True, null=True)),
                ('candidate_status', models.CharField(blank=True, default='APPLIED', max_length=50)),
                ('same_as_current_address', models.BooleanField(default=False)),
                ('application_submitted', models.BooleanField(default=False)),
                ('application_submitted_at', models.DateTimeField(blank=True, null=True)),
                ('Current_Notice_Period', models.CharField(blank=True, max_length=100, null=True)),
                ('resume', models.FileField(blank=True, null=True, upload_to='candidate_documents/resumes/')),
                ('aadhaar_id_proof', models.FileField(blank=True, null=True, upload_to='candidate_documents/id_proof/')),
                ('pan_card', models.FileField(blank=True, null=True, upload_to='candidate_documents/pan/')),
                ('address_proof', models.FileField(blank=True, null=True, upload_to='candidate_documents/address_proof/')),
                ('passport_photo', models.ImageField(blank=True, null=True, upload_to='candidate_documents/passport_photos/')),
                ('educational_certificates', models.FileField(blank=True, null=True, upload_to='candidate_documents/education/')),
                ('key_certifications', models.TextField(blank=True, null=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employees', to='Company.company_details')),
                ('department', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='employees', to='Employee.department')),
                ('work_week', models.ManyToManyField(blank=True, to='Employee.dayoff')),
                ('extra_off', models.ManyToManyField(blank=True, to='Employee.extraoff')),
            ],
            options={
                'verbose_name': 'User',
                'verbose_name_plural': 'Users',
            },
        ),
        migrations.CreateModel(
            name='EmployeeDocument',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('document_type', models.CharField(choices=[('AADHAAR', 'Aadhaar / ID Proof'), ('PAN', 'PAN Card'), ('RESUME', 'Resume'), ('ADDRESS_PROOF', 'Address Proof'), ('PASSPORT_PHOTO', 'Passport Photo'), ('EDUCATION', 'Educational Certificate'), ('EXPERIENCE', 'Experience / Relieving Letter'), ('BANK', 'Cancelled Cheque / Bank Proof'), ('OFFER_LETTER', 'Offer Letter'), ('APPOINTMENT_LETTER', 'Appointment Letter'), ('SALARY_SLIP', 'Salary Slip'), ('PF', 'PF Document'), ('ESIC', 'ESIC Document'), ('BGV', 'Background Verification'), ('OTHER', 'Other')], db_index=True, max_length=50)),
                ('document_name', models.CharField(help_text='Human-readable document name, e.g. Rahul Aadhaar Card', max_length=255)),
                ('file', models.FileField(upload_to=Employee.models.employee_document_upload_path)),
                ('is_verified', models.BooleanField(default=False)),
                ('verified_by', models.CharField(blank=True, max_length=200, null=True)),
                ('verified_at', models.DateTimeField(blank=True, null=True)),
                ('expiry_date', models.DateField(blank=True, null=True)),
                ('remarks', models.TextField(blank=True, null=True)),
                ('uploaded_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employee_documents', to='Company.company_details')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='documents', to='Employee.employeedt')),
            ],
            options={
                'ordering': ['-uploaded_at'],
            },
        ),
        migrations.CreateModel(
            name='DailyTask',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150)),
                ('description', models.TextField(blank=True, null=True)),
                ('task_date', models.DateField()),
                ('completed', models.BooleanField(default=False)),
                ('completed_time', models.TimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='daily_tasks', to='Company.company_details')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='daily_tasks', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='CandidateExperience',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('company_name', models.CharField(blank=True, max_length=250, null=True)),
                ('designation', models.CharField(blank=True, max_length=200, null=True)),
                ('department', models.CharField(blank=True, max_length=200, null=True)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('reason_for_leaving', models.TextField(blank=True, null=True)),
                ('previous_ctc', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('reporting_manager', models.CharField(blank=True, max_length=200, null=True)),
                ('reporting_role', models.CharField(blank=True, max_length=200, null=True)),
                ('core_responsibilities', models.TextField(blank=True, null=True)),
                ('experience_reliving_proof', models.FileField(blank=True, null=True, upload_to='candidate_documents/experience/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='professional_experience', to='Employee.employeedt')),
            ],
            options={
                'ordering': ['-start_date', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='CandidateEducation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('highest_qualification', models.CharField(blank=True, max_length=200, null=True)),
                ('degree_course', models.CharField(blank=True, max_length=200, null=True)),
                ('specialization_branch', models.CharField(blank=True, max_length=200, null=True)),
                ('university_board', models.CharField(blank=True, max_length=250, null=True)),
                ('college_institute', models.CharField(blank=True, max_length=250, null=True)),
                ('passing_year', models.PositiveIntegerField(blank=True, null=True)),
                ('percentage_cgpa', models.CharField(blank=True, max_length=50, null=True)),
                ('key_certifications', models.TextField(blank=True, null=True)),
                ('degree_certificate', models.FileField(blank=True, null=True, upload_to='candidate_documents/degree_certificates/')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='educational_history', to='Employee.employeedt')),
            ],
            options={
                'ordering': ['-passing_year', '-created_at'],
            },
        ),
        migrations.CreateModel(
            name='CandidateCompensation',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('current_annual_ctc', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('expected_annual_ctc', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('offered_annual_ctc', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('basic_salary', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('hra', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('special_allowance', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('provident_fund', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('esic', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('professional_tax', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('gross_salary', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('net_in_hand_salary', models.DecimalField(blank=True, decimal_places=2, max_digits=14, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='compensation_package', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='CandidateBGV',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('previous_employment_verification', models.CharField(blank=True, max_length=100, null=True)),
                ('education_verification', models.CharField(blank=True, max_length=100, null=True)),
                ('address_verification', models.CharField(blank=True, max_length=100, null=True)),
                ('identity_verification', models.CharField(blank=True, max_length=100, null=True)),
                ('assigned_verification_agency', models.CharField(blank=True, max_length=250, null=True)),
                ('supporting_bgv_dossier', models.FileField(blank=True, null=True, upload_to='candidate_documents/bgv/')),
                ('remarks', models.TextField(blank=True, null=True)),
                ('verified_at', models.DateTimeField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='bgv', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='Candidate',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('candidate_id', models.CharField(blank=True, default='', max_length=30, unique=True)),
                ('name', models.CharField(max_length=150)),
                ('email', models.EmailField(max_length=254)),
                ('phone', models.CharField(blank=True, default='', max_length=20)),
                ('applied_position', models.CharField(blank=True, default='', max_length=200)),
                ('candidate_source', models.CharField(blank=True, default='', max_length=100)),
                ('recruiter_name', models.CharField(blank=True, default='', max_length=150)),
                ('candidate_status', models.CharField(choices=[('APPLIED', 'Applied'), ('SHORTLISTED', 'Shortlisted'), ('INTERVIEW', 'Interview'), ('SELECTED', 'Selected'), ('OFFERED', 'Offered'), ('REJECTED', 'Rejected'), ('HIRED', 'Hired')], db_index=True, default='APPLIED', max_length=20)),
                ('resume', models.FileField(blank=True, null=True, upload_to='candidate_resumes/')),
                ('notes', models.TextField(blank=True, default='')),
                ('is_active', models.BooleanField(default=True)),
                ('converted_to_employee', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='superadmin_candidates', to='Company.company_details')),
                ('converted_employee', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='converted_candidate_records', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='BankAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bank_name', models.CharField(max_length=100)),
                ('account_number', models.CharField(db_index=True, max_length=50)),
                ('ifsc_code', models.CharField(max_length=15)),
                ('account_type', models.CharField(blank=True, choices=[('SAVINGS', 'Savings'), ('CURRENT', 'Current')], max_length=20, null=True)),
                ('account_holder_name', models.CharField(blank=True, max_length=200, null=True)),
                ('branch_name', models.CharField(blank=True, max_length=200, null=True)),
                ('cancelled_cheque', models.FileField(blank=True, null=True, upload_to='candidate_documents/bank_proof/')),
                ('is_verified', models.BooleanField(default=False)),
                ('active', models.BooleanField(default=True)),
                ('upi_id', models.CharField(blank=True, help_text='Payee UPI ID', max_length=100, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('deactivated_at', models.DateTimeField(blank=True, null=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bank_accounts', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeeRole',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role_name', models.CharField(max_length=100)),
                ('role_code', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('can_view_dashboard', models.BooleanField(default=True)),
                ('can_view_employees', models.BooleanField(default=True)),
                ('can_create_employees', models.BooleanField(default=False)),
                ('can_edit_employees', models.BooleanField(default=False)),
                ('can_delete_employees', models.BooleanField(default=False)),
                ('can_manage_employees', models.BooleanField(default=False)),
                ('can_view_attendance', models.BooleanField(default=False)),
                ('can_create_attendance', models.BooleanField(default=False)),
                ('can_edit_attendance', models.BooleanField(default=False)),
                ('can_delete_attendance', models.BooleanField(default=False)),
                ('can_manage_attendance', models.BooleanField(default=False)),
                ('can_view_payroll', models.BooleanField(default=False)),
                ('can_create_payroll', models.BooleanField(default=False)),
                ('can_edit_payroll', models.BooleanField(default=False)),
                ('can_delete_payroll', models.BooleanField(default=False)),
                ('can_manage_payroll', models.BooleanField(default=False)),
                ('can_view_leave', models.BooleanField(default=False)),
                ('can_create_leave', models.BooleanField(default=False)),
                ('can_approve_leave', models.BooleanField(default=False)),
                ('can_manage_leave', models.BooleanField(default=False)),
                ('can_view_performance', models.BooleanField(default=False)),
                ('can_create_performance', models.BooleanField(default=False)),
                ('can_edit_performance', models.BooleanField(default=False)),
                ('can_delete_performance', models.BooleanField(default=False)),
                ('can_manage_performance', models.BooleanField(default=False)),
                ('can_view_expense', models.BooleanField(default=False)),
                ('can_create_expense', models.BooleanField(default=False)),
                ('can_edit_expense', models.BooleanField(default=False)),
                ('can_delete_expense', models.BooleanField(default=False)),
                ('can_manage_expense', models.BooleanField(default=False)),
                ('can_view_invoice', models.BooleanField(default=False)),
                ('can_create_invoice', models.BooleanField(default=False)),
                ('can_edit_invoice', models.BooleanField(default=False)),
                ('can_delete_invoice', models.BooleanField(default=False)),
                ('can_manage_invoice', models.BooleanField(default=False)),
                ('can_view_bank', models.BooleanField(default=False)),
                ('can_manage_bank', models.BooleanField(default=False)),
                ('can_view_reports', models.BooleanField(default=True)),
                ('can_manage_reports', models.BooleanField(default=False)),
                ('can_view_devices', models.BooleanField(default=False)),
                ('can_create_devices', models.BooleanField(default=False)),
                ('can_edit_devices', models.BooleanField(default=False)),
                ('can_delete_devices', models.BooleanField(default=False)),
                ('can_manage_devices', models.BooleanField(default=False)),
                ('can_view_company', models.BooleanField(default=False)),
                ('can_edit_company', models.BooleanField(default=False)),
                ('can_manage_company', models.BooleanField(default=False)),
                ('can_view_insurance', models.BooleanField(default=False)),
                ('can_create_insurance', models.BooleanField(default=False)),
                ('can_edit_insurance', models.BooleanField(default=False)),
                ('can_delete_insurance', models.BooleanField(default=False)),
                ('can_approve_insurance', models.BooleanField(default=False)),
                ('can_manage_insurance', models.BooleanField(default=False)),
                ('can_view_roles', models.BooleanField(default=False)),
                ('can_create_roles', models.BooleanField(default=False)),
                ('can_edit_roles', models.BooleanField(default=False)),
                ('can_delete_roles', models.BooleanField(default=False)),
                ('can_manage_roles', models.BooleanField(default=False)),
                ('can_view_recruitment', models.BooleanField(default=False)),
                ('can_create_recruitment', models.BooleanField(default=False)),
                ('can_edit_recruitment', models.BooleanField(default=False)),
                ('can_delete_recruitment', models.BooleanField(default=False)),
                ('can_manage_recruitment', models.BooleanField(default=False)),
                ('can_view_training', models.BooleanField(default=False)),
                ('can_create_training', models.BooleanField(default=False)),
                ('can_edit_training', models.BooleanField(default=False)),
                ('can_delete_training', models.BooleanField(default=False)),
                ('can_manage_training', models.BooleanField(default=False)),
                ('can_view_communication', models.BooleanField(default=False)),
                ('can_create_communication', models.BooleanField(default=False)),
                ('can_edit_communication', models.BooleanField(default=False)),
                ('can_delete_communication', models.BooleanField(default=False)),
                ('can_manage_communication', models.BooleanField(default=False)),
                ('can_view_timesheet', models.BooleanField(default=False)),
                ('can_create_timesheet', models.BooleanField(default=False)),
                ('can_edit_timesheet', models.BooleanField(default=False)),
                ('can_delete_timesheet', models.BooleanField(default=False)),
                ('can_manage_timesheet', models.BooleanField(default=False)),
                ('can_view_relations', models.BooleanField(default=False)),
                ('can_create_relations', models.BooleanField(default=False)),
                ('can_edit_relations', models.BooleanField(default=False)),
                ('can_delete_relations', models.BooleanField(default=False)),
                ('can_manage_relations', models.BooleanField(default=False)),
                ('can_view_compliance', models.BooleanField(default=False)),
                ('can_create_compliance', models.BooleanField(default=False)),
                ('can_edit_compliance', models.BooleanField(default=False)),
                ('can_delete_compliance', models.BooleanField(default=False)),
                ('can_manage_compliance', models.BooleanField(default=False)),
                ('can_use_ai', models.BooleanField(default=False)),
                ('can_use_mobile_app', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='employee_roles', to='Company.company_details')),
            ],
        ),
        migrations.CreateModel(
            name='EmployeeAccount',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_login_enabled', models.BooleanField(default=True)),
                ('is_verified', models.BooleanField(default=False)),
                ('last_login', models.DateTimeField(blank=True, null=True)),
                ('failed_login_attempts', models.PositiveIntegerField(default=0)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('employee', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='account', to='Employee.employeedt')),
                ('role', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='employee_accounts', to='Employee.employeerole')),
            ],
        ),
        migrations.CreateModel(
            name='LeaveBalance',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('Employee_ID', models.CharField(db_index=True, max_length=100)),
                ('leave_type', models.CharField(choices=[('Paid Leave', 'Paid Leave'), ('Sick Leave', 'Sick Leave'), ('Casual Leave', 'Casual Leave'), ('Unpaid Leave', 'Unpaid Leave')], max_length=20)),
                ('financial_year', models.CharField(help_text='e.g. 2026-27 (April - March)', max_length=7)),
                ('allocated', models.DecimalField(decimal_places=1, default=Decimal('0'), max_digits=6)),
                ('carried_forward', models.DecimalField(decimal_places=1, default=Decimal('0'), max_digits=6)),
                ('adjustment', models.DecimalField(decimal_places=1, default=Decimal('0'), help_text='Manual +/- correction by HR', max_digits=6)),
                ('remarks', models.TextField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_balances', to='Company.company_details')),
            ],
            options={
                'ordering': ['Employee_ID', 'leave_type'],
            },
        ),
        migrations.CreateModel(
            name='LeavePolicy',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('leave_type', models.CharField(choices=[('Paid Leave', 'Paid Leave'), ('Sick Leave', 'Sick Leave'), ('Casual Leave', 'Casual Leave'), ('Unpaid Leave', 'Unpaid Leave')], max_length=20)),
                ('code', models.CharField(blank=True, default='', help_text='Short code shown in the UI, e.g. PL / CL / SL', max_length=10)),
                ('title', models.CharField(blank=True, default='', max_length=150)),
                ('description', models.TextField(blank=True, default='')),
                ('annual_quota', models.DecimalField(blank=True, decimal_places=1, help_text='Days per financial year. Empty = unlimited (e.g. unpaid)', max_digits=6, null=True)),
                ('accrual_per_month', models.DecimalField(blank=True, decimal_places=2, help_text='Credited per completed month of service (e.g. 1.5 for PL)', max_digits=4, null=True)),
                ('carry_forward', models.BooleanField(default=False)),
                ('max_carry_forward_days', models.DecimalField(decimal_places=1, default=Decimal('0'), max_digits=6)),
                ('encashable', models.BooleanField(default=False)),
                ('max_encashable_days', models.DecimalField(decimal_places=1, default=Decimal('0'), help_text='Maximum days encashable upon separation', max_digits=6)),
                ('medical_certificate_after_days', models.PositiveIntegerField(blank=True, help_text='Medical certificate mandatory for absences longer than N consecutive working days', null=True)),
                ('min_notice_hours', models.PositiveIntegerField(default=0)),
                ('is_paid', models.BooleanField(default=True)),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_policies', to='Company.company_details')),
            ],
            options={
                'ordering': ['id'],
            },
        ),
        migrations.CreateModel(
            name='LeaveRequest',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Employee_ID', models.CharField(db_index=True, max_length=100)),
                ('Name', models.CharField(blank=True, help_text='Employee name snapshot at the time of the request', max_length=100, null=True)),
                ('leave_type', models.CharField(choices=[('Paid Leave', 'Paid Leave'), ('Sick Leave', 'Sick Leave'), ('Casual Leave', 'Casual Leave'), ('Unpaid Leave', 'Unpaid Leave')], default='Casual Leave', max_length=20)),
                ('from_date', models.DateField()),
                ('to_date', models.DateField()),
                ('total_days', models.DecimalField(decimal_places=1, default=Decimal('0'), help_text='Working days in the range (Sundays and company holidays excluded)', max_digits=5)),
                ('reason', models.TextField(blank=True, null=True)),
                ('status', models.CharField(choices=[('Pending', 'Pending'), ('Approved', 'Approved'), ('Rejected', 'Rejected'), ('Cancelled', 'Cancelled')], db_index=True, default='Pending', max_length=10)),
                ('reviewed_by', models.CharField(blank=True, max_length=150, null=True)),
                ('reviewed_at', models.DateTimeField(blank=True, null=True)),
                ('review_comment', models.TextField(blank=True, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='leave_requests', to='Company.company_details')),
            ],
            options={
                'ordering': ['-created_at', '-id'],
            },
        ),
        migrations.CreateModel(
            name='Message',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sender_emp_id', models.CharField(blank=True, max_length=50, null=True)),
                ('reciver_emp_id', models.CharField(blank=True, max_length=50, null=True)),
                ('content', models.TextField()),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('msg_status', models.BooleanField(blank=True, default=False, null=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='Company.company_details')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='messages', to='Employee.employeedt')),
            ],
        ),
        migrations.CreateModel(
            name='Payroll',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Employee_ID', models.CharField(blank=True, max_length=100, null=True)),
                ('name', models.CharField(blank=True, max_length=100, null=True)),
                ('month', models.IntegerField()),
                ('year', models.IntegerField()),
                ('basic_salary', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('present_days', models.IntegerField(default=0)),
                ('half_days', models.IntegerField(default=0)),
                ('overtime_hours', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=5)),
                ('full_day_salary', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('half_day_salary', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('overtime_pay', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('gross_salary', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('total_deductions', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('net_salary', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('PF_deduction', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=10, null=True)),
                ('TDS_deduction', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=10, null=True)),
                ('ESI_deduction', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=10, null=True)),
                ('insurance_deduction', models.DecimalField(blank=True, decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('total_working_hr', models.DecimalField(decimal_places=2, default=Decimal('0.00'), max_digits=10)),
                ('status', models.CharField(blank=True, choices=[('Paid', 'Paid'), ('Unpaid', 'Unpaid')], default='Unpaid', max_length=90, null=True)),
                ('payment_method', models.CharField(choices=[('BANK', 'Bank Transfer'), ('UPI', 'UPI'), ('CASH', 'Cash'), ('CHEQUE', 'Cheque'), ('WALLET', 'Wallet')], default='BANK', max_length=10)),
                ('upi_id', models.CharField(blank=True, help_text='Payee UPI ID', max_length=100, null=True)),
                ('upi_txn_id', models.CharField(blank=True, help_text='Gateway transaction/UTR', max_length=100, null=True)),
                ('payment_account_json', models.JSONField(blank=True, help_text='Method-specific payment meta', null=True)),
                ('payment_date', models.DateField(blank=True, null=True)),
                ('amount_paid', models.DecimalField(blank=True, decimal_places=2, max_digits=10, null=True)),
                ('created_by', models.CharField(blank=True, help_text='Who created this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, help_text='Who last updated this record (e.g. admin:<id> / employee:<id>)', max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1, help_text='Record version counter')),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='payrolls', to='Company.company_details')),
            ],
        ),
        migrations.CreateModel(
            name='PerfAppraisal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('created_by', models.CharField(blank=True, max_length=150, null=True)),
                ('updated_by', models.CharField(blank=True, max_length=150, null=True)),
                ('id_version', models.PositiveIntegerField(default=1)),
                ('financial_year', models.CharField(blank=True, default='', max_length=9)),
                ('self_score', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
                ('manager_score', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
                ('normalized_rating', models.DecimalField(blank=True, decimal_places=1, max_digits=3, null=True)),
                ('is_calibrated', models.BooleanField(default=False, help_text='True once HR set normalized_rating by hand (calibration)')),
                ('rating_label_override', models.CharField(blank=True, default='', max_length=60)),
                ('potential', models.CharField(blank=True, choices=[('Low', 'Low'), ('Medium', 'Medium'), ('High', 'High')], default='', help_text="9-box potential axis. High = 'High Potential Talent' card", max_length=6)),
                ('nine_box_position', models.CharField(blank=True, default='', max_length=60)),
                ('promotion_proposed', models.BooleanField(default=False)),
                ('proposed_level', models.CharField(blank=True, default='', max_length=30)),
                ('reviewer_code', models.CharField(blank=True, default='', help_text='employee_code of the manager who reviews', max_length=100)),
                ('manager_comments', models.TextField(blank=True, default='')),
                ('hr_comments', models.TextField(blank=True, default='')),
                ('status', models.CharField(choices=[('Pending Self Review', 'Pending Self Review'), ('Pending Manager Review', 'Pending Manager Review'), ('Calibration', 'Calibration'), ('Completed', 'Completed')], db_index=True, default='Pending Self Review', max_length=24)),
                ('completed_at', models.DateTimeField(blank=True, null=True)),
                ('is_active', models.BooleanField(default=True)),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='perf_appraisals', to='Company.company_details')),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='perf_appraisals', to='Employee.employeedt')),
            ],
            options={
                'ordering': ['-id'],
            },
        ),
    ]
