'Soldes RTT par employe et exercice (report N-1).'])] #[ORM\UniqueConstraint(name: 'uniq_employee_rtt_balance', columns: ['employee_id', 'year'])] #[ORM\Index(columns: ['employee_id', 'year'], name: 'idx_rtt_balance_employee_year')] class EmployeeRttBalance { #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private ?int $id = null; #[ORM\ManyToOne(targetEntity: Employee::class)] #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')] private ?Employee $employee = null; #[ORM\Column(type: 'integer', options: ['comment' => 'Annee d exercice (year = annee de fin, ex: 2026 = 01/06/2025 -> 31/05/2026).'])] private int $year = 0; #[ORM\Column(type: 'integer', options: ['comment' => 'Report N-1 en minutes (solde d ouverture).'])] private int $openingMinutes = 0; #[ORM\Column(type: 'boolean', options: ['default' => false, 'comment' => 'Indique si le solde est fige (verrouille RH).'])] private bool $isLocked = false; #[ORM\Column(type: 'datetime_immutable')] private DateTimeImmutable $createdAt; #[ORM\Column(type: 'datetime_immutable')] private DateTimeImmutable $updatedAt; public function __construct() { $now = new DateTimeImmutable(); $this->createdAt = $now; $this->updatedAt = $now; } public function getId(): ?int { return $this->id; } public function getEmployee(): ?Employee { return $this->employee; } public function setEmployee(Employee $employee): self { $this->employee = $employee; return $this; } public function getYear(): int { return $this->year; } public function setYear(int $year): self { $this->year = $year; return $this; } public function getOpeningMinutes(): int { return $this->openingMinutes; } public function setOpeningMinutes(int $openingMinutes): self { $this->openingMinutes = $openingMinutes; return $this; } public function isLocked(): bool { return $this->isLocked; } public function setIsLocked(bool $isLocked): self { $this->isLocked = $isLocked; return $this; } public function getCreatedAt(): DateTimeImmutable { return $this->createdAt; } public function getUpdatedAt(): DateTimeImmutable { return $this->updatedAt; } public function touch(): self { $this->updatedAt = new DateTimeImmutable(); return $this; } }