<?php

declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20260304170000 extends AbstractMigration
{
    public function getDescription(): string
    {
        return 'Add comments on employee_leave_balances table and columns';
    }

    public function up(Schema $schema): void
    {
        $this->addSql("COMMENT ON TABLE employee_leave_balances IS 'Soldes de conges par employe et exercice (ouverture, mouvements, cloture).'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.rule_code IS 'Code de regle de calcul des conges (CDI_CDD_NON_FORFAIT, FORFAIT_218, ...).'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.year IS 'Annee d exercice de reference (ex: 2026).'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.opening_days IS 'Report N-1 en jours a l ouverture de l exercice.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.opening_saturdays IS 'Report N-1 en samedis a l ouverture (0 pour forfait).'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.accrued_days IS 'Droits jours acquis sur l exercice courant.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.accrued_saturdays IS 'Droits samedis acquis sur l exercice courant.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.taken_days IS 'Jours de conges consommes sur l exercice.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.taken_saturdays IS 'Samedis consommes sur l exercice.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.closing_days IS 'Solde de cloture jours sur l exercice.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.closing_saturdays IS 'Solde de cloture samedis sur l exercice.'");
        $this->addSql("COMMENT ON COLUMN employee_leave_balances.is_locked IS 'Indique si le solde de l exercice est fige (verrouille RH).'");
    }

    public function down(Schema $schema): void
    {
        $this->addSql('COMMENT ON TABLE employee_leave_balances IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.rule_code IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.year IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.opening_days IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.opening_saturdays IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.accrued_days IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.accrued_saturdays IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.taken_days IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.taken_saturdays IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.closing_days IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.closing_saturdays IS NULL');
        $this->addSql('COMMENT ON COLUMN employee_leave_balances.is_locked IS NULL');
    }
}
