package de.cannamanage.service.repository;

import de.cannamanage.domain.entity.Member;
import de.cannamanage.domain.enums.MemberStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

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

@Repository
public interface MemberRepository extends JpaRepository<Member, UUID> {

    long countByTenantId(UUID tenantId);

    long countByTenantIdAndStatus(UUID tenantId, MemberStatus status);

    /**
     * Find all members for a tenant, optionally filtered by status.
     */
    List<Member> findByTenantIdAndStatus(UUID tenantId, MemberStatus status);

    /**
     * Find all members for a tenant (all statuses).
     */
    List<Member> findByTenantId(UUID tenantId);

    /**
     * Find all under-21 members for a tenant.
     */
    List<Member> findByTenantIdAndUnder21True(UUID tenantId);
}
