diff --git a/backend/src/main/java/com/festago/school/repository/SchoolRepository.java b/backend/src/main/java/com/festago/school/repository/SchoolRepository.java index a1cb30ef3..0895f8201 100644 --- a/backend/src/main/java/com/festago/school/repository/SchoolRepository.java +++ b/backend/src/main/java/com/festago/school/repository/SchoolRepository.java @@ -8,22 +8,22 @@ public interface SchoolRepository extends Repository { - default School getOrThrow(Long schoolId) { - return findById(schoolId) - .orElseThrow(() -> new NotFoundException(ErrorCode.SCHOOL_NOT_FOUND)); - } - School save(School school); Optional findById(Long id); void deleteById(Long id); + boolean existsById(Long id); + + default School getOrThrow(Long schoolId) { + return findById(schoolId) + .orElseThrow(() -> new NotFoundException(ErrorCode.SCHOOL_NOT_FOUND)); + } + boolean existsByDomain(String domain); boolean existsByName(String name); Optional findByName(String name); - - boolean existsById(Long id); }