package dev.lions.unionflow.server.repository;

import dev.lions.unionflow.server.entity.FormationLbcFt;
import io.quarkus.hibernate.orm.panache.PanacheRepositoryBase;
import jakarta.enterprise.context.ApplicationScoped;
import java.util.List;
import java.util.UUID;

/** Repository des sessions de formation LBC/FT. */
@ApplicationScoped
public class FormationLbcFtRepository implements PanacheRepositoryBase<FormationLbcFt, UUID> {

  public List<FormationLbcFt> findByOrganisationAndAnnee(UUID organisationId, int annee) {
    return list("organisationId = ?1 AND anneeReference = ?2 ORDER BY dateSession DESC",
        organisationId, annee);
  }

  public List<FormationLbcFt> findATenir(UUID organisationId) {
    return list("organisationId = ?1 AND statut = 'PLANIFIEE' ORDER BY dateSession", organisationId);
  }
}
