Skip to content
This repository has been archived by the owner on Dec 7, 2024. It is now read-only.

πŸ”€ :: exist by club condition μΆ”κ°€ #344

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import java.time.LocalDate

interface CustomScheduleRepository {
fun queryByDate(club: Club, date: LocalDate?): Schedule?
fun existByDateAndPeriods(date: LocalDate, period: List<Period>): Boolean
fun existByDateAndPeriodsAndClub(date: LocalDate, period: List<Period>, club: Club): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CreateScheduleServiceImpl(

scheduleRepository.save(schedule)

if(scheduleRepository.existByDateAndPeriods(dto.schedule.date, dto.period))
if(scheduleRepository.existByDateAndPeriodsAndClub(dto.schedule.date, dto.period, club))
throw AlreadyScheduleExistException()

val attendances = dto.period.flatMap { period ->
Expand Down
Loading