package com.sikey.wa04.business.infrastructure.repository;

import com.sikey.wa04.business.infrastructure.dto.model.GroupMemberModel;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GroupMemberRepository extends JpaRepository<GroupMemberModel, Long> {
    List<GroupMemberModel> findByGroupId(@Size(max = 36) String groupId);

    void deleteByGroupIdAndRefId(@Size(max = 36) String groupId, @Size(max = 36) @NotNull String refId);

    void deleteByGroupId(String groupId);

    void deleteByGroupIdInAndRefId(List<String> groupIds, String refId);

    void deleteByGroupIdIn(List<String> groupIds);
}


