package net.siegeln.cameleer.saas.license;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

@Repository
public interface LicenseRepository extends JpaRepository<LicenseEntity, UUID> {
    List<LicenseEntity> findByTenantIdOrderByCreatedAtDesc(UUID tenantId);
    Optional<LicenseEntity> findFirstByTenantIdAndRevokedAtIsNullOrderByCreatedAtDesc(UUID tenantId);
    Optional<LicenseEntity> findByToken(String token);
}
