package de.cannamanage.service.repository;

import de.cannamanage.domain.entity.StaffAccount;
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 StaffAccountRepository extends JpaRepository<StaffAccount, UUID> {

    Optional<StaffAccount> findByUserId(UUID userId);

    List<StaffAccount> findByTenantIdAndActiveTrue(UUID tenantId);

    List<StaffAccount> findByTenantIdAndPreventionOfficerTrue(UUID tenantId);

    long countByTenantIdAndPreventionOfficerTrueAndActiveTrue(UUID tenantId);

    boolean existsByUserId(UUID userId);

    long countByTenantId(UUID tenantId);

    long countByTenantIdAndActiveTrue(UUID tenantId);

    long countByTenantIdAndPreventionOfficerTrue(UUID tenantId);
}
