
package cn.novalon.gym.manage.groupcourse.repository;

import cn.novalon.gym.manage.common.dto.PageRequest;
import cn.novalon.gym.manage.common.dto.PageResponse;
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
import cn.novalon.gym.manage.groupcourse.dto.GroupCourseQueryDto;
import org.springframework.data.domain.Sort;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

public interface IGroupCourseRepository {
    Mono<GroupCourse> findByIdAndDeletedAtIsNull(Long id);
    Flux<GroupCourse> findAll();
    Flux<GroupCourse> findAll(Sort sort);
    Flux<GroupCourse> findByDeletedAtIsNull();
    Flux<GroupCourse> findByDeletedAtIsNull(Sort sort);
    
    Mono<PageResponse<GroupCourse>> findByPage(PageRequest pageRequest);
    Mono<PageResponse<GroupCourse>> findByPageAndNotDeleted(PageRequest pageRequest);
    
    Mono<GroupCourse> save(GroupCourse groupCourse);
    
    Mono<GroupCourse> update(GroupCourse groupCourse);
    
    Mono<GroupCourse> cancel(Long id);
    
    Mono<Void> deleteById(Long id);
    
    Mono<GroupCourse> updateCurrentMembers(Long id, Integer delta);
    
    Flux<GroupCourse> findByCourseType(Long courseType);

    Mono<PageResponse<GroupCourse>> searchGroupCourses(GroupCourseQueryDto query);
}
