From 063dfc562efeb9f78e26a9a96f22c9c593c62a73 Mon Sep 17 00:00:00 2001 From: KimBeomJin Date: Sun, 26 Feb 2023 15:02:09 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20(#271)=20dms-application=20detekt?= =?UTF-8?q?=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 5 +- build.gradle.kts | 13 + buildSrc/src/main/kotlin/PluginVersions.kt | 1 + dms-application/config/detekt/detekt.yml | 809 ++++++++++++++++++ .../dms/common/annotation/ReadOnlyUseCase.kt | 2 +- .../aliens/dms/common/annotation/UseCase.kt | 2 +- .../team/aliens/dms/common/dto/PageData.kt | 9 +- .../common/extension/LocalDateExtension.kt | 5 +- .../aliens/dms/common/spi/SecurityPort.kt | 3 +- .../team/aliens/dms/common/util/StringUtil.kt | 10 +- .../auth/dto/CertifyEmailCodeRequest.kt | 2 +- .../domain/auth/dto/CertifyEmailRequest.kt | 2 +- .../dms/domain/auth/dto/ReissueResponse.kt | 2 +- .../domain/auth/dto/SendEmailCodeRequest.kt | 2 +- .../dms/domain/auth/dto/SignInRequest.kt | 2 +- .../dms/domain/auth/dto/SignInResponse.kt | 2 +- .../AuthCodeLimitNotFoundException.kt | 2 +- .../exception/AuthCodeNotFoundException.kt | 4 +- .../EmailAlreadyCertifiedException.kt | 2 +- .../auth/exception/EmailMismatchException.kt | 4 +- .../exception/PasswordMismatchException.kt | 4 +- .../RefreshTokenNotFoundException.kt | 4 +- .../dms/domain/auth/spi/AuthCodeLimitPort.kt | 3 +- .../dms/domain/auth/spi/AuthCodePort.kt | 5 +- .../domain/auth/spi/AuthQuerySchoolPort.kt | 1 - .../domain/auth/spi/AuthQueryStudentPort.kt | 3 +- .../dms/domain/auth/spi/AuthQueryUserPort.kt | 3 +- .../dms/domain/auth/spi/AuthSecurityPort.kt | 3 +- .../auth/spi/CommandAuthCodeLimitPort.kt | 3 +- .../domain/auth/spi/CommandAuthCodePort.kt | 3 +- .../aliens/dms/domain/auth/spi/JwtPort.kt | 3 +- .../domain/auth/spi/QueryAuthCodeLimitPort.kt | 3 +- .../dms/domain/auth/spi/QueryAuthCodePort.kt | 3 +- .../domain/auth/spi/QueryRefreshTokenPort.kt | 3 +- .../dms/domain/auth/spi/RefreshTokenPort.kt | 3 +- .../dms/domain/auth/spi/SendEmailPort.kt | 3 +- .../auth/usecase/CertifyEmailCodeUseCase.kt | 7 +- .../auth/usecase/CertifyEmailUseCase.kt | 4 +- .../usecase/CheckAccountIdExistenceUseCase.kt | 6 +- .../auth/usecase/ReissueTokenUseCase.kt | 13 +- .../auth/usecase/SendEmailCodeUseCase.kt | 8 +- .../dms/domain/auth/usecase/SignInUseCase.kt | 8 +- .../exception/FileIOInterruptedException.kt | 4 +- .../FileInvalidExtensionException.kt | 4 +- .../dms/domain/file/spi/ParseFilePort.kt | 2 +- .../dms/domain/file/spi/UploadFilePort.kt | 3 +- .../dms/domain/file/spi/WriteFilePort.kt | 2 +- .../usecase/ImportVerifiedStudentUseCase.kt | 6 +- .../domain/file/usecase/UploadFileUseCase.kt | 4 +- .../manager/dto/GetStudentDetailsResponse.kt | 2 +- .../manager/dto/ManagerMyPageResponse.kt | 2 +- .../dms/domain/manager/dto/PointFilter.kt | 4 +- .../dms/domain/manager/dto/PointFilterType.kt | 2 +- .../manager/dto/QueryStudentsResponse.kt | 2 +- .../aliens/dms/domain/manager/dto/Sort.kt | 2 +- .../exception/ManagerInfoMismatchException.kt | 4 +- .../exception/ManagerNotFoundException.kt | 4 +- .../manager/spi/ManagerCommandStudentPort.kt | 8 + .../manager/spi/ManagerCommandUserPort.kt | 3 +- .../dms/domain/manager/spi/ManagerPort.kt | 3 +- .../manager/spi/ManagerQueryAuthCodePort.kt | 3 +- .../spi/ManagerQueryPointHistoryPort.kt | 3 +- .../manager/spi/ManagerQuerySchoolPort.kt | 3 +- .../manager/spi/ManagerQueryStudentPort.kt | 1 - .../manager/spi/ManagerQueryUserPort.kt | 3 +- .../domain/manager/spi/ManagerSecurityPort.kt | 3 +- .../domain/manager/spi/QueryManagerPort.kt | 3 +- .../usecase/FindManagerAccountIdUseCase.kt | 2 +- .../manager/usecase/ManagerMyPageUseCase.kt | 2 +- .../usecase/QueryStudentDetailsUseCase.kt | 8 +- .../manager/usecase/QueryStudentsUseCase.kt | 12 +- .../manager/usecase/RemoveStudentUseCase.kt | 20 +- .../usecase/ResetManagerPasswordUseCase.kt | 7 +- .../dms/domain/meal/dto/QueryMealsResponse.kt | 2 +- .../aliens/dms/domain/meal/spi/MealPort.kt | 3 +- .../domain/meal/spi/MealQueryStudentPort.kt | 3 +- .../dms/domain/meal/spi/MealSecurityPort.kt | 3 +- .../dms/domain/meal/spi/QueryMealPort.kt | 3 +- .../domain/meal/usecase/QueryMealsUseCase.kt | 2 +- .../notice/exception/IsNotWriterException.kt | 2 +- .../exception/NoticeNotFoundException.kt | 2 +- .../domain/notice/spi/CommandNoticePort.kt | 3 +- .../dms/domain/notice/spi/NoticePort.kt | 3 +- .../domain/notice/spi/NoticeQueryUserPort.kt | 3 +- .../domain/notice/spi/NoticeSecurityPort.kt | 3 +- .../dms/domain/notice/spi/QueryNoticePort.kt | 1 - .../notice/usecase/CreateNoticeUseCase.kt | 2 +- .../notice/usecase/QueryAllNoticesUseCase.kt | 2 +- .../usecase/QueryNoticeDetailsUseCase.kt | 8 +- .../usecase/QueryNoticeStatusUseCase.kt | 8 +- .../notice/usecase/RemoveNoticeUseCase.kt | 2 +- .../notice/usecase/UpdateNoticeUseCase.kt | 5 +- .../dto/ExportAllPointHistoryResponse.kt | 2 +- .../point/dto/QueryAllPointHistoryResponse.kt | 2 +- .../InvalidPointFilterRangeException.kt | 2 +- .../PointOptionNameExistsException.kt | 2 +- .../exception/PointOptionNotFoundException.kt | 4 +- .../point/spi/CommandPointHistoryPort.kt | 3 +- .../point/spi/CommandPointOptionPort.kt | 2 +- .../aliens/dms/domain/point/spi/PhrasePort.kt | 3 +- .../dms/domain/point/spi/PointHistoryPort.kt | 3 +- .../dms/domain/point/spi/PointOptionPort.kt | 3 +- .../domain/point/spi/PointQueryManagerPort.kt | 2 +- .../domain/point/spi/PointQuerySchoolPort.kt | 2 +- .../domain/point/spi/PointQueryStudentPort.kt | 3 +- .../domain/point/spi/PointQueryUserPort.kt | 3 +- .../dms/domain/point/spi/PointSecurityPort.kt | 1 - .../domain/point/spi/QueryPointOptionPort.kt | 2 +- .../point/spi/StudentQueryPhrasePort.kt | 3 +- .../domain/point/spi/vo/StudentWithPointVO.kt | 5 +- .../usecase/CancelGrantedPointUseCase.kt | 11 +- .../point/usecase/CreatePointOptionUseCase.kt | 2 +- .../usecase/ExportAllPointHistoryUseCase.kt | 4 +- .../domain/point/usecase/GrantPointUseCase.kt | 5 +- .../usecase/QueryAllPointHistoryUseCase.kt | 2 +- .../point/usecase/QueryPointHistoryUseCase.kt | 2 +- .../point/usecase/QueryPointOptionsUseCase.kt | 2 +- .../QueryStudentPointHistoryUseCase.kt | 9 +- .../point/usecase/RemovePointOptionUseCase.kt | 2 +- .../point/usecase/UpdatePointOptionUseCase.kt | 11 +- ...QueryCurrentAppliedRemainOptionResponse.kt | 2 +- .../remain/dto/QueryRemainOptionsResponse.kt | 2 +- .../dms/domain/remain/dto/RemainStatusInfo.kt | 4 +- .../domain/remain/dto/StudentRemainInfo.kt | 2 +- .../dto/UpdateRemainAvailableTimeRequest.kt | 2 +- .../response/ExportRemainStatusResponse.kt | 2 +- ...emainAvailableTimeCanNotAccessException.kt | 2 +- .../RemainAvailableTimeNotFoundException.kt | 2 +- .../exception/RemainCanNotAppliedException.kt | 2 +- .../RemainOptionNotFoundException.kt | 2 +- .../remain/exception/RemainStatusNotFound.kt | 2 +- .../spi/CommandRemainAvailableTimePort.kt | 3 +- .../remain/spi/CommandRemainOptionPort.kt | 2 +- .../remain/spi/CommandRemainStatusPort.kt | 2 +- .../spi/QueryRemainAvailableTimePort.kt | 3 +- .../remain/spi/QueryRemainOptionPort.kt | 3 +- .../remain/spi/QueryRemainStatusPort.kt | 5 +- .../remain/spi/RemainAvailableTimePort.kt | 3 +- .../dms/domain/remain/spi/RemainOptionPort.kt | 3 +- .../remain/spi/RemainQuerySchoolPort.kt | 2 +- .../remain/spi/RemainQueryStudentPort.kt | 2 +- .../domain/remain/spi/RemainQueryUserPort.kt | 3 +- .../domain/remain/spi/RemainSecurityPort.kt | 2 +- .../remain/usecase/ApplyRemainUseCase.kt | 11 +- .../usecase/CreateRemainOptionUseCase.kt | 4 +- .../usecase/ExportRemainStatusUseCase.kt | 2 +- .../QueryCurrentAppliedRemainOptionUseCase.kt | 2 +- .../QueryRemainAvailableTimeUseCase.kt | 2 +- .../usecase/QueryRemainOptionsUseCase.kt | 2 +- .../usecase/RemoveRemainOptionUseCase.kt | 11 +- .../UpdateRemainAvailableTimeUseCase.kt | 2 +- .../usecase/UpdateRemainOptionUseCase.kt | 9 +- .../room/exception/RoomNotFoundException.kt | 2 +- .../aliens/dms/domain/room/spi/RoomPort.kt | 3 +- .../dms/domain/school/SchoolExtension.kt | 10 + .../exception/AnswerMismatchException.kt | 2 +- .../exception/FeatureNotFoundException.kt | 2 +- .../exception/SchoolCodeMismatchException.kt | 2 +- .../exception/SchoolMismatchException.kt | 2 +- .../exception/SchoolNotFoundException.kt | 2 +- .../domain/school/spi/CommandSchoolPort.kt | 3 +- .../dms/domain/school/spi/QuerySchoolPort.kt | 3 +- .../dms/domain/school/spi/SchoolPort.kt | 3 +- .../domain/school/spi/SchoolQueryUserPort.kt | 3 +- .../domain/school/spi/SchoolSecurityPort.kt | 3 +- .../usecase/CheckSchoolAnswerUseCase.kt | 2 +- .../school/usecase/CheckSchoolCodeUseCase.kt | 2 +- .../usecase/QuerySchoolQuestionUseCase.kt | 2 +- .../school/usecase/QuerySchoolsUseCase.kt | 2 +- .../usecase/ReissueSchoolCodeUseCase.kt | 5 +- .../school/usecase/UpdateQuestionUseCase.kt | 2 +- .../dms/domain/student/dto/SignUpRequest.kt | 2 +- .../exception/StudentInfoMismatchException.kt | 4 +- .../exception/StudentNotFoundException.kt | 4 +- .../VerifiedStudentNotFoundException.kt | 2 +- .../domain/student/spi/CommandStudentPort.kt | 2 +- .../domain/student/spi/QueryStudentPort.kt | 3 +- .../student/spi/StudentCommandUserPort.kt | 3 +- .../dms/domain/student/spi/StudentJwtPort.kt | 3 +- .../dms/domain/student/spi/StudentPort.kt | 3 +- .../student/spi/StudentQueryAuthCodePort.kt | 3 +- .../spi/StudentQueryPointHistoryPort.kt | 3 +- .../student/spi/StudentQueryRoomPort.kt | 5 +- .../student/spi/StudentQuerySchoolPort.kt | 3 +- .../student/spi/StudentQueryUserPort.kt | 3 +- .../spi/StudentQueryVerifiedStudentPort.kt | 3 +- .../domain/student/spi/StudentSecurityPort.kt | 3 +- .../domain/student/spi/VerifiedStudentPort.kt | 3 +- .../CheckDuplicatedAccountIdUseCase.kt | 4 +- .../usecase/CheckDuplicatedEmailUseCase.kt | 6 +- .../student/usecase/CheckStudentGcnUseCase.kt | 2 +- .../usecase/FindStudentAccountIdUseCase.kt | 2 +- .../usecase/ResetStudentPasswordUseCase.kt | 10 +- .../domain/student/usecase/SignUpUseCase.kt | 80 +- .../student/usecase/StudentMyPageUseCase.kt | 4 +- .../usecase/UpdateStudentProfileUseCase.kt | 2 +- .../dto/ManagerQueryStudyRoomResponse.kt | 3 +- .../dto/ManagerQueryStudyRoomsResponse.kt | 4 +- .../QueryCurrentAppliedStudyRoomResponse.kt | 2 +- .../studyroom/dto/QuerySeatTypesResponse.kt | 2 +- .../dto/StudentQueryStudyRoomResponse.kt | 2 +- .../dto/StudentQueryStudyRoomsResponse.kt | 4 +- .../exception/AppliedSeatNotFoundException.kt | 2 +- .../AvailableTimeNotFoundException.kt | 2 +- .../exception/SeatCanNotAppliedException.kt | 2 +- .../exception/SeatNotFoundException.kt | 2 +- .../SeatTypeAlreadyExistsException.kt | 2 +- .../exception/SeatTypeInUseException.kt | 2 +- .../exception/SeatTypeNotFoundException.kt | 2 +- .../StudyRoomAlreadyExistsException.kt | 2 +- ...tudyRoomAvailableGradeMismatchException.kt | 2 +- .../StudyRoomAvailableSexMismatchException.kt | 2 +- .../exception/StudyRoomNotFoundException.kt | 2 +- .../domain/studyroom/spi/AvailableTimePort.kt | 3 +- .../studyroom/spi/CommandAvailableTimePort.kt | 3 +- .../studyroom/spi/CommandSeatTypePort.kt | 3 +- .../studyroom/spi/CommandStudyRoomPort.kt | 3 +- .../studyroom/spi/QueryAvailableTimePort.kt | 5 +- .../domain/studyroom/spi/QuerySeatTypePort.kt | 5 +- .../studyroom/spi/QueryStudyRoomPort.kt | 7 +- .../dms/domain/studyroom/spi/SeatTypePort.kt | 3 +- .../spi/SeatTypeQueryStudyRoomPort.kt | 3 +- .../studyroom/spi/StudyRoomQuerySchoolPort.kt | 5 +- .../spi/StudyRoomQueryStudentPort.kt | 3 +- .../studyroom/spi/StudyRoomQueryUserPort.kt | 5 +- .../studyroom/spi/StudyRoomSecurityPort.kt | 3 +- .../dms/domain/studyroom/spi/vo/SeatVO.kt | 4 +- .../domain/studyroom/spi/vo/StudyRoomVO.kt | 4 +- .../studyroom/usecase/ApplySeatUseCase.kt | 74 +- .../usecase/CreateSeatTypeUseCase.kt | 2 +- .../usecase/CreateStudyRoomUseCase.kt | 8 +- .../usecase/ManagerQueryStudyRoomUseCase.kt | 15 +- .../usecase/ManagerQueryStudyRoomsUseCase.kt | 2 +- .../usecase/QueryAvailableTimeUseCase.kt | 2 +- .../QueryCurrentAppliedStudyRoomUseCase.kt | 2 +- .../usecase/QuerySeatTypesUseCase.kt | 2 +- .../usecase/RemoveSeatTypeUseCase.kt | 10 +- .../usecase/RemoveStudyRoomUseCase.kt | 8 +- .../usecase/StudentQueryStudyRoomUseCase.kt | 10 +- .../usecase/StudentQueryStudyRoomsUseCase.kt | 4 +- .../studyroom/usecase/UnApplySeatUseCase.kt | 2 +- .../usecase/UpdateAvailableTimeUseCase.kt | 2 +- .../usecase/UpdateStudyRoomUseCase.kt | 14 +- .../dms/domain/template/spi/TemplatePort.kt | 3 +- .../template/usecase/TemplateUseCase.kt | 2 +- .../user/exception/InvalidRoleException.kt | 2 +- .../exception/UserAccountIdExistsException.kt | 4 +- .../exception/UserEmailExistsException.kt | 4 +- .../user/exception/UserNotFoundException.kt | 4 +- .../dms/domain/user/spi/CommandUserPort.kt | 3 +- .../dms/domain/user/spi/QueryUserPort.kt | 3 +- .../aliens/dms/domain/user/spi/UserJwtPort.kt | 3 +- .../aliens/dms/domain/user/spi/UserPort.kt | 3 +- .../dms/domain/user/spi/UserSecurityPort.kt | 3 +- .../user/usecase/UpdateUserPasswordUseCase.kt | 2 +- .../usecase/UserPasswordCompareUseCase.kt | 2 +- .../usecase/CertifyEmailCodeUseCaseTests.kt | 2 +- .../auth/usecase/CertifyEmailUseCaseTests.kt | 14 +- .../CheckAccountIdExistenceUseCaseTests.kt | 2 +- .../auth/usecase/ReissueTokenUseCaseTests.kt | 12 +- .../auth/usecase/SendEmailCodeUseCaseTests.kt | 2 +- .../domain/auth/usecase/SignInUseCaseTests.kt | 2 +- .../file/usecase/UploadFileUseCaseTests.kt | 3 +- .../FindManagerAccountIdUseCaseTests.kt | 2 +- .../usecase/ManagerMyPageUseCaseTests.kt | 6 +- .../QueryStudentDetailsUseCaseTests.kt | 21 +- .../usecase/QueryStudentsUseCaseTests.kt | 24 +- .../usecase/RemoveStudentUseCaseTests.kt | 2 +- .../ResetManagerPasswordUseCaseTests.kt | 3 +- .../meal/usecase/QueryMealsUseCaseTests.kt | 2 +- .../usecase/QueryAllNoticesUseCaseTests.kt | 2 +- .../usecase/QueryNoticeDetailsUseCaseTests.kt | 2 +- .../usecase/QueryNoticeStatusUseCaseTests.kt | 2 +- .../usecase/RemoveNoticeUseCaseTests.kt | 2 +- .../notice/usecase/UpdateNoticeUseCaseTest.kt | 4 +- .../CancelGrantedPointUseCaseTests.kt | 2 +- .../CreatePointOptionUseCaseTest.kt | 15 +- .../ExportAllPointHistoryUseCaseTests.kt | 6 +- .../point.usecase/GrantPointUseCaseTest.kt | 49 +- .../QueryAllPointHistoryUseCaseTests.kt | 4 +- .../QueryPointHistoryUseCaseTests.kt | 2 +- .../QueryPointOptionsUseCaseTest.kt | 9 +- .../RemovePointOptionUseCaseTest.kt | 9 +- .../UpdatePointOptionUseCaseTest.kt | 24 +- .../remain/usecase/ApplyRemainUseCaseTests.kt | 24 +- .../usecase/CreateRemainUseCaseTests.kt | 7 +- .../usecase/ExportRemainStatusUseCaseTests.kt | 2 +- ...yCurrentAppliedRemainOptionUseCaseTests.kt | 2 +- .../QueryRemainAvailableTimeUseCaseTests.kt | 7 +- .../usecase/QueryRemainOptionsUseCaseTests.kt | 2 +- .../usecase/RemoveRemainOptionUseCaseTests.kt | 6 +- .../UpdateRemainAvailableTimeUseCaseTests.kt | 10 +- .../usecase/UpdateRemainOptionUseCaseTests.kt | 5 +- .../usecase/CheckSchoolAnswerUseCaseTests.kt | 2 +- .../usecase/CheckSchoolCodeUseCaseTests.kt | 2 +- .../QuerySchoolQuestionUseCaseTests.kt | 2 +- .../usecase/QuerySchoolsUseCaseTests.kt | 3 +- .../usecase/ReissueSchoolCodeUseCaseTests.kt | 2 +- .../usecase/UpdateQuestionUseCaseTests.kt | 2 +- .../CheckDuplicatedAccountIdUseCaseTests.kt | 2 +- .../CheckDuplicatedEmailUseCaseTests.kt | 2 +- .../usecase/CheckStudentGcnUseCaseTests.kt | 9 +- .../FindStudentAccountIdUseCaseTests.kt | 2 +- .../ResetStudentPasswordUseCaseTests.kt | 7 +- .../student/usecase/SignUpUseCaseTests.kt | 80 +- .../usecase/StudentMyPageUseCaseTests.kt | 2 +- .../UpdateStudentProfileUseCaseTests.kt | 2 +- .../usecase/CreateStudyRoomUseCaseTests.kt | 2 +- .../ManagerQueryStudyRoomUseCaseTests.kt | 22 +- .../ManagerQueryStudyRoomsUseCaseTests.kt | 6 +- ...ueryCurrentAppliedStudyRoomUseCaseTests.kt | 6 +- .../StudentQueryStudyRoomUseCaseTests.kt | 8 +- .../StudentQueryStudyRoomsUseCaseTests.kt | 6 +- .../usecase/UpdateStudyRoomUseCaseTests.kt | 7 +- .../usecase/UpdateUserPasswordUseCaseTests.kt | 2 +- .../UserPasswordCompareUseCaseTests.kt | 2 +- dms-domain/config/detekt/detekt.yml | 809 ++++++++++++++++++ .../dms/common/annotation/DomainService.kt | 2 +- .../aliens/dms/common/error/DmsException.kt | 4 +- .../aliens/dms/common/error/ErrorProperty.kt | 3 +- .../dms/domain/auth/error/AuthErrorCode.kt | 2 +- .../exception/AuthCodeMismatchException.kt | 4 +- .../exception/AuthCodeOverLimitException.kt | 4 +- .../aliens/dms/domain/auth/model/AuthCode.kt | 8 + .../dms/domain/auth/model/AuthCodeLimit.kt | 2 +- .../aliens/dms/domain/auth/model/Authority.kt | 2 +- .../aliens/dms/domain/auth/model/EmailType.kt | 2 +- .../dms/domain/file/error/FileErrorCode.kt | 2 +- .../team/aliens/dms/domain/file/model/File.kt | 2 +- .../domain/manager/error/ManagerErrorCode.kt | 2 +- .../dms/domain/manager/model/Manager.kt | 2 +- .../team/aliens/dms/domain/meal/model/Meal.kt | 2 +- .../domain/notice/error/NoticeErrorCode.kt | 2 +- .../aliens/dms/domain/notice/model/Notice.kt | 2 +- .../dms/domain/notice/model/OrderType.kt | 2 +- .../point/error/PointHistoryErrorCode.kt | 2 +- .../point/error/PointOptionErrorCode.kt | 2 +- .../PointHistoryCanNotCancelException.kt | 2 +- .../PointOptionSchoolMismatchException.kt | 2 +- .../aliens/dms/domain/point/model/Phrase.kt | 2 +- .../dms/domain/point/model/PointHistory.kt | 2 +- .../dms/domain/point/model/PointOption.kt | 4 +- .../dms/domain/point/model/PointType.kt | 2 +- .../error/RemainAvailableTimeErrorCode.kt | 2 +- .../remain/error/RemainOptionErrorCode.kt | 2 +- .../remain/error/RemainStatusErrorCode.kt | 2 +- .../remain/model/RemainAvailableTime.kt | 2 +- .../dms/domain/remain/model/RemainOption.kt | 2 +- .../dms/domain/remain/model/RemainStatus.kt | 4 +- .../dms/domain/room/error/RoomErrorCode.kt | 2 +- .../team/aliens/dms/domain/room/model/Room.kt | 2 +- .../domain/school/error/SchoolErrorCode.kt | 2 +- .../domain/school/model/AvailableFeature.kt | 2 +- .../aliens/dms/domain/school/model/School.kt | 6 +- .../domain/student/error/StudentErrorCode.kt | 2 +- .../student/error/VerifiedStudentErrorCode.kt | 2 +- .../aliens/dms/domain/student/model/Sex.kt | 2 +- .../dms/domain/student/model/Student.kt | 4 +- .../domain/student/model/VerifiedStudent.kt | 2 +- .../studyroom/error/AvailableTimeErrorCode.kt | 2 +- .../domain/studyroom/error/SeatErrorCode.kt | 2 +- .../studyroom/error/SeatTypeErrorCode.kt | 2 +- .../studyroom/error/StudyRoomErrorCode.kt | 2 +- .../exception/SeatAlreadyAppliedException.kt | 2 +- .../domain/studyroom/model/AvailableTime.kt | 4 +- .../aliens/dms/domain/studyroom/model/Seat.kt | 15 +- .../dms/domain/studyroom/model/SeatStatus.kt | 2 +- .../dms/domain/studyroom/model/StudyRoom.kt | 3 +- .../dms/domain/user/error/UserErrorCode.kt | 2 +- .../team/aliens/dms/domain/user/model/User.kt | 2 +- .../domain/user/service/CheckUserAuthority.kt | 3 +- .../user/service/CheckUserAuthorityService.kt | 4 +- .../domain/user/spi/UserQueryStudentPort.kt | 3 +- .../dms/point/model/PointHistoryTests.kt | 2 +- dms-infrastructure/config/detekt/detekt.yml | 809 ++++++++++++++++++ .../config/ComponentScanConfiguration.kt | 3 +- .../config/PropertiesScanConfiguration.kt | 5 +- .../dms/global/config/QuerydslConfig.kt | 2 +- .../aliens/dms/global/config/RedisConfig.kt | 2 +- .../aliens/dms/global/error/ErrorResponse.kt | 9 +- .../dms/global/error/GlobalErrorCode.kt | 2 +- .../dms/global/error/GlobalErrorHandler.kt | 4 +- .../exception/InternalServerErrorException.kt | 2 +- .../dms/global/filter/ExceptionFilter.kt | 4 +- .../aliens/dms/global/filter/FilterConfig.kt | 2 +- .../aliens/dms/global/filter/JwtFilter.kt | 3 +- .../security/CustomAccessDeniedHandler.kt | 2 +- .../CustomAuthenticationEntryPoint.kt | 2 +- .../dms/global/security/SecurityAdapter.kt | 2 +- .../global/security/SecurityConfiguration.kt | 16 +- .../dms/global/security/SecurityProperties.kt | 2 +- .../security/error/SecurityErrorCode.kt | 2 +- .../exception/ExpiredTokenException.kt | 2 +- .../security/exception/ForbiddenException.kt | 2 +- .../exception/InvalidRoleException.kt | 2 +- .../exception/InvalidTokenException.kt | 2 +- .../security/principle/ManagerDetails.kt | 2 +- .../principle/ManagerDetailsService.kt | 2 +- .../security/principle/StudentDetails.kt | 2 +- .../principle/StudentDetailsService.kt | 2 +- .../security/token/GenerateJwtAdapter.kt | 2 +- .../dms/global/security/token/JwtParser.kt | 2 +- .../global/security/token/JwtProperties.kt | 2 +- .../team/aliens/dms/persistence/BaseEntity.kt | 2 +- .../aliens/dms/persistence/BaseTimeEntity.kt | 2 +- .../aliens/dms/persistence/BaseUUIDEntity.kt | 4 +- .../aliens/dms/persistence/GenericMapper.kt | 3 +- .../dms/persistence/TimeBasedUUIDGenerator.kt | 4 +- .../auth/AuthCodeLimitPersistenceAdapter.kt | 2 +- .../auth/AuthCodePersistenceAdapter.kt | 2 +- .../auth/RefreshTokenPersistenceAdapter.kt | 2 +- .../persistence/auth/entity/AuthCodeEntity.kt | 2 +- .../auth/entity/AuthCodeLimitEntity.kt | 2 +- .../auth/mapper/AuthCodeLimitMapper.kt | 2 +- .../persistence/auth/mapper/AuthCodeMapper.kt | 2 +- .../auth/mapper/RefreshTokenMapper.kt | 2 +- .../repository/AuthCodeEntityRepository.kt | 3 +- .../repository/AuthCodeLimitRepository.kt | 3 +- .../auth/repository/RefreshTokenRepository.kt | 3 +- .../manager/ManagerPersistenceAdapter.kt | 2 +- .../manager/entity/ManagerJpaEntity.kt | 2 +- .../manager/mapper/ManagerMapper.kt | 2 +- .../repository/ManagerJpaRepository.kt | 3 +- .../meal/MealPersistenceAdapter.kt | 2 +- .../persistence/meal/entity/MealJpaEntity.kt | 2 +- .../dms/persistence/meal/mapper/MealMapper.kt | 2 +- .../meal/repository/MealJpaRepository.kt | 3 +- .../notice/NoticePersistenceAdapter.kt | 2 +- .../notice/entity/NoticeJpaEntity.kt | 2 +- .../persistence/notice/mapper/NoticeMapper.kt | 2 +- .../notice/repository/NoticeJpaRepository.kt | 3 +- .../point/PhrasePersistenceAdapterStudent.kt | 2 +- .../point/PointOptionPersistenceAdapter.kt | 2 +- .../point/entity/PhraseJpaEntity.kt | 2 +- .../point/entity/PointHistoryJpaEntity.kt | 2 +- .../point/entity/PointOptionJpaEntity.kt | 2 +- .../persistence/point/mapper/PhraseMapper.kt | 2 +- .../point/mapper/PointHistoryMapper.kt | 2 +- .../point/mapper/PointOptionMapper.kt | 2 +- .../point/repository/PhraseJpaRepository.kt | 7 +- .../repository/PointHistoryJpaRepository.kt | 3 +- .../repository/PointOptionJpaRepository.kt | 2 +- .../RemainAvailableTimePersistenceAdapter.kt | 2 +- .../remain/RemainOptionPersistenceAdapter.kt | 2 +- .../remain/RemainStatusPersistenceAdapter.kt | 2 +- .../entity/RemainAvailableTimeJpaEntity.kt | 2 +- .../remain/entity/RemainOptionJpaEntity.kt | 2 +- .../remain/entity/RemainStatusJpaEntity.kt | 2 +- .../mapper/RemainAvailableTimeMapper.kt | 2 +- .../remain/mapper/RemainOptionMapper.kt | 2 +- .../remain/mapper/RemainStatusMapper.kt | 2 +- .../RemainAvailableTimeJpaRepository.kt | 3 +- .../repository/RemainOptionJpaRepository.kt | 3 +- .../repository/RemainStatusJpaRepository.kt | 2 +- .../room/RoomPersistenceAdapter.kt | 4 +- .../persistence/room/entity/RoomJpaEntity.kt | 2 +- .../dms/persistence/room/mapper/RoomMapper.kt | 2 +- .../room/repository/RoomJpaRepository.kt | 3 +- .../school/SchoolPersistenceAdapter.kt | 2 +- .../entity/AvailableFeatureJpaEntity.kt | 2 +- .../school/entity/SchoolJpaEntity.kt | 5 +- .../school/mapper/AvailableFeatureMapper.kt | 2 +- .../persistence/school/mapper/SchoolMapper.kt | 2 +- .../AvailableFeatureJpaRepository.kt | 3 +- .../school/repository/SchoolJpaRepository.kt | 3 +- .../student/StudentPersistenceAdapter.kt | 26 +- .../VerifiedStudentPersistenceAdapter.kt | 2 +- .../student/entity/StudentJpaEntity.kt | 2 +- .../entity/VerifiedStudentJpaEntity.kt | 6 +- .../student/mapper/StudentMapper.kt | 2 +- .../student/mapper/VerifiedStudentMapper.kt | 2 +- .../repository/StudentJpaRepository.kt | 3 +- .../VerifiedStudentJpaRepository.kt | 5 +- .../AvailableTimePersistenceAdapter.kt | 2 +- .../studyroom/SeatTypePersistenceAdapter.kt | 4 +- .../studyroom/StudyRoomPersistenceAdapter.kt | 10 +- .../entity/AvailableTimeJpaEntity.kt | 4 +- .../studyroom/entity/SeatJpaEntity.kt | 8 +- .../studyroom/entity/SeatTypeJpaEntity.kt | 6 +- .../studyroom/entity/StudyRoomJpaEntity.kt | 8 +- .../studyroom/mapper/AvailableTimeMapper.kt | 2 +- .../studyroom/mapper/SeatMapper.kt | 2 +- .../studyroom/mapper/SeatTypeMapper.kt | 4 +- .../studyroom/mapper/StudyRoomMapper.kt | 2 +- .../repository/AvailableTimeJpaRepository.kt | 5 +- .../studyroom/repository/SeatJpaRepository.kt | 5 +- .../repository/SeatTypeJpaRepository.kt | 5 +- .../repository/StudyRoomJpaRepository.kt | 5 +- .../studyroom/repository/vo/QuerySeatVO.kt | 6 +- .../repository/vo/QueryStudyRoomVO.kt | 4 +- .../user/UserPersistenceAdapter.kt | 2 +- .../persistence/user/entity/UserJpaEntity.kt | 2 +- .../user/repository/UserJpaRepository.kt | 2 +- .../aliens/dms/thirdparty/AwsProperties.kt | 2 +- .../dms/thirdparty/email/AwsSESAdapter.kt | 2 +- .../dms/thirdparty/email/AwsSESProperties.kt | 2 +- .../dms/thirdparty/email/AwsSesConfig.kt | 2 +- .../exception/SendEmailRejectedException.kt | 2 +- .../email/exception/SesException.kt | 2 +- .../dms/thirdparty/parser/ExcelAdapter.kt | 2 +- .../ExcelExtensionMismatchException.kt | 2 +- .../exception/ExcelInvalidFileException.kt | 2 +- .../exception/ExcelSexMismatchException.kt | 2 +- .../dms/thirdparty/storage/AwsS3Adapter.kt | 2 +- .../dms/thirdparty/storage/AwsS3Properties.kt | 2 +- .../thirdparty/parser/ExcelAdapterTests.kt | 3 +- dms-presentation/config/detekt/detekt.yml | 809 ++++++++++++++++++ .../team/aliens/dms/common/WebMvcConfig.kt | 2 +- .../team/aliens/dms/common/dto/PageWebData.kt | 2 +- .../dms/domain/HealthCheckWebAdapter.kt | 3 +- .../aliens/dms/domain/auth/AuthWebAdapter.kt | 12 +- .../dto/request/SendEmailCodeWebRequest.kt | 2 +- .../auth/dto/request/SignInWebRequest.kt | 2 +- .../domain/auth/dto/request/WebEmailType.kt | 2 +- .../aliens/dms/domain/file/FileExtension.kt | 2 +- .../aliens/dms/domain/file/FileWebAdapter.kt | 12 +- .../dms/domain/manager/ManagerWebAdapter.kt | 16 +- .../domain/manager/dto/request/Password.kt | 2 +- .../response/FindManagerAccountIdResponse.kt | 4 +- .../aliens/dms/domain/meal/MealWebAdapter.kt | 6 +- .../dms/domain/notice/NoticeWebAdapter.kt | 10 +- .../dto/request/CreateNoticeWebRequest.kt | 2 +- .../dto/request/UpdateNoticeWebRequest.kt | 1 - .../domain/notice/dto/request/WebOrderType.kt | 2 +- .../dto/response/CreateNoticeResponse.kt | 2 +- .../dto/response/UpdateNoticeResponse.kt | 2 +- .../dms/domain/point/PointWebAdapter.kt | 8 +- .../domain/point/dto/request/WebPointType.kt | 2 +- .../dms/domain/remain/RemainWebAdapter.kt | 22 +- .../request/CreateRemainOptionWebRequest.kt | 2 +- .../UpdateRemainAvailableTimeWebRequest.kt | 2 +- .../request/UpdateRemainOptionWebRequest.kt | 2 +- .../response/CreateRemainOptionResponse.kt | 2 +- .../dms/domain/school/SchoolWebAdapter.kt | 12 +- .../dms/domain/student/StudentWebAdapter.kt | 1 - .../student/dto/request/SignUpWebRequest.kt | 2 +- .../domain/studyroom/StudyRoomWebAdapter.kt | 32 +- .../studyroom/dto/CreateStudyRoomResponse.kt | 2 +- .../dms/domain/studyroom/dto/WebSeatStatus.kt | 2 +- .../aliens/dms/domain/studyroom/dto/WebSex.kt | 2 +- .../template/EmailTemplateWebAdapter.kt | 2 +- .../aliens/dms/domain/user/UserWebAdapter.kt | 4 +- .../aliens/dms/DmsBackendApplicationTests.kt | 3 +- 543 files changed, 4295 insertions(+), 1230 deletions(-) create mode 100644 dms-application/config/detekt/detekt.yml create mode 100644 dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandStudentPort.kt create mode 100644 dms-application/src/main/kotlin/team/aliens/dms/domain/school/SchoolExtension.kt create mode 100644 dms-domain/config/detekt/detekt.yml rename {dms-application => dms-domain}/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt (99%) rename {dms-application => dms-domain}/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt (99%) create mode 100644 dms-infrastructure/config/detekt/detekt.yml create mode 100644 dms-presentation/config/detekt/detekt.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 65723b76a..e4fa43170 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,4 +27,7 @@ jobs: arguments: | build --build-cache - --no-daemon \ No newline at end of file + --no-daemon + + - name: Run Detekt + run: ./gradlew detekt \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 1f68944dd..f5f5f0a5e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,6 @@ plugins { kotlin("jvm") version PluginVersions.JVM_VERSION + id("io.gitlab.arturbosch.detekt").version(PluginVersions.DETEKT_VERSION) } subprojects { @@ -13,6 +14,18 @@ subprojects { version = PluginVersions.KAPT_VERSION } + apply { + plugin("io.gitlab.arturbosch.detekt") + version = PluginVersions.DETEKT_VERSION + } + + detekt { + toolVersion = PluginVersions.DETEKT_VERSION + buildUponDefaultConfig = true + autoCorrect = true + config = files("config/detekt/detekt.yml") + } + dependencies { // kotlin diff --git a/buildSrc/src/main/kotlin/PluginVersions.kt b/buildSrc/src/main/kotlin/PluginVersions.kt index 1b2d39203..b15e914a9 100644 --- a/buildSrc/src/main/kotlin/PluginVersions.kt +++ b/buildSrc/src/main/kotlin/PluginVersions.kt @@ -7,4 +7,5 @@ object PluginVersions { const val KAPT_VERSION = "1.7.10" const val ALLOPEN_VERSION = "1.6.21" const val MOCKK_VERSION = "1.13.2" + const val DETEKT_VERSION = "1.21.0" } \ No newline at end of file diff --git a/dms-application/config/detekt/detekt.yml b/dms-application/config/detekt/detekt.yml new file mode 100644 index 000000000..15ced9138 --- /dev/null +++ b/dms-application/config/detekt/detekt.yml @@ -0,0 +1,809 @@ +build: + maxIssues: -1 + excludeCorrectable: false + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +config: + validation: true + warningsAsErrors: false + # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' + excludes: '' + +processors: + active: true + exclude: + - 'DetektProgressListener' + # - 'KtFileCountProcessor' + # - 'PackageCountProcessor' + # - 'ClassCountProcessor' + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ProjectComplexityProcessor' + # - 'ProjectCognitiveComplexityProcessor' + # - 'ProjectLLOCProcessor' + # - 'ProjectCLOCProcessor' + # - 'ProjectLOCProcessor' + # - 'ProjectSLOCProcessor' + # - 'LicenseHeaderLoaderExtension' + +console-reports: + active: true + exclude: + - 'ProjectStatisticsReport' + - 'ComplexityReport' + - 'NotificationReport' + # - 'FindingsReport' + - 'FileBasedFindingsReport' + - 'LiteFindingsReport' + +output-reports: + active: true + exclude: + # - 'TxtOutputReport' + # - 'XmlOutputReport' + # - 'HtmlOutputReport' + +comments: + active: true + AbsentOrWrongFileLicense: + active: false + licenseTemplateFile: 'license.template' + licenseTemplateIsRegex: false + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + DeprecatedBlockTag: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' + OutdatedDocumentation: + active: false + matchTypeParameters: true + matchDeclarationsOrder: true + UndocumentedPublicClass: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UndocumentedPublicProperty: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + +complexity: + active: true + ComplexCondition: + active: true + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + includePrivateDeclarations: false + ComplexMethod: + active: true + threshold: 15 + ignoreSingleWhenExpression: false + ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: + - 'also' + - 'apply' + - 'forEach' + - 'isNotNull' + - 'ifNull' + - 'let' + - 'run' + - 'use' + - 'with' + LabeledExpression: + active: false + ignoredLabels: [] + LargeClass: + active: true + threshold: 600 + LongMethod: + active: true + threshold: 60 + LongParameterList: + active: true + functionThreshold: 6 + constructorThreshold: 7 + ignoreDefaultParameters: false + ignoreDataClasses: true + ignoreAnnotatedParameter: [] + excludes: ['**/vo/**', '**/usecase/**'] + MethodOverloading: + active: false + threshold: 6 + NamedArguments: + active: false + threshold: 3 + NestedBlockDepth: + active: true + threshold: 4 + ReplaceSafeCallChainWithRun: + active: false + StringLiteralDuplication: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + ignoreOverridden: false + +coroutines: + active: true + GlobalCoroutineUsage: + active: false + InjectDispatcher: + active: false + dispatcherNames: + - 'IO' + - 'Default' + - 'Unconfined' + RedundantSuspendModifier: + active: false + SleepInsteadOfDelay: + active: false + SuspendFunWithFlowReturnType: + active: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: '_|(ignore|expected).*' + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverridden: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyTryBlock: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: true + methodNames: + - 'equals' + - 'finalize' + - 'hashCode' + - 'toString' + InstanceOfCheckForException: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + NotImplementedDeclaration: + active: false + ObjectExtendsThrowable: + active: false + PrintStackTrace: + active: true + RethrowCaughtException: + active: true + ReturnFromFinally: + active: true + ignoreLabeled: false + SwallowedException: + active: true + ignoredExceptionTypes: + - 'InterruptedException' + - 'MalformedURLException' + - 'NumberFormatException' + - 'ParseException' + allowedExceptionNameRegex: '_|(ignore|expected).*' + ThrowingExceptionFromFinally: + active: true + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptions: + - 'ArrayIndexOutOfBoundsException' + - 'Exception' + - 'IllegalArgumentException' + - 'IllegalMonitorStateException' + - 'IllegalStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + ThrowingNewInstanceOfSameException: + active: true + TooGenericExceptionCaught: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptionNames: + - 'ArrayIndexOutOfBoundsException' + - 'Error' + - 'Exception' + - 'IllegalMonitorStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + allowedExceptionNameRegex: '_|(ignore|expected).*' + TooGenericExceptionThrown: + active: true + exceptionNames: + - 'Error' + - 'Exception' + - 'RuntimeException' + - 'Throwable' + +formatting: + active: true + android: false + autoCorrect: true + AnnotationOnSeparateLine: + active: false + autoCorrect: true + AnnotationSpacing: + active: false + autoCorrect: true + ArgumentListWrapping: + active: false + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + EnumEntryNameCase: + active: false + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + insertFinalNewLine: true + ImportOrdering: + active: true + autoCorrect: true + layout: '*,java.**,javax.**,kotlin.**,^' + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: true + maxLineLength: 120 + ignoreBackTickedIdentifier: false + ModifierOrdering: + active: true + autoCorrect: true + MultiLineIfElse: + active: false + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoEmptyFirstLineInMethodBlock: + active: false + autoCorrect: true + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + PackageName: + active: false + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + SpacingAroundAngleBrackets: + active: false + autoCorrect: true + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundDot: + active: true + autoCorrect: true + SpacingAroundDoubleColon: + active: false + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundParens: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + SpacingAroundUnaryOperator: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithAnnotations: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithComments: + active: false + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + BooleanPropertyNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + allowedPattern: '^(is|has|are)' + ClassNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + classPattern: '[A-Z][a-zA-Z0-9]*' + ConstructorParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + EnumNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + forbiddenName: [] + FunctionMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' + excludeClassPattern: '$^' + ignoreOverridden: true + FunctionParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + InvalidPackageDeclaration: + active: false + rootPackage: '' + LambdaParameterNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*|_' + MatchingDeclarationName: + active: true + mustBeFirst: true + MemberNameEqualsClassName: + active: true + ignoreOverridden: true + NoNameShadowing: + active: false + NonBooleanPropertyPrefixedWithIs: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ObjectPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' + TopLevelPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' + VariableMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumVariableNameLength: 64 + VariableMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumVariableNameLength: 1 + VariableNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + +performance: + active: true + ArrayPrimitive: + active: true + ForEachOnRange: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + SpreadOperator: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + AvoidReferentialEquality: + active: false + forbiddenTypePatterns: + - 'kotlin.String' + CastToNullableType: + active: false + Deprecation: + active: false + DontDowncastCollectionTypes: + active: false + DoubleMutabilityForCollection: + active: false + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: true + EqualsWithHashCodeExist: + active: true + ExitOutsideMain: + active: false + ExplicitGarbageCollectionCall: + active: true + HasPlatformType: + active: false + IgnoredReturnValue: + active: false + restrictToAnnotatedMethods: true + returnValueAnnotations: + - '*.CheckResult' + - '*.CheckReturnValue' + ignoreReturnValueAnnotations: + - '*.CanIgnoreReturnValue' + ImplicitDefaultLocale: + active: true + ImplicitUnitReturnType: + active: false + allowExplicitReturnType: true + InvalidRange: + active: true + IteratorHasNextCallsNextMethod: + active: true + IteratorNotThrowingNoSuchElementException: + active: true + LateinitUsage: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreOnClassesPattern: '' + MapGetWithNotNullAssertionOperator: + active: false + MissingPackageDeclaration: + active: false + excludes: ['**/*.kts'] + MissingWhenCase: + active: true + allowElseExpression: true + NullableToStringCall: + active: false + RedundantElseInWhen: + active: true + UnconditionalJumpStatementInLoop: + active: false + UnnecessaryNotNullOperator: + active: true + UnnecessarySafeCall: + active: true + UnreachableCatchBlock: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnsafeCast: + active: true + UnusedUnaryOperator: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: true + +style: + active: true + ClassOrdering: + active: false + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + DataClassShouldBeImmutable: + active: false + DestructuringDeclarationWithTooManyEntries: + active: false + maxDestructuringEntries: 3 + EqualsNullCall: + active: true + EqualsOnSignatureLine: + active: false + ExplicitCollectionElementAccessMethod: + active: false + ExplicitItLambdaParameter: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: + - 'FIXME:' + - 'STOPSHIP:' + - 'TODO:' + allowedPatterns: '' + customMessage: '' + ForbiddenImport: + active: false + imports: [] + forbiddenPatterns: '' + ForbiddenMethodCall: + active: false + methods: + - 'kotlin.io.print' + - 'kotlin.io.println' + ForbiddenPublicDataClass: + active: true + excludes: ['**'] + ignorePackages: + - '*.internal' + - '*.internal.*' + ForbiddenVoid: + active: false + ignoreOverridden: false + ignoreUsageInGenerics: false + FunctionOnlyReturningConstant: + active: true + ignoreOverridableFunction: true + ignoreActualFunction: true + excludedFunctions: '' + LibraryCodeMustSpecifyReturnType: + active: true + excludes: ['**'] + LibraryEntitiesShouldNotBePublic: + active: true + excludes: ['**'] + LoopWithTooManyJumpStatements: + active: true + maxJumpCount: 1 + MagicNumber: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreNumbers: + - '-1' + - '0' + - '1' + - '2' + ignoreHashCodeFunction: true + ignorePropertyDeclaration: false + ignoreLocalVariableDeclaration: false + ignoreConstantDeclaration: true + ignoreCompanionObjectPropertyDeclaration: true + ignoreAnnotation: false + ignoreNamedArgument: true + ignoreEnums: false + ignoreRanges: false + ignoreExtensionFunctions: true + MandatoryBracesIfStatements: + active: false + MandatoryBracesLoops: + active: false + MaxLineLength: + active: true + maxLineLength: 120 + excludePackageStatements: true + excludeImportStatements: true + excludeCommentStatements: false + MayBeConst: + active: true + ModifierOrder: + active: true + MultilineLambdaItParameter: + active: false + NestedClassesVisibility: + active: true + NewLineAtEndOfFile: + active: true + NoTabs: + active: false + ObjectLiteralToLambda: + active: false + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: true + RedundantExplicitType: + active: false + RedundantHigherOrderMapUsage: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: 'equals' + excludeLabeled: false + excludeReturnFromLambda: true + excludeGuardClauses: false + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: true + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 4 + excludeGuardClauses: true + TrailingWhitespace: + active: false + UnderscoresInNumericLiterals: + active: false + acceptableLength: 4 + UnnecessaryAbstractClass: + active: true + UnnecessaryAnnotationUseSiteTarget: + active: false + UnnecessaryApply: + active: true + UnnecessaryFilter: + active: false + UnnecessaryInheritance: + active: true + UnnecessaryLet: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateClass: + active: true + UnusedPrivateMember: + active: true + allowedNames: '(_|ignored|expected|serialVersionUID)' + UseAnyOrNoneInsteadOfFind: + active: false + UseArrayLiteralsInAnnotations: + active: false + UseCheckNotNull: + active: false + UseCheckOrError: + active: false + UseDataClass: + active: false + allowVars: false + UseEmptyCounterpart: + active: false + UseIfEmptyOrIfBlank: + active: false + UseIfInsteadOfWhen: + active: false + UseIsNullOrEmpty: + active: false + UseOrEmpty: + active: false + UseRequire: + active: false + UseRequireNotNull: + active: false + UselessCallOnNotNull: + active: true + UtilityClassWithPublicConstructor: + active: true + VarCouldBeVal: + active: true + WildcardImport: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] +# excludeImports: +# - 'java.util.*' diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/ReadOnlyUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/ReadOnlyUseCase.kt index a68cbebfd..f724c1b6e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/ReadOnlyUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/ReadOnlyUseCase.kt @@ -5,4 +5,4 @@ import org.springframework.transaction.annotation.Transactional @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS) @Transactional(readOnly = true) -annotation class ReadOnlyUseCase() \ No newline at end of file +annotation class ReadOnlyUseCase diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/UseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/UseCase.kt index acc2fcbc4..c045fd67b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/UseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/annotation/UseCase.kt @@ -5,4 +5,4 @@ import org.springframework.transaction.annotation.Transactional @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS) @Transactional -annotation class UseCase() \ No newline at end of file +annotation class UseCase diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/dto/PageData.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/dto/PageData.kt index 7d8651f14..17e8535fb 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/dto/PageData.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/dto/PageData.kt @@ -5,13 +5,16 @@ class PageData( size: Long? ) { - val page: Long = page ?: 0 - val size: Long = size ?: 500 + val page: Long = page ?: PAGE_NUM + val size: Long = size ?: PAGE_SIZE val offset: Long get() = page * size companion object { + private const val PAGE_NUM: Long = 0 + private const val PAGE_SIZE: Long = 500 + val DEFAULT = PageData(null, null) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/extension/LocalDateExtension.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/extension/LocalDateExtension.kt index a586a6967..b78a9cb1e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/extension/LocalDateExtension.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/extension/LocalDateExtension.kt @@ -10,6 +10,9 @@ operator fun ClosedRange.iterator(): Iterator { override fun hasNext(): Boolean = hasNext override fun next(): LocalDate { + if (!hasNext) { + throw NoSuchElementException() + } val value = next if (value == finalElement) { hasNext = false @@ -19,4 +22,4 @@ operator fun ClosedRange.iterator(): Iterator { return value } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/spi/SecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/spi/SecurityPort.kt index 44a02eb07..64a5610a7 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/spi/SecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/spi/SecurityPort.kt @@ -21,5 +21,4 @@ interface SecurityPort : SchoolSecurityPort, PointSecurityPort, StudyRoomSecurityPort, - RemainSecurityPort{ -} \ No newline at end of file + RemainSecurityPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/common/util/StringUtil.kt b/dms-application/src/main/kotlin/team/aliens/dms/common/util/StringUtil.kt index 268b738b2..6f5541c92 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/common/util/StringUtil.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/common/util/StringUtil.kt @@ -4,16 +4,18 @@ import java.security.SecureRandom object StringUtil { + private const val NUMBER_OF_CHAR_TO_DISPLAY = 3 + fun coveredEmail(email: String): String { val index = email.indexOf('@') val sb = StringBuilder(email).also { - for (i in (index / 3) until index) { + for (i in (index / NUMBER_OF_CHAR_TO_DISPLAY) until index) { it.setCharAt(i, '*') } } - return sb.toString(); + return sb.toString() } fun randomNumber(number: Int): String { @@ -22,9 +24,9 @@ object StringUtil { val authCodeList: MutableList = mutableListOf() for (i: Int in 0 until number) { - authCodeList.add(i, codeList[random.nextInt(10)].toString()); + authCodeList.add(i, codeList[random.nextInt(codeList.size)].toString()) } return authCodeList.toString().replace("[^0-9]".toRegex(), "") } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailCodeRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailCodeRequest.kt index 9a19943b2..615f9f5e8 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailCodeRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailCodeRequest.kt @@ -12,4 +12,4 @@ data class CertifyEmailCodeRequest( authCode = authCode, type = EmailType.valueOf(type) ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailRequest.kt index 04799bf45..0705b08be 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/CertifyEmailRequest.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.auth.dto data class CertifyEmailRequest( val accountId: String, val email: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/ReissueResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/ReissueResponse.kt index 9f334c25d..ff693a733 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/ReissueResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/ReissueResponse.kt @@ -15,4 +15,4 @@ data class ReissueResponse( val pointService: Boolean, val studyRoomService: Boolean ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SendEmailCodeRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SendEmailCodeRequest.kt index daeda60de..522ad1637 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SendEmailCodeRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SendEmailCodeRequest.kt @@ -10,4 +10,4 @@ data class SendEmailCodeRequest( email = email, type = EmailType.valueOf(type) ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInRequest.kt index 503ed4414..860fde6d1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInRequest.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.auth.dto data class SignInRequest( val accountId: String, val password: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInResponse.kt index f47a30bef..c465b648e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/dto/SignInResponse.kt @@ -16,4 +16,4 @@ data class SignInResponse( val studyRoomService: Boolean, val remainService: Boolean ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeLimitNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeLimitNotFoundException.kt index 31c582ad5..31322495c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeLimitNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeLimitNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.auth.error.AuthErrorCode object AuthCodeLimitNotFoundException : DmsException( AuthErrorCode.AUTH_CODE_LIMIT_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeNotFoundException.kt index b69e60274..d47b95639 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeNotFoundException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object AuthCodeNotFoundException : DmsException( AuthErrorCode.AUTH_CODE_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailAlreadyCertifiedException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailAlreadyCertifiedException.kt index 6cacbf748..dea7cb44f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailAlreadyCertifiedException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailAlreadyCertifiedException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.auth.error.AuthErrorCode object EmailAlreadyCertifiedException : DmsException( AuthErrorCode.EMAIL_ALREADY_CERTIFIED -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailMismatchException.kt index 05199f0fe..14a3c1a58 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/EmailMismatchException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object EmailMismatchException : DmsException( AuthErrorCode.EMAIL_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/PasswordMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/PasswordMismatchException.kt index 12a8843a7..ec497b45f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/PasswordMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/PasswordMismatchException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object PasswordMismatchException : DmsException( AuthErrorCode.PASSWORD_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/RefreshTokenNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/RefreshTokenNotFoundException.kt index 1b0114a83..cccf254a4 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/RefreshTokenNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/RefreshTokenNotFoundException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object RefreshTokenNotFoundException : DmsException( AuthErrorCode.REFRESH_TOKEN_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodeLimitPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodeLimitPort.kt index 655c03db6..13fad6694 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodeLimitPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodeLimitPort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.auth.spi interface AuthCodeLimitPort : QueryAuthCodeLimitPort, - CommandAuthCodeLimitPort { -} \ No newline at end of file + CommandAuthCodeLimitPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodePort.kt index d5a654171..f736d0ca6 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthCodePort.kt @@ -1,11 +1,10 @@ package team.aliens.dms.domain.auth.spi -import team.aliens.dms.domain.student.spi.StudentQueryAuthCodePort import team.aliens.dms.domain.manager.spi.ManagerQueryAuthCodePort +import team.aliens.dms.domain.student.spi.StudentQueryAuthCodePort interface AuthCodePort : QueryAuthCodePort, CommandAuthCodePort, StudentQueryAuthCodePort, - ManagerQueryAuthCodePort { -} \ No newline at end of file + ManagerQueryAuthCodePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQuerySchoolPort.kt index b3d063b04..441b1a4ea 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQuerySchoolPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface AuthQuerySchoolPort { fun queryAvailableFeaturesBySchoolId(schoolId: UUID): AvailableFeature? - } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryStudentPort.kt index c71f9d6f9..5b20963e9 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryStudentPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface AuthQueryStudentPort { fun queryStudentById(studentId: UUID): Student? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryUserPort.kt index b41f84832..4f9e60e0f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthQueryUserPort.kt @@ -10,5 +10,4 @@ interface AuthQueryUserPort { fun queryUserByAccountId(accountId: String): User? fun queryUserById(id: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthSecurityPort.kt index 22e8fb257..0b83e7d0c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/AuthSecurityPort.kt @@ -3,5 +3,4 @@ package team.aliens.dms.domain.auth.spi interface AuthSecurityPort { fun isPasswordMatch(rawPassword: String, encodedPassword: String): Boolean - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodeLimitPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodeLimitPort.kt index 7bf27cbad..36964ae7a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodeLimitPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodeLimitPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.auth.model.AuthCodeLimit interface CommandAuthCodeLimitPort { fun saveAuthCodeLimit(authCodeLimit: AuthCodeLimit): AuthCodeLimit - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodePort.kt index a50d1c8e0..f5c7dc048 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/CommandAuthCodePort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.auth.model.AuthCode interface CommandAuthCodePort { fun saveAuthCode(authCode: AuthCode): AuthCode - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/JwtPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/JwtPort.kt index 7b96bb6e7..726310c23 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/JwtPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/JwtPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.user.spi.UserJwtPort interface JwtPort : UserJwtPort, - StudentJwtPort { -} \ No newline at end of file + StudentJwtPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodeLimitPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodeLimitPort.kt index 2cfdb3e71..6e234c898 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodeLimitPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodeLimitPort.kt @@ -6,5 +6,4 @@ import team.aliens.dms.domain.auth.model.EmailType interface QueryAuthCodeLimitPort { fun queryAuthCodeLimitByEmailAndEmailType(email: String, type: EmailType): AuthCodeLimit? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodePort.kt index b20780cc8..7a55e0e74 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryAuthCodePort.kt @@ -6,5 +6,4 @@ import team.aliens.dms.domain.auth.model.EmailType interface QueryAuthCodePort { fun queryAuthCodeByEmailAndEmailType(email: String, type: EmailType): AuthCode? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryRefreshTokenPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryRefreshTokenPort.kt index d16b2fa28..d0fdfc44c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryRefreshTokenPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/QueryRefreshTokenPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.auth.model.RefreshToken interface QueryRefreshTokenPort { fun queryRefreshTokenByToken(token: String): RefreshToken? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/RefreshTokenPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/RefreshTokenPort.kt index e7edeb65f..b05c99c02 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/RefreshTokenPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/RefreshTokenPort.kt @@ -1,5 +1,4 @@ package team.aliens.dms.domain.auth.spi interface RefreshTokenPort : - QueryRefreshTokenPort { -} \ No newline at end of file + QueryRefreshTokenPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/SendEmailPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/SendEmailPort.kt index c782fd94c..b844f135f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/SendEmailPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/spi/SendEmailPort.kt @@ -7,5 +7,4 @@ interface SendEmailPort { fun sendAuthCode(email: String, type: EmailType, code: String) fun sendAccountId(email: String, accountId: String) - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCase.kt index 26292cf16..f39ee07b5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCase.kt @@ -3,7 +3,6 @@ package team.aliens.dms.domain.auth.usecase import team.aliens.dms.common.annotation.UseCase import team.aliens.dms.domain.auth.dto.CertifyEmailCodeRequest import team.aliens.dms.domain.auth.exception.AuthCodeLimitNotFoundException -import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException import team.aliens.dms.domain.auth.exception.AuthCodeNotFoundException import team.aliens.dms.domain.auth.exception.EmailAlreadyCertifiedException import team.aliens.dms.domain.auth.model.EmailType @@ -29,9 +28,7 @@ class CertifyEmailCodeUseCase( val authCode = queryAuthCodePort.queryAuthCodeByEmailAndEmailType(request.email, request.type) ?: throw AuthCodeNotFoundException - if (authCode.code != request.authCode) { - throw AuthCodeMismatchException - } + authCode.validateAuthCode(request.authCode) val authCodeLimit = queryAuthCodeLimitPort.queryAuthCodeLimitByEmailAndEmailType(request.email, request.type) ?: throw AuthCodeLimitNotFoundException @@ -44,4 +41,4 @@ class CertifyEmailCodeUseCase( authCodeLimit.certified() ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCase.kt index 0dc31620b..b0810905e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCase.kt @@ -1,10 +1,10 @@ package team.aliens.dms.domain.auth.usecase +import team.aliens.dms.common.annotation.ReadOnlyUseCase import team.aliens.dms.domain.auth.dto.CertifyEmailRequest import team.aliens.dms.domain.auth.exception.EmailMismatchException import team.aliens.dms.domain.auth.spi.AuthQueryUserPort import team.aliens.dms.domain.user.exception.UserNotFoundException -import team.aliens.dms.common.annotation.ReadOnlyUseCase @ReadOnlyUseCase class CertifyEmailUseCase( @@ -18,4 +18,4 @@ class CertifyEmailUseCase( throw EmailMismatchException } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCase.kt index 8ee978a96..aa44c0a43 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCase.kt @@ -1,9 +1,9 @@ package team.aliens.dms.domain.auth.usecase -import team.aliens.dms.domain.auth.spi.AuthQueryUserPort -import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.common.annotation.ReadOnlyUseCase import team.aliens.dms.common.util.StringUtil +import team.aliens.dms.domain.auth.spi.AuthQueryUserPort +import team.aliens.dms.domain.user.exception.UserNotFoundException @ReadOnlyUseCase class CheckAccountIdExistenceUseCase( @@ -15,4 +15,4 @@ class CheckAccountIdExistenceUseCase( return StringUtil.coveredEmail(user.email) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCase.kt index ae96e0017..deb35e159 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCase.kt @@ -1,13 +1,12 @@ package team.aliens.dms.domain.auth.usecase +import team.aliens.dms.common.annotation.UseCase import team.aliens.dms.domain.auth.dto.ReissueResponse import team.aliens.dms.domain.auth.exception.RefreshTokenNotFoundException -import team.aliens.dms.domain.auth.spi.JwtPort -import team.aliens.dms.domain.auth.spi.QueryRefreshTokenPort -import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.auth.dto.SignInResponse import team.aliens.dms.domain.auth.spi.AuthQuerySchoolPort import team.aliens.dms.domain.auth.spi.AuthQueryUserPort +import team.aliens.dms.domain.auth.spi.JwtPort +import team.aliens.dms.domain.auth.spi.QueryRefreshTokenPort import team.aliens.dms.domain.school.exception.FeatureNotFoundException import team.aliens.dms.domain.user.exception.UserNotFoundException @@ -22,7 +21,9 @@ class ReissueTokenUseCase( fun execute(token: String): ReissueResponse { val queryToken = queryRefreshTokenPort.queryRefreshTokenByToken(token) ?: throw RefreshTokenNotFoundException - val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken(queryToken.userId, queryToken.authority) + val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken( + userId = queryToken.userId, authority = queryToken.authority + ) val user = queryUserPort.queryUserById(queryToken.userId) ?: throw UserNotFoundException @@ -44,4 +45,4 @@ class ReissueTokenUseCase( } ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCase.kt index 533f59bea..83d1e8eab 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCase.kt @@ -1,5 +1,7 @@ package team.aliens.dms.domain.auth.usecase +import team.aliens.dms.common.annotation.UseCase +import team.aliens.dms.common.util.StringUtil import team.aliens.dms.domain.auth.dto.SendEmailCodeRequest import team.aliens.dms.domain.auth.exception.EmailAlreadyCertifiedException import team.aliens.dms.domain.auth.model.AuthCode @@ -11,8 +13,6 @@ import team.aliens.dms.domain.auth.spi.CommandAuthCodePort import team.aliens.dms.domain.auth.spi.QueryAuthCodeLimitPort import team.aliens.dms.domain.auth.spi.SendEmailPort import team.aliens.dms.domain.user.exception.UserNotFoundException -import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.common.util.StringUtil @UseCase class SendEmailCodeUseCase( @@ -37,7 +37,7 @@ class SendEmailCodeUseCase( throw EmailAlreadyCertifiedException } - val code = StringUtil.randomNumber(6) + val code = StringUtil.randomNumber(AuthCode.AUTH_CODE_SIZE) val authCode = AuthCode( code = code, @@ -48,4 +48,4 @@ class SendEmailCodeUseCase( sendEmailPort.sendAuthCode(request.email, request.type, code) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCase.kt index 11401431b..74990304b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCase.kt @@ -26,11 +26,13 @@ class SignInUseCase( throw PasswordMismatchException } - val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken(user.id, user.authority) + val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken( + userId = user.id, authority = user.authority + ) val availableFeatures = querySchoolPort.queryAvailableFeaturesBySchoolId(user.schoolId) ?: throw FeatureNotFoundException - + return SignInResponse( accessToken = accessToken, accessTokenExpiredAt = accessTokenExpiredAt, @@ -47,4 +49,4 @@ class SignInUseCase( } ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileIOInterruptedException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileIOInterruptedException.kt index 4ce381959..d7a5d6529 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileIOInterruptedException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileIOInterruptedException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.file.exception -import team.aliens.dms.domain.file.error.FileErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.file.error.FileErrorCode object FileIOInterruptedException : DmsException( FileErrorCode.IO_INTERRUPTED -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileInvalidExtensionException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileInvalidExtensionException.kt index d1228ec7d..4d460b188 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileInvalidExtensionException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/exception/FileInvalidExtensionException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.file.exception -import team.aliens.dms.domain.file.error.FileErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.file.error.FileErrorCode object FileInvalidExtensionException : DmsException( FileErrorCode.INVALID_EXTENSION -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/ParseFilePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/ParseFilePort.kt index 9b006a99a..f3f5ab33a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/ParseFilePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/ParseFilePort.kt @@ -5,4 +5,4 @@ import java.io.File interface ParseFilePort { fun transferToVerifiedStudent(file: File): List -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/UploadFilePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/UploadFilePort.kt index 1ed4e098d..a4afb4291 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/UploadFilePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/UploadFilePort.kt @@ -5,5 +5,4 @@ import java.io.File interface UploadFilePort { fun upload(file: File): String - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/WriteFilePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/WriteFilePort.kt index 7311f864e..579e929e8 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/WriteFilePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/spi/WriteFilePort.kt @@ -8,4 +8,4 @@ interface WriteFilePort { fun writePointHistoryExcelFile(pointHistories: List): ByteArray fun writeRemainStatusExcelFile(studentRemainInfos: List): ByteArray -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/ImportVerifiedStudentUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/ImportVerifiedStudentUseCase.kt index 733ad0341..5e30455c2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/ImportVerifiedStudentUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/ImportVerifiedStudentUseCase.kt @@ -1,9 +1,9 @@ package team.aliens.dms.domain.file.usecase -import java.io.File import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.student.spi.CommandStudentPort import team.aliens.dms.domain.file.spi.ParseFilePort +import team.aliens.dms.domain.student.spi.CommandStudentPort +import java.io.File @UseCase class ImportVerifiedStudentUseCase( @@ -16,4 +16,4 @@ class ImportVerifiedStudentUseCase( commandStudentPort.saveAllVerifiedStudent(verifiedStudents) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCase.kt index 26db54377..3c535b9c3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCase.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.file.usecase +import team.aliens.dms.common.annotation.ReadOnlyUseCase import team.aliens.dms.domain.file.exception.FileInvalidExtensionException import team.aliens.dms.domain.file.spi.UploadFilePort -import team.aliens.dms.common.annotation.ReadOnlyUseCase import java.io.File @ReadOnlyUseCase @@ -23,4 +23,4 @@ class UploadFileUseCase( "jpg", "jpeg", "png", "heic" -> true else -> false } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/GetStudentDetailsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/GetStudentDetailsResponse.kt index df642171c..a27d44120 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/GetStudentDetailsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/GetStudentDetailsResponse.kt @@ -17,4 +17,4 @@ data class GetStudentDetailsResponse( val name: String, val profileImageUrl: String ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/ManagerMyPageResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/ManagerMyPageResponse.kt index 15bead0b8..8bf68eb81 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/ManagerMyPageResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/ManagerMyPageResponse.kt @@ -8,4 +8,4 @@ data class ManagerMyPageResponse( val code: String, val question: String, val answer: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilter.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilter.kt index d4a35ef12..c780dd324 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilter.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilter.kt @@ -2,14 +2,14 @@ package team.aliens.dms.domain.manager.dto import team.aliens.dms.domain.point.exception.InvalidPointFilterRangeException -data class PointFilter ( +data class PointFilter( val filterType: PointFilterType?, val minPoint: Int?, val maxPoint: Int? ) { init { filterType?.let { - if(maxPoint == null || minPoint == null || maxPoint < minPoint) { + if (maxPoint == null || minPoint == null || maxPoint < minPoint) { throw InvalidPointFilterRangeException } } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilterType.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilterType.kt index 64a66c2ae..66f18dca8 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilterType.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/PointFilterType.kt @@ -4,4 +4,4 @@ enum class PointFilterType { TOTAL, BONUS, MINUS -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/QueryStudentsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/QueryStudentsResponse.kt index b44dbb9c8..a75ef3dc3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/QueryStudentsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/QueryStudentsResponse.kt @@ -12,4 +12,4 @@ data class QueryStudentsResponse( val roomNumber: Int, val profileImageUrl: String ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/Sort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/Sort.kt index d32b98806..168687383 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/Sort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/dto/Sort.kt @@ -2,4 +2,4 @@ package team.aliens.dms.domain.manager.dto enum class Sort { GCN, NAME -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerInfoMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerInfoMismatchException.kt index fd5bb522d..e8e460ae5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerInfoMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerInfoMismatchException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.manager.exception -import team.aliens.dms.domain.manager.error.ManagerErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.manager.error.ManagerErrorCode object ManagerInfoMismatchException : DmsException( ManagerErrorCode.MANAGER_INFO_NOT_MATCHED -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerNotFoundException.kt index 1d4d6317c..13cd538a0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/exception/ManagerNotFoundException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.manager.exception -import team.aliens.dms.domain.manager.error.ManagerErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.manager.error.ManagerErrorCode object ManagerNotFoundException : DmsException( ManagerErrorCode.MANAGER_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandStudentPort.kt new file mode 100644 index 000000000..c812f4a69 --- /dev/null +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandStudentPort.kt @@ -0,0 +1,8 @@ +package team.aliens.dms.domain.manager.spi + +import team.aliens.dms.domain.student.model.Student + +interface ManagerCommandStudentPort { + + fun deleteStudent(student: Student) +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandUserPort.kt index 92855be24..61b8fd461 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerCommandUserPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.user.model.User interface ManagerCommandUserPort { fun saveUser(user: User): User - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerPort.kt index 4a5af9048..6bf55432a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerPort.kt @@ -4,5 +4,4 @@ import team.aliens.dms.domain.point.spi.PointQueryManagerPort interface ManagerPort : QueryManagerPort, - PointQueryManagerPort { -} \ No newline at end of file + PointQueryManagerPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryAuthCodePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryAuthCodePort.kt index 6ab7bbe30..ff37f0ad5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryAuthCodePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryAuthCodePort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.auth.model.AuthCode interface ManagerQueryAuthCodePort { fun queryAuthCodeByEmail(email: String): AuthCode? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryPointHistoryPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryPointHistoryPort.kt index 576e10a47..256f8448c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryPointHistoryPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryPointHistoryPort.kt @@ -3,5 +3,4 @@ package team.aliens.dms.domain.manager.spi interface ManagerQueryPointHistoryPort { fun queryBonusAndMinusTotalPointByStudentGcnAndName(gcn: String, studentName: String): Pair - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQuerySchoolPort.kt index 4b9444896..78af6b8d7 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQuerySchoolPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface ManagerQuerySchoolPort { fun querySchoolById(schoolId: UUID): School? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryStudentPort.kt index 7f2158186..04d73cc38 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryStudentPort.kt @@ -17,5 +17,4 @@ interface ManagerQueryStudentPort { ): List fun queryUserByRoomNumberAndSchoolId(roomNumber: Int, schoolId: UUID): List - } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryUserPort.kt index c0696a90d..869dd062e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerQueryUserPort.kt @@ -13,5 +13,4 @@ interface ManagerQueryUserPort { fun queryUserByAccountId(accountId: String): User? fun queryUserByEmail(email: String): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerSecurityPort.kt index 3e6e54775..c00df63b8 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/ManagerSecurityPort.kt @@ -7,5 +7,4 @@ interface ManagerSecurityPort { fun getCurrentUserId(): UUID fun encodePassword(password: String): String - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/QueryManagerPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/QueryManagerPort.kt index 9f81a8195..725612f55 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/QueryManagerPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/spi/QueryManagerPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface QueryManagerPort { fun queryManagerById(managerId: UUID): Manager? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCase.kt index 0ea3aa9c1..888069110 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCase.kt @@ -32,4 +32,4 @@ class FindManagerAccountIdUseCase( return StringUtil.coveredEmail(manager.email) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCase.kt index 00e3a1351..e06595341 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCase.kt @@ -29,4 +29,4 @@ class ManagerMyPageUseCase( answer = school.answer ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCase.kt index 0ff89f779..4258c13d0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCase.kt @@ -7,7 +7,7 @@ import team.aliens.dms.domain.manager.spi.ManagerQueryPointHistoryPort import team.aliens.dms.domain.manager.spi.ManagerQueryStudentPort import team.aliens.dms.domain.manager.spi.ManagerSecurityPort import team.aliens.dms.domain.manager.spi.QueryManagerPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.student.exception.StudentNotFoundException import java.util.UUID @@ -25,9 +25,7 @@ class QueryStudentDetailsUseCase( val student = queryStudentPort.queryStudentById(studentId) ?: throw StudentNotFoundException - if (manager.schoolId != student.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(manager.schoolId, student.schoolId) val (bonusPoint, minusPoint) = queryPointHistoryPort.queryBonusAndMinusTotalPointByStudentGcnAndName(student.gcn, student.name) @@ -55,4 +53,4 @@ class QueryStudentDetailsUseCase( roomMates = roomMates ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCase.kt index 189f01ca3..75f184e5a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCase.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.manager.usecase import team.aliens.dms.common.annotation.ReadOnlyUseCase -import team.aliens.dms.domain.manager.dto.PointFilterType import team.aliens.dms.domain.manager.dto.PointFilter +import team.aliens.dms.domain.manager.dto.PointFilterType import team.aliens.dms.domain.manager.dto.QueryStudentsResponse import team.aliens.dms.domain.manager.dto.Sort import team.aliens.dms.domain.manager.exception.ManagerNotFoundException @@ -17,12 +17,16 @@ class QueryStudentsUseCase( private val queryStudentPort: ManagerQueryStudentPort ) { - fun execute(name: String?, sort: Sort, filterType: PointFilterType?, - minPoint: Int?, maxPoint: Int?): QueryStudentsResponse { + fun execute( + name: String?, + sort: Sort, + filterType: PointFilterType?, + minPoint: Int?, + maxPoint: Int? + ): QueryStudentsResponse { val currentUserId = securityPort.getCurrentUserId() val manager = queryManagerPort.queryManagerById(currentUserId) ?: throw ManagerNotFoundException - val pointFilter = PointFilter( filterType = filterType, minPoint = minPoint, diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCase.kt index cc522673e..f9a5b24e0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCase.kt @@ -6,7 +6,7 @@ import team.aliens.dms.domain.manager.spi.ManagerCommandUserPort import team.aliens.dms.domain.manager.spi.ManagerQueryStudentPort import team.aliens.dms.domain.manager.spi.ManagerQueryUserPort import team.aliens.dms.domain.manager.spi.ManagerSecurityPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.student.exception.StudentNotFoundException import team.aliens.dms.domain.student.spi.StudentCommandRemainStatusPort import team.aliens.dms.domain.student.spi.StudentCommandStudyRoomPort @@ -34,8 +34,20 @@ class RemoveStudentUseCase( val student = queryStudentPort.queryStudentById(studentId) ?: throw StudentNotFoundException val studentUser = queryUserPort.queryUserById(studentId) ?: throw UserNotFoundException - if (student.schoolId != manager.schoolId) { - throw SchoolMismatchException + validateSameSchool(student.schoolId, manager.schoolId) + + // 잔류 내역 삭제 + commandRemainStatusPort.deleteByStudentId(studentId) + + // 자습실 신청 상태 제거 + queryStudyRoomPort.querySeatByStudentId(studentId)?.let { seat -> + val studyRoom = queryStudyRoomPort.queryStudyRoomById(seat.studyRoomId) ?: throw StudyRoomNotFoundException + commandStudyRoomPort.saveSeat( + seat.unUse() + ) + commandStudyRoomPort.saveStudyRoom( + studyRoom.unApply() + ) } // 잔류 내역 삭제 @@ -56,4 +68,4 @@ class RemoveStudentUseCase( studentUser.copy(deletedAt = LocalDateTime.now()) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCase.kt index 5a2dc94f6..4ebe2a1f2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCase.kt @@ -1,7 +1,6 @@ package team.aliens.dms.domain.manager.usecase import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException import team.aliens.dms.domain.auth.exception.AuthCodeNotFoundException import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.manager.dto.ResetManagerPasswordRequest @@ -36,12 +35,10 @@ class ResetManagerPasswordUseCase( val authCode = queryAuthCodePort.queryAuthCodeByEmail(request.email) ?: throw AuthCodeNotFoundException - if (authCode.code != request.authCode) { - throw AuthCodeMismatchException - } + authCode.validateAuthCode(request.authCode) commandUserPort.saveUser( user.copy(password = securityPort.encodePassword(request.newPassword)) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/dto/QueryMealsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/dto/QueryMealsResponse.kt index 5c47fd37b..be202a34e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/dto/QueryMealsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/dto/QueryMealsResponse.kt @@ -31,4 +31,4 @@ data class QueryMealsResponse( } } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealPort.kt index d469322c8..b1b429d47 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealPort.kt @@ -1,5 +1,4 @@ package team.aliens.dms.domain.meal.spi interface MealPort : - QueryMealPort { -} \ No newline at end of file + QueryMealPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealQueryStudentPort.kt index ccb95c035..b4ce68afe 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealQueryStudentPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface MealQueryStudentPort { fun queryStudentById(studentId: UUID): Student? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealSecurityPort.kt index 9e1d6f9f4..f566ae109 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/MealSecurityPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface MealSecurityPort { fun getCurrentUserId(): UUID - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/QueryMealPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/QueryMealPort.kt index e22dc6041..47cae6c84 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/QueryMealPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/spi/QueryMealPort.kt @@ -7,5 +7,4 @@ import java.util.UUID interface QueryMealPort { fun queryAllMealsByMonthAndSchoolId(firstDay: LocalDate, lastDay: LocalDate, schoolId: UUID): List - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCase.kt index 7854f4704..938d2137a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCase.kt @@ -45,4 +45,4 @@ class QueryMealsUseCase( return QueryMealsResponse(mealDetails) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/IsNotWriterException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/IsNotWriterException.kt index 19336345c..1bcb49804 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/IsNotWriterException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/IsNotWriterException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.notice.error.NoticeErrorCode object IsNotWriterException : DmsException( NoticeErrorCode.IS_NOT_WRITER -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/NoticeNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/NoticeNotFoundException.kt index 1b2cf07d6..564a1e989 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/NoticeNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/exception/NoticeNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.notice.error.NoticeErrorCode object NoticeNotFoundException : DmsException( NoticeErrorCode.NOTICE_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/CommandNoticePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/CommandNoticePort.kt index 731936c30..609cc7d59 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/CommandNoticePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/CommandNoticePort.kt @@ -7,5 +7,4 @@ interface CommandNoticePort { fun deleteNotice(notice: Notice) fun saveNotice(notice: Notice): Notice - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticePort.kt index 79e594356..9f0d68649 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticePort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.notice.spi interface NoticePort : QueryNoticePort, - CommandNoticePort { -} \ No newline at end of file + CommandNoticePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeQueryUserPort.kt index 9592ec743..10ea84590 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeQueryUserPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface NoticeQueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeSecurityPort.kt index 44eb75a5a..eb41a5801 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/NoticeSecurityPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface NoticeSecurityPort { fun getCurrentUserId(): UUID - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/QueryNoticePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/QueryNoticePort.kt index 300ebc023..e7444bd11 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/QueryNoticePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/spi/QueryNoticePort.kt @@ -14,5 +14,4 @@ interface QueryNoticePort { fun queryAllNoticesBySchoolIdAndOrder(schoolId: UUID, orderType: OrderType): List fun queryNoticeByIdAndManagerId(noticeId: UUID, managerId: UUID): Notice? - } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/CreateNoticeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/CreateNoticeUseCase.kt index d7fc8bb0e..9bd4aef50 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/CreateNoticeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/CreateNoticeUseCase.kt @@ -27,4 +27,4 @@ class CreateNoticeUseCase( return savedNotice.id } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCase.kt index ad913599b..c1faed8c4 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCase.kt @@ -33,4 +33,4 @@ class QueryAllNoticesUseCase( } ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCase.kt index b02212b4b..8bd0ddfb4 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCase.kt @@ -7,7 +7,7 @@ import team.aliens.dms.domain.notice.exception.NoticeNotFoundException import team.aliens.dms.domain.notice.spi.NoticeQueryUserPort import team.aliens.dms.domain.notice.spi.NoticeSecurityPort import team.aliens.dms.domain.notice.spi.QueryNoticePort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException import java.util.UUID @@ -25,9 +25,7 @@ class QueryNoticeDetailsUseCase( val writer = queryUserPort.queryUserById(notice.managerId) ?: throw ManagerNotFoundException val viewer = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - if (writer.schoolId != viewer.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(writer.schoolId, viewer.schoolId) return QueryNoticeDetailsResponse( title = notice.title, @@ -35,4 +33,4 @@ class QueryNoticeDetailsUseCase( createdAt = notice.createdAt!! ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCase.kt index e08a8a3bb..83575a67a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCase.kt @@ -14,8 +14,12 @@ class QueryNoticeStatusUseCase( **/ fun execute(): Boolean { val now = LocalDate.now() - val from = now.plusDays(7) + val from = now.plusDays(NOTICE_PERIOD) return queryNoticePort.existsNoticeByDateBetween(now, from) } -} \ No newline at end of file + + companion object { + private const val NOTICE_PERIOD: Long = 7 + } +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCase.kt index 5e64b12ea..91abbf2a5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCase.kt @@ -25,4 +25,4 @@ class RemoveNoticeUseCase( commandNoticePort.deleteNotice(notice) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCase.kt index 688c38f1e..25bffb627 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCase.kt @@ -16,7 +16,8 @@ class UpdateNoticeUseCase( fun execute(noticeId: UUID, title: String, content: String): UUID { val currentManagerId = securityPort.getCurrentUserId() - val notice = queryNoticePort.queryNoticeByIdAndManagerId(noticeId, currentManagerId) ?: throw NoticeNotFoundException + val notice = queryNoticePort.queryNoticeByIdAndManagerId(noticeId, currentManagerId) + ?: throw NoticeNotFoundException commandNoticePort.saveNotice( notice.copy( @@ -27,4 +28,4 @@ class UpdateNoticeUseCase( return notice.id } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/ExportAllPointHistoryResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/ExportAllPointHistoryResponse.kt index 70aef5c5e..84a93de00 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/ExportAllPointHistoryResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/ExportAllPointHistoryResponse.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.point.dto class ExportAllPointHistoryResponse( val fileName: String, val file: ByteArray -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/QueryAllPointHistoryResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/QueryAllPointHistoryResponse.kt index e0e887238..98bfc365e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/QueryAllPointHistoryResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/dto/QueryAllPointHistoryResponse.kt @@ -16,4 +16,4 @@ data class QueryAllPointHistoryResponse( val pointType: PointType, val pointScore: Int ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/InvalidPointFilterRangeException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/InvalidPointFilterRangeException.kt index de6eaec07..4329bb2d7 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/InvalidPointFilterRangeException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/InvalidPointFilterRangeException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.point.error.PointHistoryErrorCode object InvalidPointFilterRangeException : DmsException( PointHistoryErrorCode.INVALID_POINT_FILTER_RANGE -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNameExistsException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNameExistsException.kt index 33cc5322a..9bc99d268 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNameExistsException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNameExistsException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.point.error.PointOptionErrorCode object PointOptionNameExistsException : DmsException( PointOptionErrorCode.POINT_OPTION_NAME_EXISTS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNotFoundException.kt index 1c6f08403..4c1b41102 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionNotFoundException.kt @@ -3,6 +3,6 @@ package team.aliens.dms.domain.point.exception import team.aliens.dms.common.error.DmsException import team.aliens.dms.domain.point.error.PointOptionErrorCode -object PointOptionNotFoundException: DmsException( +object PointOptionNotFoundException : DmsException( PointOptionErrorCode.POINT_OPTION_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointHistoryPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointHistoryPort.kt index 7056aed55..effdb2bda 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointHistoryPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointHistoryPort.kt @@ -9,5 +9,4 @@ interface CommandPointHistoryPort { fun deletePointHistory(pointHistory: PointHistory) fun saveAllPointHistories(pointHistories: List) - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointOptionPort.kt index 1f39328f5..ef175f760 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/CommandPointOptionPort.kt @@ -6,4 +6,4 @@ interface CommandPointOptionPort { fun savePointOption(pointOption: PointOption): PointOption fun deletePointOption(pointOption: PointOption) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PhrasePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PhrasePort.kt index 5a6e3495f..75360d7d2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PhrasePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PhrasePort.kt @@ -1,5 +1,4 @@ package team.aliens.dms.domain.point.spi interface PhrasePort : - StudentQueryPhrasePort { -} \ No newline at end of file + StudentQueryPhrasePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointHistoryPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointHistoryPort.kt index 5b8ddfdf1..69022c160 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointHistoryPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointHistoryPort.kt @@ -7,5 +7,4 @@ interface PointHistoryPort : QueryPointHistoryPort, CommandPointHistoryPort, ManagerQueryPointHistoryPort, - StudentQueryPointHistoryPort { -} \ No newline at end of file + StudentQueryPointHistoryPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointOptionPort.kt index 1ba05ac94..76676f5c0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointOptionPort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.point.spi interface PointOptionPort : QueryPointOptionPort, - CommandPointOptionPort { -} \ No newline at end of file + CommandPointOptionPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryManagerPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryManagerPort.kt index 403a3b70a..a65652506 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryManagerPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryManagerPort.kt @@ -5,4 +5,4 @@ import java.util.UUID interface PointQueryManagerPort { fun queryManagerById(managerId: UUID): Manager? -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQuerySchoolPort.kt index c16789492..c229ac1f1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQuerySchoolPort.kt @@ -5,4 +5,4 @@ import java.util.UUID interface PointQuerySchoolPort { fun querySchoolById(schoolId: UUID): School? -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryStudentPort.kt index a2bc31261..884816f02 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryStudentPort.kt @@ -9,5 +9,4 @@ interface PointQueryStudentPort { fun queryStudentById(studentId: UUID): Student? fun queryStudentsWithPointHistory(studentIds: List): List - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryUserPort.kt index 652aa109f..0228ab08d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointQueryUserPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface PointQueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointSecurityPort.kt index db5d6dbeb..aa57985d2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/PointSecurityPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface PointSecurityPort { fun getCurrentUserId(): UUID - } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/QueryPointOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/QueryPointOptionPort.kt index fc5e9ca54..8b50df1de 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/QueryPointOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/QueryPointOptionPort.kt @@ -8,4 +8,4 @@ interface QueryPointOptionPort { fun queryPointOptionsBySchoolIdAndKeyword(schoolId: UUID, keyword: String?): List fun existByNameAndSchoolId(name: String, schoolId: UUID): Boolean -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/StudentQueryPhrasePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/StudentQueryPhrasePort.kt index c66f5c5cf..468a1c842 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/StudentQueryPhrasePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/StudentQueryPhrasePort.kt @@ -6,5 +6,4 @@ import team.aliens.dms.domain.point.model.PointType interface StudentQueryPhrasePort { fun queryPhraseAllByPointTypeAndStandardPoint(type: PointType, point: Int): List - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/vo/StudentWithPointVO.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/vo/StudentWithPointVO.kt index bc7b09d15..e7203d139 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/vo/StudentWithPointVO.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/spi/vo/StudentWithPointVO.kt @@ -14,10 +14,9 @@ data class StudentWithPointVO( val gcn: String = "${this.grade}${this.classRoom}${Student.processNumber(number)}" fun calculateUpdatedPointTotal(type: PointType, score: Int): Pair { - return if(type == PointType.BONUS) { + return if (type == PointType.BONUS) { Pair(this.bonusTotal + score, this.minusTotal) - } - else { + } else { Pair(this.bonusTotal, this.minusTotal + score) } } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CancelGrantedPointUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CancelGrantedPointUseCase.kt index 2bec2d7b8..6248fe46b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CancelGrantedPointUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CancelGrantedPointUseCase.kt @@ -6,7 +6,7 @@ import team.aliens.dms.domain.point.spi.CommandPointHistoryPort import team.aliens.dms.domain.point.spi.PointQueryUserPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointHistoryPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException import java.util.UUID @@ -22,13 +22,12 @@ class CancelGrantedPointUseCase( val currentUserId = securityPort.getCurrentUserId() val manager = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - val pointHistory = queryPointHistoryPort.queryPointHistoryById(pointHistoryId) ?: throw PointHistoryNotFoundException + val pointHistory = queryPointHistoryPort.queryPointHistoryById(pointHistoryId) + ?: throw PointHistoryNotFoundException - if (manager.schoolId != pointHistory.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(manager.schoolId, pointHistory.schoolId) commandPointHistoryPort.savePointHistory(pointHistory.cancelHistory()) commandPointHistoryPort.deletePointHistory(pointHistory) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CreatePointOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CreatePointOptionUseCase.kt index e33bcae56..f587104dd 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CreatePointOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/CreatePointOptionUseCase.kt @@ -40,4 +40,4 @@ class CreatePointOptionUseCase( return CreatePointOptionResponse(pointOption.id) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/ExportAllPointHistoryUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/ExportAllPointHistoryUseCase.kt index 42efb9db4..1e1d00b4e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/ExportAllPointHistoryUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/ExportAllPointHistoryUseCase.kt @@ -54,6 +54,6 @@ class ExportAllPointHistoryUseCase( val endDateString = end.format(File.FILE_DATE_FORMAT) - return "${school.name.replace(" ","")}_상벌점_부여내역_${startDateString}_${endDateString}" + return "${school.name.replace(" ","")}_상벌점_부여내역_${startDateString}_$endDateString" } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/GrantPointUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/GrantPointUseCase.kt index 01236fdb2..4cd2d66b6 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/GrantPointUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/GrantPointUseCase.kt @@ -10,7 +10,6 @@ import team.aliens.dms.domain.point.spi.PointQueryManagerPort import team.aliens.dms.domain.point.spi.PointQueryStudentPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointOptionPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException import team.aliens.dms.domain.student.exception.StudentNotFoundException import java.time.LocalDateTime @@ -33,7 +32,7 @@ class GrantPointUseCase( val students = queryStudentPort.queryStudentsWithPointHistory(request.studentIdList) - if(students.size != request.studentIdList.size) { + if (students.size != request.studentIdList.size) { throw StudentNotFoundException } @@ -59,4 +58,4 @@ class GrantPointUseCase( commandPointHistoryPort.saveAllPointHistories(pointHistories) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryAllPointHistoryUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryAllPointHistoryUseCase.kt index c9a1823d4..10361139e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryAllPointHistoryUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryAllPointHistoryUseCase.kt @@ -30,4 +30,4 @@ class QueryAllPointHistoryUseCase( return QueryAllPointHistoryResponse(pointHistories) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointHistoryUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointHistoryUseCase.kt index 6cf06d39b..f39ec5824 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointHistoryUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointHistoryUseCase.kt @@ -54,4 +54,4 @@ class QueryPointHistoryUseCase( } return totalPoint } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointOptionsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointOptionsUseCase.kt index c9651746d..958ab23ea 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointOptionsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryPointOptionsUseCase.kt @@ -30,4 +30,4 @@ class QueryPointOptionsUseCase( return QueryPointOptionsResponse(pointOptions) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryStudentPointHistoryUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryStudentPointHistoryUseCase.kt index ed61bc253..17bbacc20 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryStudentPointHistoryUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/QueryStudentPointHistoryUseCase.kt @@ -8,7 +8,7 @@ import team.aliens.dms.domain.point.spi.PointQueryManagerPort import team.aliens.dms.domain.point.spi.PointQueryStudentPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointHistoryPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.student.exception.StudentNotFoundException import java.util.UUID @@ -25,9 +25,8 @@ class QueryStudentPointHistoryUseCase( val manager = queryManagerPort.queryManagerById(currentUserId) ?: throw ManagerNotFoundException val student = queryStudentPort.queryStudentById(studentId) ?: throw StudentNotFoundException - if (student.schoolId != manager.schoolId) { - throw SchoolMismatchException - } + + validateSameSchool(manager.schoolId, student.schoolId) val pointHistories = queryPointHistoryPort.queryPointHistoryByStudentGcnAndNameAndType( studentName = student.name, @@ -38,4 +37,4 @@ class QueryStudentPointHistoryUseCase( return QueryStudentPointHistoryResponse(pointHistories) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/RemovePointOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/RemovePointOptionUseCase.kt index 101a4e29b..de1a98c96 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/RemovePointOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/RemovePointOptionUseCase.kt @@ -26,4 +26,4 @@ class RemovePointOptionUseCase( commandPointOptionPort.deletePointOption(pointOption) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/UpdatePointOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/UpdatePointOptionUseCase.kt index f1a3b22c0..8a4cce9d3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/UpdatePointOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/point/usecase/UpdatePointOptionUseCase.kt @@ -1,14 +1,14 @@ package team.aliens.dms.domain.point.usecase -import java.util.UUID import team.aliens.dms.common.annotation.UseCase import team.aliens.dms.domain.point.exception.PointOptionNotFoundException import team.aliens.dms.domain.point.spi.CommandPointOptionPort import team.aliens.dms.domain.point.spi.PointQueryUserPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointOptionPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException +import java.util.UUID @UseCase class UpdatePointOptionUseCase( @@ -23,9 +23,8 @@ class UpdatePointOptionUseCase( val manager = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException val pointOption = queryPointOptionPort.queryPointOptionById(pointOptionId) ?: throw PointOptionNotFoundException - if(pointOption.schoolId != manager.schoolId) { - throw SchoolMismatchException - } + + validateSameSchool(pointOption.schoolId, manager.schoolId) commandPointOptionPort.savePointOption( pointOption.copy( @@ -34,4 +33,4 @@ class UpdatePointOptionUseCase( ) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryCurrentAppliedRemainOptionResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryCurrentAppliedRemainOptionResponse.kt index 5cc3d668d..26acfc9e3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryCurrentAppliedRemainOptionResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryCurrentAppliedRemainOptionResponse.kt @@ -2,4 +2,4 @@ package team.aliens.dms.domain.remain.dto data class QueryCurrentAppliedRemainOptionResponse( val title: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryRemainOptionsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryRemainOptionsResponse.kt index 27c70db6c..271248d31 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryRemainOptionsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/QueryRemainOptionsResponse.kt @@ -12,4 +12,4 @@ data class QueryRemainOptionsResponse( val description: String, val isApplied: Boolean ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/RemainStatusInfo.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/RemainStatusInfo.kt index 4b25b2b0d..507f06c4c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/RemainStatusInfo.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/RemainStatusInfo.kt @@ -2,7 +2,7 @@ package team.aliens.dms.domain.remain.dto import java.util.UUID -class RemainStatusInfo ( +class RemainStatusInfo( val studentId: UUID, val optionName: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/StudentRemainInfo.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/StudentRemainInfo.kt index 0a6c4a1ef..beb54b5cd 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/StudentRemainInfo.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/StudentRemainInfo.kt @@ -8,4 +8,4 @@ data class StudentRemainInfo( val studentSex: Sex, val roomNumber: Int, val optionName: String? -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/UpdateRemainAvailableTimeRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/UpdateRemainAvailableTimeRequest.kt index 5f85d4cd4..242798d98 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/UpdateRemainAvailableTimeRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/UpdateRemainAvailableTimeRequest.kt @@ -13,4 +13,4 @@ data class UpdateRemainAvailableTimeRequest( val endTime: LocalTime -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/ExportRemainStatusResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/ExportRemainStatusResponse.kt index 00f599230..318de91ad 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/ExportRemainStatusResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/ExportRemainStatusResponse.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.remain.dto.response class ExportRemainStatusResponse( val fileName: String, val file: ByteArray -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeCanNotAccessException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeCanNotAccessException.kt index 484fbf755..6b8ec7aa2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeCanNotAccessException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeCanNotAccessException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.remain.error.RemainAvailableTimeErrorCode object RemainAvailableTimeCanNotAccessException : DmsException( RemainAvailableTimeErrorCode.REMAIN_AVAILABLE_TIME_CAN_NOT_ACCESS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeNotFoundException.kt index 6a878a7bd..a77833545 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainAvailableTimeNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.remain.error.RemainAvailableTimeErrorCode object RemainAvailableTimeNotFoundException : DmsException( RemainAvailableTimeErrorCode.REMAIN_AVAILABLE_TIME_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainCanNotAppliedException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainCanNotAppliedException.kt index 5ddf6150a..031184a28 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainCanNotAppliedException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainCanNotAppliedException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.remain.error.RemainAvailableTimeErrorCode object RemainCanNotAppliedException : DmsException( RemainAvailableTimeErrorCode.REMAIN_CAN_NOT_APPLIED -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainOptionNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainOptionNotFoundException.kt index 34db3f200..b0466ed76 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainOptionNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainOptionNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.remain.error.RemainOptionErrorCode object RemainOptionNotFoundException : DmsException( RemainOptionErrorCode.REMAIN_OPTION_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainStatusNotFound.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainStatusNotFound.kt index afac81cc7..58919860d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainStatusNotFound.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/exception/RemainStatusNotFound.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.remain.error.RemainStatusErrorCode object RemainStatusNotFound : DmsException( RemainStatusErrorCode.REMAIN_STATUS_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainAvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainAvailableTimePort.kt index 2566a610c..68d6d5398 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainAvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainAvailableTimePort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.remain.model.RemainAvailableTime interface CommandRemainAvailableTimePort { fun saveRemainAvailableTime(remainAvailableTime: RemainAvailableTime): RemainAvailableTime - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainOptionPort.kt index 3e4e7b53f..0079d18a1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainOptionPort.kt @@ -7,4 +7,4 @@ interface CommandRemainOptionPort { fun saveRemainOption(remainOption: RemainOption): RemainOption fun deleteRemainOption(remainOption: RemainOption) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainStatusPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainStatusPort.kt index 3fff49d74..ef0829ea3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainStatusPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/CommandRemainStatusPort.kt @@ -8,4 +8,4 @@ interface CommandRemainStatusPort { fun deleteRemainStatusByRemainOptionId(remainOptionId: UUID) fun saveRemainStatus(remainStatus: RemainStatus): RemainStatus -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainAvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainAvailableTimePort.kt index a4f964e65..48f58e459 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainAvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainAvailableTimePort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface QueryRemainAvailableTimePort { fun queryRemainAvailableTimeBySchoolId(schoolId: UUID): RemainAvailableTime? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainOptionPort.kt index cf9e9661c..ec6b546ce 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainOptionPort.kt @@ -8,5 +8,4 @@ interface QueryRemainOptionPort { fun queryRemainOptionById(remainOptionId: UUID): RemainOption? fun queryAllRemainOptionsBySchoolId(schoolId: UUID): List - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainStatusPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainStatusPort.kt index 0048af6c6..78d5955f2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainStatusPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/QueryRemainStatusPort.kt @@ -7,7 +7,6 @@ import java.util.UUID interface QueryRemainStatusPort { fun queryByStudentIdIn(studentIds: List): List - + fun queryRemainStatusById(userId: UUID): RemainStatus? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainAvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainAvailableTimePort.kt index 6ac331c0e..557ed4cb4 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainAvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainAvailableTimePort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.remain.spi interface RemainAvailableTimePort : CommandRemainAvailableTimePort, - QueryRemainAvailableTimePort { -} \ No newline at end of file + QueryRemainAvailableTimePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainOptionPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainOptionPort.kt index 261c041f4..f303c59a1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainOptionPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainOptionPort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.remain.spi interface RemainOptionPort : CommandRemainOptionPort, - QueryRemainOptionPort { -} \ No newline at end of file + QueryRemainOptionPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQuerySchoolPort.kt index ffec122b7..9b43f70aa 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQuerySchoolPort.kt @@ -5,4 +5,4 @@ import java.util.UUID interface RemainQuerySchoolPort { fun querySchoolById(schoolId: UUID): School? -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryStudentPort.kt index 6963ded82..a43e2e89b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryStudentPort.kt @@ -5,4 +5,4 @@ import java.util.UUID interface RemainQueryStudentPort { fun queryStudentsBySchoolId(schoolId: UUID): List -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryUserPort.kt index b62acd085..b37e46468 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainQueryUserPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface RemainQueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainSecurityPort.kt index e3c484b66..376656ed9 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/spi/RemainSecurityPort.kt @@ -5,4 +5,4 @@ import java.util.UUID interface RemainSecurityPort { fun getCurrentUserId(): UUID -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCase.kt index 2b0b197aa..4c462203e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCase.kt @@ -10,7 +10,7 @@ import team.aliens.dms.domain.remain.spi.QueryRemainAvailableTimePort import team.aliens.dms.domain.remain.spi.QueryRemainOptionPort import team.aliens.dms.domain.remain.spi.RemainQueryUserPort import team.aliens.dms.domain.remain.spi.RemainSecurityPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException import java.time.LocalDateTime import java.util.UUID @@ -29,11 +29,10 @@ class ApplyRemainUseCase( val currentUserId = securityPort.getCurrentUserId() val currentUser = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) ?: throw RemainOptionNotFoundException + val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) + ?: throw RemainOptionNotFoundException - if (remainOption.schoolId != currentUser.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(remainOption.schoolId, currentUser.schoolId) val remainAvailableTime = queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(currentUser.schoolId) ?: throw RemainAvailableTimeNotFoundException @@ -50,4 +49,4 @@ class ApplyRemainUseCase( ) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainOptionUseCase.kt index 55ba75cd9..2673c929f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainOptionUseCase.kt @@ -9,7 +9,7 @@ import team.aliens.dms.domain.user.spi.QueryUserPort import java.util.UUID @UseCase -class CreateRemainOptionUseCase ( +class CreateRemainOptionUseCase( private val securityPort: RemainSecurityPort, private val queryUserPort: QueryUserPort, private val commentRemainOptionPort: CommandRemainOptionPort @@ -30,4 +30,4 @@ class CreateRemainOptionUseCase ( return savedRemainOption.id } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCase.kt index 949803973..8c7e4b4ae 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCase.kt @@ -55,4 +55,4 @@ class ExportRemainStatusUseCase( private fun getFileName(school: School) = "${school.name.replace(" ", "")}_잔류_신청결과_${LocalDateTime.now().format(File.FILE_DATE_FORMAT)}" -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCase.kt index f0ea8b9b5..221066c00 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCase.kt @@ -28,4 +28,4 @@ class QueryCurrentAppliedRemainOptionUseCase( title = appliedRemainOption.title ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCase.kt index d4459ae51..b194cd7bd 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCase.kt @@ -29,4 +29,4 @@ class QueryRemainAvailableTimeUseCase( endTime = availableTime.endTime ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCase.kt index 2830fd180..2a8fb2a0e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCase.kt @@ -37,4 +37,4 @@ class QueryRemainOptionsUseCase( remainOptions = remainOptions ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCase.kt index 86fb03b21..a9c970a4d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCase.kt @@ -7,7 +7,7 @@ import team.aliens.dms.domain.remain.spi.CommandRemainStatusPort import team.aliens.dms.domain.remain.spi.QueryRemainOptionPort import team.aliens.dms.domain.remain.spi.RemainQueryUserPort import team.aliens.dms.domain.remain.spi.RemainSecurityPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException import java.util.UUID @@ -24,13 +24,12 @@ class RemoveRemainOptionUseCase( val currentUserId = securityPort.getCurrentUserId() val manager = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) ?: throw RemainOptionNotFoundException + val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) + ?: throw RemainOptionNotFoundException - if (remainOption.schoolId != manager.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(remainOption.schoolId, manager.schoolId) commandRemainStatusPort.deleteRemainStatusByRemainOptionId(remainOption.id) commandRemainOptionPort.deleteRemainOption(remainOption) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCase.kt index 82e13a6e3..6291842d5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCase.kt @@ -29,4 +29,4 @@ class UpdateRemainAvailableTimeUseCase( ) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCase.kt index fb3f79f1b..59dd6322b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCase.kt @@ -6,7 +6,7 @@ import team.aliens.dms.domain.remain.spi.CommandRemainOptionPort import team.aliens.dms.domain.remain.spi.QueryRemainOptionPort import team.aliens.dms.domain.remain.spi.RemainQueryUserPort import team.aliens.dms.domain.remain.spi.RemainSecurityPort -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.user.exception.UserNotFoundException import java.util.UUID @@ -22,11 +22,10 @@ class UpdateRemainOptionUseCase( val currentUserId = securityPort.getCurrentUserId() val manager = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) ?: throw RemainOptionNotFoundException + val remainOption = queryRemainOptionPort.queryRemainOptionById(remainOptionId) + ?: throw RemainOptionNotFoundException - if (remainOption.schoolId != manager.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(remainOption.schoolId, manager.schoolId) commendRemainOptionPort.saveRemainOption( remainOption.copy( diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/room/exception/RoomNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/room/exception/RoomNotFoundException.kt index 42ba87a10..f93877f5e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/room/exception/RoomNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/room/exception/RoomNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.room.error.RoomErrorCode object RoomNotFoundException : DmsException( RoomErrorCode.ROOM_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/room/spi/RoomPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/room/spi/RoomPort.kt index 5812b89fa..9bbe633c5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/room/spi/RoomPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/room/spi/RoomPort.kt @@ -3,5 +3,4 @@ package team.aliens.dms.domain.room.spi import team.aliens.dms.domain.student.spi.StudentQueryRoomPort interface RoomPort : - StudentQueryRoomPort { -} \ No newline at end of file + StudentQueryRoomPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/SchoolExtension.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/SchoolExtension.kt new file mode 100644 index 000000000..bf5b89f9a --- /dev/null +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/SchoolExtension.kt @@ -0,0 +1,10 @@ +package team.aliens.dms.domain.school + +import team.aliens.dms.domain.school.exception.SchoolMismatchException +import java.util.UUID + +fun validateSameSchool(sId1: UUID, sId2: UUID) { + if (sId1 != sId2) { + throw SchoolMismatchException + } +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/AnswerMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/AnswerMismatchException.kt index 9a53f9433..00f9679bb 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/AnswerMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/AnswerMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.school.error.SchoolErrorCode object AnswerMismatchException : DmsException( SchoolErrorCode.ANSWER_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/FeatureNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/FeatureNotFoundException.kt index 779024001..2aacf3dcc 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/FeatureNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/FeatureNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.school.error.SchoolErrorCode object FeatureNotFoundException : DmsException( SchoolErrorCode.FEATURE_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolCodeMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolCodeMismatchException.kt index 63abee782..7baf1856e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolCodeMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolCodeMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.school.error.SchoolErrorCode object SchoolCodeMismatchException : DmsException( SchoolErrorCode.SCHOOL_CODE_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolMismatchException.kt index 0ac0878aa..52fe8251a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.school.error.SchoolErrorCode object SchoolMismatchException : DmsException( SchoolErrorCode.SCHOOL_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolNotFoundException.kt index 929ca6735..2290cb59d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/exception/SchoolNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.school.error.SchoolErrorCode object SchoolNotFoundException : DmsException( SchoolErrorCode.SCHOOL_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/CommandSchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/CommandSchoolPort.kt index 6a576c58c..919ae2510 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/CommandSchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/CommandSchoolPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.school.model.School interface CommandSchoolPort { fun saveSchool(school: School): School - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/QuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/QuerySchoolPort.kt index 15f8602f3..d68ad1f64 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/QuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/QuerySchoolPort.kt @@ -10,5 +10,4 @@ interface QuerySchoolPort { fun querySchoolById(schoolId: UUID): School? fun querySchoolByCode(code: String): School? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolPort.kt index 9ff1971d5..30295b53f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolPort.kt @@ -15,5 +15,4 @@ interface SchoolPort : AuthQuerySchoolPort, StudyRoomQuerySchoolPort, PointQuerySchoolPort, - RemainQuerySchoolPort { -} \ No newline at end of file + RemainQuerySchoolPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolQueryUserPort.kt index 1dc126b34..98646d085 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolQueryUserPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface SchoolQueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolSecurityPort.kt index 85c410e87..0036b541e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/spi/SchoolSecurityPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface SchoolSecurityPort { fun getCurrentUserId(): UUID - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCase.kt index d38d682ab..bba3f4e0b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCase.kt @@ -18,4 +18,4 @@ class CheckSchoolAnswerUseCase( throw AnswerMismatchException } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCase.kt index dbbba535d..455f48113 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCase.kt @@ -15,4 +15,4 @@ class CheckSchoolCodeUseCase( return school.id } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCase.kt index edbb49c1f..06959343e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCase.kt @@ -15,4 +15,4 @@ class QuerySchoolQuestionUseCase( return school.question } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCase.kt index 7374b316c..28e61745c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCase.kt @@ -22,4 +22,4 @@ class QuerySchoolsUseCase( return SchoolsResponse(result) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCase.kt index 91f53b867..fdca81b6f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCase.kt @@ -3,6 +3,7 @@ package team.aliens.dms.domain.school.usecase import team.aliens.dms.common.annotation.UseCase import team.aliens.dms.common.util.StringUtil import team.aliens.dms.domain.school.exception.SchoolNotFoundException +import team.aliens.dms.domain.school.model.School import team.aliens.dms.domain.school.spi.CommandSchoolPort import team.aliens.dms.domain.school.spi.QuerySchoolPort import team.aliens.dms.domain.school.spi.SchoolQueryUserPort @@ -22,7 +23,7 @@ class ReissueSchoolCodeUseCase( val user = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException val school = querySchoolPort.querySchoolById(user.schoolId) ?: throw SchoolNotFoundException - val code = StringUtil.randomNumber(8) + val code = StringUtil.randomNumber(School.SCHOOL_CODE_SIZE) commandSchoolPort.saveSchool( school.copy(code = code) @@ -30,4 +31,4 @@ class ReissueSchoolCodeUseCase( return code } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCase.kt index 6b64655c6..ee6456f19 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCase.kt @@ -30,4 +30,4 @@ class UpdateQuestionUseCase( ) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/dto/SignUpRequest.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/dto/SignUpRequest.kt index f19a3abe7..3c3347b42 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/dto/SignUpRequest.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/dto/SignUpRequest.kt @@ -11,4 +11,4 @@ data class SignUpRequest( val password: String, val email: String, val profileImageUrl: String? -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentInfoMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentInfoMismatchException.kt index 0dc7ce6ad..857ed5aaf 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentInfoMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentInfoMismatchException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.student.exception -import team.aliens.dms.domain.student.error.StudentErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.student.error.StudentErrorCode object StudentInfoMismatchException : DmsException( StudentErrorCode.STUDENT_INFO_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentNotFoundException.kt index b5294a92c..abd3d1c73 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/StudentNotFoundException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.student.exception -import team.aliens.dms.domain.student.error.StudentErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.student.error.StudentErrorCode object StudentNotFoundException : DmsException( StudentErrorCode.STUDENT_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/VerifiedStudentNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/VerifiedStudentNotFoundException.kt index 73b03f525..ca5b4ba15 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/VerifiedStudentNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/exception/VerifiedStudentNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.student.error.VerifiedStudentErrorCode object VerifiedStudentNotFoundException : DmsException( VerifiedStudentErrorCode.VERIFIED_STUDENT_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/CommandStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/CommandStudentPort.kt index 1e0159806..def55cb4f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/CommandStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/CommandStudentPort.kt @@ -11,4 +11,4 @@ interface CommandStudentPort { fun deleteVerifiedStudent(verifiedStudent: VerifiedStudent) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/QueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/QueryStudentPort.kt index fa29f4d4f..250a20282 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/QueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/QueryStudentPort.kt @@ -8,5 +8,4 @@ interface QueryStudentPort { fun queryStudentBySchoolIdAndGcn(schoolId: UUID, grade: Int, classRoom: Int, number: Int): Student? fun queryStudentById(studentId: UUID): Student? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentCommandUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentCommandUserPort.kt index 32975a35a..a3c9de64f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentCommandUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentCommandUserPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.user.model.User interface StudentCommandUserPort { fun saveUser(user: User): User - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentJwtPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentJwtPort.kt index d3216accb..63ddc8fb1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentJwtPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentJwtPort.kt @@ -7,5 +7,4 @@ import java.util.UUID interface StudentJwtPort { fun receiveToken(userId: UUID, authority: Authority): TokenResponse - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentPort.kt index ca4488693..3de414d06 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentPort.kt @@ -17,5 +17,4 @@ interface StudentPort : ManagerQueryStudentPort, StudyRoomQueryStudentPort, PointQueryStudentPort, - RemainQueryStudentPort { -} \ No newline at end of file + RemainQueryStudentPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryAuthCodePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryAuthCodePort.kt index ceb375d99..04cc69a3c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryAuthCodePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryAuthCodePort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.auth.model.AuthCode interface StudentQueryAuthCodePort { fun queryAuthCodeByEmail(email: String): AuthCode? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryPointHistoryPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryPointHistoryPort.kt index a87536f3d..929f557ad 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryPointHistoryPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryPointHistoryPort.kt @@ -3,5 +3,4 @@ package team.aliens.dms.domain.student.spi interface StudentQueryPointHistoryPort { fun queryBonusAndMinusTotalPointByStudentGcnAndName(gcn: String, studentName: String): Pair - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryRoomPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryRoomPort.kt index ec6fda3a4..901f6ddfa 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryRoomPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryRoomPort.kt @@ -1,10 +1,9 @@ package team.aliens.dms.domain.student.spi -import java.util.UUID import team.aliens.dms.domain.room.model.Room +import java.util.UUID interface StudentQueryRoomPort { fun queryRoomBySchoolIdAndNumber(schoolId: UUID, number: Int): Room? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQuerySchoolPort.kt index de4786764..90d7a20fa 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQuerySchoolPort.kt @@ -11,5 +11,4 @@ interface StudentQuerySchoolPort { fun querySchoolById(schoolId: UUID): School? fun queryAvailableFeaturesBySchoolId(schoolId: UUID): AvailableFeature? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryUserPort.kt index 7e9f04232..a27692574 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryUserPort.kt @@ -12,5 +12,4 @@ interface StudentQueryUserPort { fun queryUserById(userId: UUID): User? fun queryUserByAccountId(accountId: String): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryVerifiedStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryVerifiedStudentPort.kt index f58f1f44b..f3e352151 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryVerifiedStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentQueryVerifiedStudentPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.student.model.VerifiedStudent interface StudentQueryVerifiedStudentPort { fun queryVerifiedStudentByGcnAndSchoolName(gcn: String, schoolName: String): VerifiedStudent? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentSecurityPort.kt index b069955cc..cba016494 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/StudentSecurityPort.kt @@ -7,5 +7,4 @@ interface StudentSecurityPort { fun encodePassword(password: String): String fun getCurrentUserId(): UUID - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/VerifiedStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/VerifiedStudentPort.kt index b3a4e730d..b076a7a27 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/VerifiedStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/spi/VerifiedStudentPort.kt @@ -1,5 +1,4 @@ package team.aliens.dms.domain.student.spi interface VerifiedStudentPort : - StudentQueryVerifiedStudentPort { -} \ No newline at end of file + StudentQueryVerifiedStudentPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCase.kt index 8945f0426..c7d386f61 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCase.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.student.usecase +import team.aliens.dms.common.annotation.ReadOnlyUseCase import team.aliens.dms.domain.student.spi.StudentQueryUserPort import team.aliens.dms.domain.user.exception.UserAccountIdExistsException -import team.aliens.dms.common.annotation.ReadOnlyUseCase @ReadOnlyUseCase class CheckDuplicatedAccountIdUseCase( @@ -14,4 +14,4 @@ class CheckDuplicatedAccountIdUseCase( throw UserAccountIdExistsException } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCase.kt index 7694a5dd0..17bfe263e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCase.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.student.usecase -import team.aliens.dms.domain.user.exception.UserEmailExistsException -import team.aliens.dms.domain.student.spi.StudentQueryUserPort import team.aliens.dms.common.annotation.ReadOnlyUseCase +import team.aliens.dms.domain.student.spi.StudentQueryUserPort +import team.aliens.dms.domain.user.exception.UserEmailExistsException @ReadOnlyUseCase class CheckDuplicatedEmailUseCase( @@ -14,4 +14,4 @@ class CheckDuplicatedEmailUseCase( throw UserEmailExistsException } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCase.kt index 33a3f1c2e..8d1e73a69 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCase.kt @@ -24,4 +24,4 @@ class CheckStudentGcnUseCase( return verifiedStudent.name } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCase.kt index 245e617d1..08059c2bc 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCase.kt @@ -44,4 +44,4 @@ class FindStudentAccountIdUseCase( return StringUtil.coveredEmail(user.email) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCase.kt index 732f1c92d..49f484a35 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCase.kt @@ -1,7 +1,6 @@ package team.aliens.dms.domain.student.usecase import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException import team.aliens.dms.domain.auth.exception.AuthCodeNotFoundException import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.student.dto.ResetStudentPasswordRequest @@ -12,6 +11,7 @@ import team.aliens.dms.domain.student.spi.StudentCommandUserPort import team.aliens.dms.domain.student.spi.StudentQueryAuthCodePort import team.aliens.dms.domain.student.spi.StudentQueryUserPort import team.aliens.dms.domain.student.spi.StudentSecurityPort +import team.aliens.dms.domain.user.exception.InvalidRoleException import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.service.CheckUserAuthority @@ -30,7 +30,7 @@ class ResetStudentPasswordUseCase( val student = queryStudentPort.queryStudentById(user.id) ?: throw StudentNotFoundException if (checkUserAuthority.execute(user.id) != Authority.STUDENT) { - throw StudentNotFoundException + throw InvalidRoleException } if (student.name != request.name || user.email != request.email) { @@ -39,12 +39,10 @@ class ResetStudentPasswordUseCase( val authCode = queryAuthCodePort.queryAuthCodeByEmail(user.email) ?: throw AuthCodeNotFoundException - if (authCode.code != request.authCode) { - throw AuthCodeMismatchException - } + authCode.validateAuthCode(request.authCode) commandUserPort.saveUser( user.copy(password = securityPort.encodePassword(request.newPassword)) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCase.kt index 3da4a4fe6..6fc793900 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCase.kt @@ -8,6 +8,7 @@ import team.aliens.dms.domain.room.exception.RoomNotFoundException import team.aliens.dms.domain.school.exception.AnswerMismatchException import team.aliens.dms.domain.school.exception.FeatureNotFoundException import team.aliens.dms.domain.school.exception.SchoolCodeMismatchException +import team.aliens.dms.domain.school.model.School import team.aliens.dms.domain.student.dto.SignUpRequest import team.aliens.dms.domain.student.dto.SignUpResponse import team.aliens.dms.domain.student.exception.VerifiedStudentNotFoundException @@ -55,30 +56,10 @@ class SignUpUseCase( accountId, password, email, profileImageUrl ) = request - val school = querySchoolPort.querySchoolByCode(schoolCode) ?: throw SchoolCodeMismatchException - - /** - * 학교 확인 질문 답변 검사 - **/ - if (school.answer != schoolAnswer) { - throw AnswerMismatchException - } - - /** - * 이메일 중복 검사 - **/ - if (queryUserPort.existsUserByEmail(email)) { - throw UserEmailExistsException - } - - /** - * 이메일 인증코드 검사 - **/ - val authCodeEntity = queryAuthCodePort.queryAuthCodeByEmail(email) ?: throw AuthCodeNotFoundException + val school = validateSchool(schoolCode, schoolAnswer) - if (authCode != authCodeEntity.code) { - throw AuthCodeMismatchException - } + validateAuthCode(authCode, email) + validateUserDuplicated(accountId, email) val gcn = "${grade}${classRoom}${Student.processNumber(number)}" @@ -98,13 +79,6 @@ class SignUpUseCase( number = verifiedStudent.roomNumber ) ?: throw RoomNotFoundException - /** - * 아이디 중복 검사 - **/ - if (queryUserPort.existsUserByAccountId(accountId)) { - throw UserAccountIdExistsException - } - val user = commandUserPort.saveUser( createUser( schoolId = school.id, @@ -129,7 +103,9 @@ class SignUpUseCase( commandStudentPort.saveStudent(student) commandStudentPort.deleteVerifiedStudent(verifiedStudent) - val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken(user.id, Authority.STUDENT) + val (accessToken, accessTokenExpiredAt, refreshToken, refreshTokenExpiredAt) = jwtPort.receiveToken( + userId = user.id, authority = Authority.STUDENT + ) val availableFeatures = querySchoolPort.queryAvailableFeaturesBySchoolId(user.schoolId) ?: throw FeatureNotFoundException @@ -150,6 +126,46 @@ class SignUpUseCase( ) } + private fun validateAuthCode(authCode: String, email: String) { + /** + * 이메일 인증코드 검사 + **/ + val authCodeEntity = queryAuthCodePort.queryAuthCodeByEmail(email) ?: throw AuthCodeNotFoundException + + if (authCode != authCodeEntity.code) { + throw AuthCodeMismatchException + } + } + + private fun validateSchool(schoolCode: String, schoolAnswer: String): School { + val school = querySchoolPort.querySchoolByCode(schoolCode) ?: throw SchoolCodeMismatchException + + /** + * 학교 확인 질문 답변 검사 + **/ + if (school.answer != schoolAnswer) { + throw AnswerMismatchException + } + + return school + } + + private fun validateUserDuplicated(accountId: String, email: String) { + /** + * 아이디 중복 검사 + **/ + if (queryUserPort.existsUserByAccountId(accountId)) { + throw UserAccountIdExistsException + } + + /** + * 이메일 중복 검사 + **/ + if (queryUserPort.existsUserByEmail(email)) { + throw UserEmailExistsException + } + } + private fun createUser( schoolId: UUID, accountId: String, @@ -164,4 +180,4 @@ class SignUpUseCase( createdAt = LocalDateTime.now(), deletedAt = null ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCase.kt index 67519bcea..021e662b4 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCase.kt @@ -55,11 +55,11 @@ class StudentMyPageUseCase( .plus(bonusPhrase) .plus(minusPhrase) - val phrase = if(phrases.isNotEmpty()) { + val phrase = if (phrases.isNotEmpty()) { val randomIndex = SecureRandom().nextInt(phrases.size) phrases[randomIndex].content } else Phrase.NO_PHRASE return phrase } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCase.kt index 47dc3b0d6..d20d5b47b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCase.kt @@ -21,4 +21,4 @@ class UpdateStudentProfileUseCase( student.copy(profileImageUrl = profileImageUrl) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomResponse.kt index ec8abe7d2..1acc2bf66 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomResponse.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.studyroom.dto -import java.util.UUID import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.studyroom.model.SeatStatus +import java.util.UUID data class ManagerQueryStudyRoomResponse( val floor: Int, @@ -43,4 +43,3 @@ data class ManagerQueryStudyRoomResponse( ) } } - diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomsResponse.kt index 08ba4a59e..58c4d970b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/ManagerQueryStudyRoomsResponse.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.dto -import java.util.UUID import team.aliens.dms.domain.student.model.Sex +import java.util.UUID data class ManagerQueryStudyRoomsResponse( val studyRooms: List @@ -16,4 +16,4 @@ data class ManagerQueryStudyRoomsResponse( val inUseHeadcount: Int, val totalAvailableSeat: Int ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QueryCurrentAppliedStudyRoomResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QueryCurrentAppliedStudyRoomResponse.kt index 54710b4b3..b9d4ad648 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QueryCurrentAppliedStudyRoomResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QueryCurrentAppliedStudyRoomResponse.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.studyroom.dto data class QueryCurrentAppliedStudyRoomResponse( val floor: Int, val name: String -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QuerySeatTypesResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QuerySeatTypesResponse.kt index eb48066f8..24c3413a0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QuerySeatTypesResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/QuerySeatTypesResponse.kt @@ -11,4 +11,4 @@ data class QuerySeatTypesResponse( val name: String, val color: String ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomResponse.kt index 8b3193ea5..9f7380a50 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomResponse.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.studyroom.dto -import java.util.UUID import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.studyroom.model.SeatStatus +import java.util.UUID data class StudentQueryStudyRoomResponse( val floor: Int, diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomsResponse.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomsResponse.kt index 23301b3de..6f348ff80 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomsResponse.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/StudentQueryStudyRoomsResponse.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.dto -import java.util.UUID import team.aliens.dms.domain.student.model.Sex +import java.util.UUID data class StudentQueryStudyRoomsResponse( val studyRooms: List @@ -17,4 +17,4 @@ data class StudentQueryStudyRoomsResponse( val totalAvailableSeat: Int, val isMine: Boolean ) -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AppliedSeatNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AppliedSeatNotFoundException.kt index 67fa54ca3..0179d79f5 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AppliedSeatNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AppliedSeatNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatErrorCode object AppliedSeatNotFoundException : DmsException( SeatErrorCode.APPLIED_SEAT_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AvailableTimeNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AvailableTimeNotFoundException.kt index f6bfbf61d..2f67ff7ec 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AvailableTimeNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/AvailableTimeNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.AvailableTimeErrorCode object AvailableTimeNotFoundException : DmsException( AvailableTimeErrorCode.AVAILABLE_TIME_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatCanNotAppliedException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatCanNotAppliedException.kt index df9545ddc..2de3931bd 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatCanNotAppliedException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatCanNotAppliedException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatErrorCode object SeatCanNotAppliedException : DmsException( SeatErrorCode.SEAT_CAN_NOT_APPLY -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatNotFoundException.kt index 3f1de0a55..97c5d13b2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatErrorCode object SeatNotFoundException : DmsException( SeatErrorCode.SEAT_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeAlreadyExistsException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeAlreadyExistsException.kt index 120927a40..b1c69da50 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeAlreadyExistsException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeAlreadyExistsException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatTypeErrorCode object SeatTypeAlreadyExistsException : DmsException( SeatTypeErrorCode.SEAT_TYPE_ALREADY_EXISTS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeInUseException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeInUseException.kt index bd7518f57..2566bcbff 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeInUseException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeInUseException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatTypeErrorCode object SeatTypeInUseException : DmsException( SeatTypeErrorCode.SEAT_TYPE_IN_USE -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeNotFoundException.kt index ce40a7700..bee8cd476 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatTypeNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatTypeErrorCode object SeatTypeNotFoundException : DmsException( SeatTypeErrorCode.SEAT_TYPE_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAlreadyExistsException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAlreadyExistsException.kt index c52f28740..c9adf6c2f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAlreadyExistsException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAlreadyExistsException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.StudyRoomErrorCode object StudyRoomAlreadyExistsException : DmsException( StudyRoomErrorCode.STUDY_ROOM_ALREADY_EXISTS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableGradeMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableGradeMismatchException.kt index fd9add5b0..36e60916a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableGradeMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableGradeMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.StudyRoomErrorCode object StudyRoomAvailableGradeMismatchException : DmsException( StudyRoomErrorCode.STUDY_ROOM_AVAILABLE_GRADE_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableSexMismatchException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableSexMismatchException.kt index dd4fe138d..077751533 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableSexMismatchException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomAvailableSexMismatchException.kt @@ -6,4 +6,4 @@ import team.aliens.dms.domain.studyroom.error.StudyRoomErrorCode object StudyRoomAvailableSexMismatchException : DmsException( StudyRoomErrorCode.STUDY_ROOM_AVAILABLE_SEX_MISMATCH -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomNotFoundException.kt index b66c35db0..d25d1913a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/StudyRoomNotFoundException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.StudyRoomErrorCode object StudyRoomNotFoundException : DmsException( StudyRoomErrorCode.STUDY_ROOM_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/AvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/AvailableTimePort.kt index 1d0782204..524d9ea6f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/AvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/AvailableTimePort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.studyroom.spi interface AvailableTimePort : QueryAvailableTimePort, - CommandAvailableTimePort { -} \ No newline at end of file + CommandAvailableTimePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandAvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandAvailableTimePort.kt index 8b34fe732..4b239bf2e 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandAvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandAvailableTimePort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.studyroom.model.AvailableTime interface CommandAvailableTimePort { fun saveAvailableTime(availableTime: AvailableTime): AvailableTime - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandSeatTypePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandSeatTypePort.kt index 6fc09b5d9..4230a3faf 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandSeatTypePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandSeatTypePort.kt @@ -7,5 +7,4 @@ interface CommandSeatTypePort { fun saveSeatType(seatType: SeatType): SeatType fun deleteSeatType(seatType: SeatType) - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandStudyRoomPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandStudyRoomPort.kt index 04cfa5dce..9b42f2712 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandStudyRoomPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/CommandStudyRoomPort.kt @@ -15,5 +15,4 @@ interface CommandStudyRoomPort { fun saveStudyRoom(studyRoom: StudyRoom): StudyRoom fun deleteStudyRoomById(studyRoomId: UUID) - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryAvailableTimePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryAvailableTimePort.kt index a7c4bdee9..ac1d71449 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryAvailableTimePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryAvailableTimePort.kt @@ -1,10 +1,9 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID import team.aliens.dms.domain.studyroom.model.AvailableTime +import java.util.UUID interface QueryAvailableTimePort { fun queryAvailableTimeBySchoolId(schoolId: UUID): AvailableTime? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QuerySeatTypePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QuerySeatTypePort.kt index c0ae31415..bd12a12e2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QuerySeatTypePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QuerySeatTypePort.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID import team.aliens.dms.domain.studyroom.model.SeatType +import java.util.UUID interface QuerySeatTypePort { @@ -10,5 +10,4 @@ interface QuerySeatTypePort { fun existsSeatTypeByName(name: String): Boolean fun querySeatTypeById(seatTypeId: UUID): SeatType? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryStudyRoomPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryStudyRoomPort.kt index 0f7ced0c3..99a38ad6b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryStudyRoomPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/QueryStudyRoomPort.kt @@ -1,10 +1,10 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID -import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.model.Seat import team.aliens.dms.domain.studyroom.model.StudyRoom +import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.spi.vo.StudyRoomVO +import java.util.UUID interface QueryStudyRoomPort { @@ -21,5 +21,4 @@ interface QueryStudyRoomPort { fun queryAllStudyRoomsBySchoolId(schoolId: UUID): List fun querySeatByStudyRoomId(studyRoomId: UUID): Seat? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypePort.kt index 3560b403f..11ac18db1 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypePort.kt @@ -2,5 +2,4 @@ package team.aliens.dms.domain.studyroom.spi interface SeatTypePort : QuerySeatTypePort, - CommandSeatTypePort { -} \ No newline at end of file + CommandSeatTypePort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypeQueryStudyRoomPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypeQueryStudyRoomPort.kt index a6340988d..f5cf7bd68 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypeQueryStudyRoomPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/SeatTypeQueryStudyRoomPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface SeatTypeQueryStudyRoomPort { fun existsSeatBySeatTypeId(seatTypeId: UUID): Boolean - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQuerySchoolPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQuerySchoolPort.kt index a5dcdde2c..966daa3f8 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQuerySchoolPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQuerySchoolPort.kt @@ -1,10 +1,9 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID import team.aliens.dms.domain.school.model.School +import java.util.UUID interface StudyRoomQuerySchoolPort { fun querySchoolById(schoolId: UUID): School? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryStudentPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryStudentPort.kt index f64f7d0fb..542cd65c2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryStudentPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryStudentPort.kt @@ -1,10 +1,9 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID import team.aliens.dms.domain.student.model.Student +import java.util.UUID interface StudyRoomQueryStudentPort { fun queryStudentById(studentId: UUID): Student? - } diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryUserPort.kt index 1c777341f..2095a6613 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomQueryUserPort.kt @@ -1,10 +1,9 @@ package team.aliens.dms.domain.studyroom.spi -import java.util.UUID import team.aliens.dms.domain.user.model.User +import java.util.UUID interface StudyRoomQueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomSecurityPort.kt index 769b60eaf..8250116f0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/StudyRoomSecurityPort.kt @@ -5,5 +5,4 @@ import java.util.UUID interface StudyRoomSecurityPort { fun getCurrentUserId(): UUID - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/SeatVO.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/SeatVO.kt index 90c3ccefa..b83c02ef7 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/SeatVO.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/SeatVO.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.spi.vo -import java.util.UUID import team.aliens.dms.domain.studyroom.model.SeatStatus +import java.util.UUID open class SeatVO( val seatId: UUID, @@ -18,4 +18,4 @@ open class SeatVO( val studentClassRoom: Int?, val studentNumber: Int?, val studentProfileImageUrl: String? -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/StudyRoomVO.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/StudyRoomVO.kt index 54c2563a5..a3cbbd491 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/StudyRoomVO.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/spi/vo/StudyRoomVO.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.spi.vo -import java.util.UUID import team.aliens.dms.domain.student.model.Sex +import java.util.UUID open class StudyRoomVO( val id: UUID, @@ -11,4 +11,4 @@ open class StudyRoomVO( val availableSex: Sex, val inUseHeadcount: Int, val totalAvailableSeat: Int -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ApplySeatUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ApplySeatUseCase.kt index f0b41fb42..52730224d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ApplySeatUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ApplySeatUseCase.kt @@ -1,24 +1,25 @@ package team.aliens.dms.domain.studyroom.usecase import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException -import team.aliens.dms.domain.studyroom.exception.SeatAlreadyAppliedException +import team.aliens.dms.domain.school.validateSameSchool +import team.aliens.dms.domain.student.exception.StudentNotFoundException +import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.studyroom.exception.SeatCanNotAppliedException import team.aliens.dms.domain.studyroom.exception.SeatNotFoundException +import team.aliens.dms.domain.studyroom.exception.StudyRoomAvailableGradeMismatchException +import team.aliens.dms.domain.studyroom.exception.StudyRoomAvailableSexMismatchException import team.aliens.dms.domain.studyroom.exception.StudyRoomNotFoundException +import team.aliens.dms.domain.studyroom.model.Seat import team.aliens.dms.domain.studyroom.model.SeatStatus +import team.aliens.dms.domain.studyroom.model.StudyRoom import team.aliens.dms.domain.studyroom.spi.CommandStudyRoomPort import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort +import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryStudentPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.user.exception.UserNotFoundException import java.time.LocalTime import java.util.UUID -import team.aliens.dms.domain.student.exception.StudentNotFoundException -import team.aliens.dms.domain.student.model.Sex -import team.aliens.dms.domain.studyroom.exception.StudyRoomAvailableGradeMismatchException -import team.aliens.dms.domain.studyroom.exception.StudyRoomAvailableSexMismatchException -import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryStudentPort @UseCase class ApplySeatUseCase( @@ -33,33 +34,13 @@ class ApplySeatUseCase( fun execute(seatId: UUID) { val currentUserId = securityPort.getCurrentUserId() val user = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException - val student = queryStudentPort.queryStudentById(user.id) ?: throw StudentNotFoundException val seat = queryStudyRoomPort.querySeatById(seatId) ?: throw SeatNotFoundException val studyRoom = queryStudyRoomPort.queryStudyRoomById(seat.studyRoomId) ?: throw StudyRoomNotFoundException - if (studyRoom.schoolId != user.schoolId) { - throw SchoolMismatchException - } - - if (studyRoom.availableGrade != 0 && studyRoom.availableGrade != student.grade) { - throw StudyRoomAvailableGradeMismatchException - } - - if (studyRoom.availableSex != Sex.ALL && studyRoom.availableSex != student.sex) { - throw StudyRoomAvailableSexMismatchException - } - - val now = LocalTime.now() - val availableTime = queryAvailableTimeUseCase.execute() - - if (now < availableTime.startAt || now > availableTime.endAt) { - throw SeatCanNotAppliedException - } - - if (seat.status != SeatStatus.AVAILABLE) { - throw SeatCanNotAppliedException - } + validateSameSchool(studyRoom.schoolId, user.schoolId) + validateStudyRoomAvailable(studyRoom, currentUserId) + validateSeatAvailable(seat) val currentSeat = queryStudyRoomPort.querySeatByStudentId(currentUserId) currentSeat?.let { @@ -77,11 +58,7 @@ class ApplySeatUseCase( } } - val saveSeat = seat.studentId?.run { - throw SeatAlreadyAppliedException - } ?: run { - seat.use(currentUserId) - } + val saveSeat = seat.use(currentUserId) commandStudyRoomPort.saveSeat(saveSeat) if (studyRoom.id != currentSeat?.studyRoomId) { @@ -90,4 +67,29 @@ class ApplySeatUseCase( ) } } -} \ No newline at end of file + + private fun validateStudyRoomAvailable(studyRoom: StudyRoom, currentUserId: UUID) { + val student = queryStudentPort.queryStudentById(currentUserId) ?: throw StudentNotFoundException + + if (studyRoom.availableGrade != 0 && studyRoom.availableGrade != student.grade) { + throw StudyRoomAvailableGradeMismatchException + } + + if (studyRoom.availableSex != Sex.ALL && studyRoom.availableSex != student.sex) { + throw StudyRoomAvailableSexMismatchException + } + } + + private fun validateSeatAvailable(seat: Seat) { + val now = LocalTime.now() + val availableTime = queryAvailableTimeUseCase.execute() + + if (now < availableTime.startAt || now > availableTime.endAt) { + throw SeatCanNotAppliedException + } + + if (seat.status != SeatStatus.AVAILABLE) { + throw SeatCanNotAppliedException + } + } +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateSeatTypeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateSeatTypeUseCase.kt index 0297dd354..ec1644b89 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateSeatTypeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateSeatTypeUseCase.kt @@ -33,4 +33,4 @@ class CreateSeatTypeUseCase( commandSeatTypePort.saveSeatType(seatType) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCase.kt index d63567657..27a3dbf73 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCase.kt @@ -23,9 +23,11 @@ class CreateStudyRoomUseCase( ) { fun execute(request: CreateStudyRoomRequest): UUID { - val (_, _, totalWidthSize, totalHeightSize, + val ( + _, _, totalWidthSize, totalHeightSize, eastDescription, westDescription, southDescription, northDescription, - _, availableGrade, seatRequests) = request + _, availableGrade, seatRequests + ) = request val currentUserId = securityPort.getCurrentUserId() val currentUser = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException @@ -75,4 +77,4 @@ class CreateStudyRoomUseCase( return savedStudyRoom.id } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCase.kt index f8fb59405..ae4433fde 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCase.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.studyroom.usecase -import java.util.UUID import team.aliens.dms.common.annotation.ReadOnlyUseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool +import team.aliens.dms.domain.student.model.Student import team.aliens.dms.domain.studyroom.dto.ManagerQueryStudyRoomResponse import team.aliens.dms.domain.studyroom.dto.ManagerQueryStudyRoomResponse.SeatElement import team.aliens.dms.domain.studyroom.dto.ManagerQueryStudyRoomResponse.SeatElement.StudentElement @@ -12,6 +12,7 @@ import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.user.exception.UserNotFoundException +import java.util.UUID @ReadOnlyUseCase class ManagerQueryStudyRoomUseCase( @@ -26,9 +27,7 @@ class ManagerQueryStudyRoomUseCase( val studyRoom = queryStudyRoomPort.queryStudyRoomById(studyRoomId) ?: throw StudyRoomNotFoundException - if (user.schoolId != studyRoom.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(user.schoolId, studyRoom.schoolId) val seats = queryStudyRoomPort.queryAllSeatsByStudyRoomId(studyRoom.id).map { SeatElement( @@ -48,7 +47,7 @@ class ManagerQueryStudyRoomUseCase( StudentElement( id = it.studentId, name = it.studentName!!, - gcn = "${it.studentGrade}${it.studentClassRoom}${processNumber(it.studentNumber!!)}", + gcn = "${it.studentGrade}${it.studentClassRoom}${Student.processNumber(it.studentNumber!!)}", profileImageUrl = it.studentProfileImageUrl!! ) } @@ -72,6 +71,4 @@ class ManagerQueryStudyRoomUseCase( ) } } - - private fun processNumber(number: Int) = if (number < 10) "0${number}" else number.toString() -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCase.kt index aac656a35..fc1d2f801 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCase.kt @@ -35,4 +35,4 @@ class ManagerQueryStudyRoomsUseCase( studyRooms = studyRooms ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryAvailableTimeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryAvailableTimeUseCase.kt index 841b45594..6ad1a6db0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryAvailableTimeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryAvailableTimeUseCase.kt @@ -27,4 +27,4 @@ class QueryAvailableTimeUseCase( endAt = availableTime.endAt.withSecond(0) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCase.kt index f705dfdaf..67ec2f774 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCase.kt @@ -24,4 +24,4 @@ class QueryCurrentAppliedStudyRoomUseCase( name = studyRoom.name ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QuerySeatTypesUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QuerySeatTypesUseCase.kt index 7401c0ce9..bc4df316c 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QuerySeatTypesUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/QuerySeatTypesUseCase.kt @@ -30,4 +30,4 @@ class QuerySeatTypesUseCase( return QuerySeatTypesResponse(seatTypes) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveSeatTypeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveSeatTypeUseCase.kt index 0adab9a58..eae66b73f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveSeatTypeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveSeatTypeUseCase.kt @@ -1,8 +1,7 @@ package team.aliens.dms.domain.studyroom.usecase -import java.util.UUID import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.studyroom.exception.SeatTypeInUseException import team.aliens.dms.domain.studyroom.exception.SeatTypeNotFoundException import team.aliens.dms.domain.studyroom.spi.CommandSeatTypePort @@ -11,6 +10,7 @@ import team.aliens.dms.domain.studyroom.spi.SeatTypeQueryStudyRoomPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.user.exception.UserNotFoundException +import java.util.UUID @UseCase class RemoveSeatTypeUseCase( @@ -27,9 +27,7 @@ class RemoveSeatTypeUseCase( val seatType = querySeatTypePort.querySeatTypeById(seatTypeId) ?: throw SeatTypeNotFoundException - if (user.schoolId != seatType.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(user.schoolId, seatType.schoolId) if (queryStudyRoomPort.existsSeatBySeatTypeId(seatTypeId)) { throw SeatTypeInUseException @@ -37,4 +35,4 @@ class RemoveSeatTypeUseCase( commandSeatTypePort.deleteSeatType(seatType) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveStudyRoomUseCase.kt index bc3926979..f0f47d0b2 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/RemoveStudyRoomUseCase.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.usecase import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.studyroom.exception.StudyRoomNotFoundException import team.aliens.dms.domain.studyroom.spi.CommandStudyRoomPort import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort @@ -24,11 +24,9 @@ class RemoveStudyRoomUseCase( val studyRoom = queryStudyRoomPort.queryStudyRoomById(studyRoomId) ?: throw StudyRoomNotFoundException - if (studyRoom.schoolId != manager.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(studyRoom.schoolId, manager.schoolId) commandStudyRoomPort.deleteAllSeatsByStudyRoomId(studyRoomId) commandStudyRoomPort.deleteStudyRoomById(studyRoomId) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCase.kt index 5b285738d..8d06ae643 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCase.kt @@ -1,8 +1,7 @@ package team.aliens.dms.domain.studyroom.usecase -import java.util.UUID import team.aliens.dms.common.annotation.ReadOnlyUseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomResponse import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomResponse.SeatElement import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomResponse.SeatElement.StudentElement @@ -13,6 +12,7 @@ import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.user.exception.UserNotFoundException +import java.util.UUID @ReadOnlyUseCase class StudentQueryStudyRoomUseCase( @@ -27,9 +27,7 @@ class StudentQueryStudyRoomUseCase( val studyRoom = queryStudyRoomPort.queryStudyRoomById(studyRoomId) ?: throw StudyRoomNotFoundException - if (user.schoolId != studyRoom.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(user.schoolId, studyRoom.schoolId) val seats = queryStudyRoomPort.queryAllSeatsByStudyRoomId(studyRoom.id).map { SeatElement( @@ -93,4 +91,4 @@ class StudentQueryStudyRoomUseCase( else -> null } } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCase.kt index 4ee60a81c..2a6fda88f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCase.kt @@ -1,6 +1,5 @@ package team.aliens.dms.domain.studyroom.usecase -import java.util.UUID import team.aliens.dms.common.annotation.ReadOnlyUseCase import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomsResponse import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomsResponse.StudyRoomElement @@ -8,6 +7,7 @@ import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.user.exception.UserNotFoundException +import java.util.UUID @ReadOnlyUseCase class StudentQueryStudyRoomsUseCase( @@ -48,4 +48,4 @@ class StudentQueryStudyRoomsUseCase( } ?: run { false } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UnApplySeatUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UnApplySeatUseCase.kt index be5f80701..3bf7178d3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UnApplySeatUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UnApplySeatUseCase.kt @@ -27,4 +27,4 @@ class UnApplySeatUseCase( studyRoom.unApply() ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateAvailableTimeUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateAvailableTimeUseCase.kt index 14fe755cd..5a8a24408 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateAvailableTimeUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateAvailableTimeUseCase.kt @@ -31,4 +31,4 @@ class UpdateAvailableTimeUseCase( ) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCase.kt index 3952f270f..c8bc586ce 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCase.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.studyroom.usecase import team.aliens.dms.common.annotation.UseCase -import team.aliens.dms.domain.school.exception.SchoolMismatchException +import team.aliens.dms.domain.school.validateSameSchool import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.studyroom.dto.UpdateStudyRoomRequest import team.aliens.dms.domain.studyroom.exception.StudyRoomAlreadyExistsException @@ -24,18 +24,18 @@ class UpdateStudyRoomUseCase( ) { fun execute(studyRoomId: UUID, request: UpdateStudyRoomRequest) { - val (_, _, totalWidthSize, totalHeightSize, + val ( + _, _, totalWidthSize, totalHeightSize, eastDescription, westDescription, southDescription, northDescription, - _, availableGrade, seatRequests) = request + _, availableGrade, seatRequests + ) = request val currentUserId = securityPort.getCurrentUserId() val currentUser = queryUserPort.queryUserById(currentUserId) ?: throw UserNotFoundException val studyRoom = queryStudyRoomPort.queryStudyRoomById(studyRoomId) ?: throw StudyRoomNotFoundException - if (currentUser.schoolId != studyRoom.schoolId) { - throw SchoolMismatchException - } + validateSameSchool(currentUser.schoolId, studyRoom.schoolId) if (request.floor != studyRoom.floor || request.name != studyRoom.name) { val isAlreadyExists = queryStudyRoomPort.existsStudyRoomByFloorAndNameAndSchoolId( @@ -84,4 +84,4 @@ class UpdateStudyRoomUseCase( } commandStudyRoomPort.saveAllSeat(seats) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/template/spi/TemplatePort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/template/spi/TemplatePort.kt index 1434e08f5..819dadd8d 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/template/spi/TemplatePort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/template/spi/TemplatePort.kt @@ -12,5 +12,4 @@ interface TemplatePort { fun updateTemplate(type: EmailType) fun deleteTemplate(type: EmailType) - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/template/usecase/TemplateUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/template/usecase/TemplateUseCase.kt index 0076ebe35..b1ffbbd2f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/template/usecase/TemplateUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/template/usecase/TemplateUseCase.kt @@ -36,4 +36,4 @@ class TemplateUseCase( data class TemplateResponse( val name: String, val createdAt: LocalDateTime -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/InvalidRoleException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/InvalidRoleException.kt index a020671d3..85c43ea32 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/InvalidRoleException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/InvalidRoleException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.user.error.UserErrorCode object InvalidRoleException : DmsException( UserErrorCode.INVALID_ROLE -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserAccountIdExistsException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserAccountIdExistsException.kt index 058f7a6a7..fea502516 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserAccountIdExistsException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserAccountIdExistsException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.user.exception -import team.aliens.dms.domain.user.error.UserErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.user.error.UserErrorCode object UserAccountIdExistsException : DmsException( UserErrorCode.USER_ACCOUNT_ID_EXISTS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserEmailExistsException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserEmailExistsException.kt index 6f8521aee..1f2edca39 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserEmailExistsException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserEmailExistsException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.user.exception -import team.aliens.dms.domain.user.error.UserErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.user.error.UserErrorCode object UserEmailExistsException : DmsException( UserErrorCode.USER_EMAIL_EXISTS -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserNotFoundException.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserNotFoundException.kt index 5845e8b36..35f15ee4a 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserNotFoundException.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/exception/UserNotFoundException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.user.exception -import team.aliens.dms.domain.user.error.UserErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.user.error.UserErrorCode object UserNotFoundException : DmsException( UserErrorCode.USER_NOT_FOUND -) \ No newline at end of file +) diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/CommandUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/CommandUserPort.kt index 8260509a6..7974185c3 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/CommandUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/CommandUserPort.kt @@ -5,5 +5,4 @@ import team.aliens.dms.domain.user.model.User interface CommandUserPort { fun saveUser(user: User): User - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/QueryUserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/QueryUserPort.kt index 60cd207e8..ebdd456b7 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/QueryUserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/QueryUserPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface QueryUserPort { fun queryUserById(userId: UUID): User? - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserJwtPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserJwtPort.kt index 854736009..bb5373091 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserJwtPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserJwtPort.kt @@ -7,5 +7,4 @@ import java.util.UUID interface UserJwtPort { fun receiveToken(userId: UUID, authority: Authority): TokenResponse - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserPort.kt index 3dbc385a8..32facac9f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserPort.kt @@ -23,5 +23,4 @@ interface UserPort : SchoolQueryUserPort, PointQueryUserPort, StudyRoomQueryUserPort, - RemainQueryUserPort { -} \ No newline at end of file + RemainQueryUserPort diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserSecurityPort.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserSecurityPort.kt index 18c3aa816..e5679193f 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserSecurityPort.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/spi/UserSecurityPort.kt @@ -9,5 +9,4 @@ interface UserSecurityPort { fun isPasswordMatch(rawPassword: String, encodedPassword: String): Boolean fun encodePassword(password: String): String - -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCase.kt index 77b0b0290..b48b48e9b 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCase.kt @@ -29,4 +29,4 @@ class UpdateUserPasswordUseCase( user.copy(password = newEncodedPassword) ) } -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCase.kt b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCase.kt index f38245890..82f701caf 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCase.kt +++ b/dms-application/src/main/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCase.kt @@ -20,4 +20,4 @@ class UserPasswordCompareUseCase( throw PasswordMismatchException } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCaseTests.kt index 847b95298..cfac665af 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailCodeUseCaseTests.kt @@ -227,4 +227,4 @@ class CertifyEmailCodeUseCaseTests { certifyEmailCodeUseCase.execute(request) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCaseTests.kt index 0bccd387e..a5f513eeb 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CertifyEmailUseCaseTests.kt @@ -50,11 +50,11 @@ class CertifyEmailUseCaseTests { fun `이메일 검증 성공`() { val request = CertifyEmailRequest(accountId, email) - //given + // given given(queryUserPort.queryUserByAccountId(request.accountId)) .willReturn(userStub) - //when then + // when then assertDoesNotThrow { certifyEmailUseCase.execute(request) } @@ -64,11 +64,11 @@ class CertifyEmailUseCaseTests { fun `유저를 찾을 수 없음`() { val request = CertifyEmailRequest(accountId, email) - //given + // given given(queryUserPort.queryUserByAccountId(request.accountId)) .willReturn(null) - //when then + // when then assertThrows { certifyEmailUseCase.execute(request) } @@ -79,13 +79,13 @@ class CertifyEmailUseCaseTests { val mismatchEmail = "mis@match.com" val request = CertifyEmailRequest(accountId, mismatchEmail) - //given + // given given(queryUserPort.queryUserByAccountId(request.accountId)) .willReturn(userStub) - //when then + // when then assertThrows { certifyEmailUseCase.execute(request) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCaseTests.kt index 79bc44a36..f0640d5c3 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/CheckAccountIdExistenceUseCaseTests.kt @@ -68,4 +68,4 @@ class CheckAccountIdExistenceUseCaseTests { checkAccountIdExistenceUseCase.execute(accountId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCaseTests.kt index e9fbea6db..b35b5531d 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/ReissueTokenUseCaseTests.kt @@ -94,7 +94,7 @@ class ReissueTokenUseCaseTests { @Test fun `토큰 재발급 성공`() { - //given + // given given(queryRefreshTokenPort.queryRefreshTokenByToken(token)) .willReturn(refreshTokenStub) @@ -107,7 +107,7 @@ class ReissueTokenUseCaseTests { given(querySchoolPort.queryAvailableFeaturesBySchoolId(userStub.schoolId)) .willReturn(featureStub) - //when & then + // when & then assertDoesNotThrow { reissueTokenUseCase.execute(token) } @@ -115,11 +115,11 @@ class ReissueTokenUseCaseTests { @Test fun `리프레시 토큰을 찾을 수 없음`() { - //given + // given given(queryRefreshTokenPort.queryRefreshTokenByToken(token)) .willReturn(null) - //when & then + // when & then assertThrows { reissueTokenUseCase.execute(token) } @@ -145,7 +145,7 @@ class ReissueTokenUseCaseTests { @Test fun `이용 가능한 기능이 존재하지 않음`() { - //given + // given given(queryRefreshTokenPort.queryRefreshTokenByToken(token)) .willReturn(refreshTokenStub) @@ -163,4 +163,4 @@ class ReissueTokenUseCaseTests { reissueTokenUseCase.execute(token) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCaseTests.kt index 17f24158a..55481264f 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SendEmailCodeUseCaseTests.kt @@ -154,4 +154,4 @@ class SendEmailCodeUseCaseTests { sendEmailCodeUseCase.execute(request) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCaseTests.kt index 4bd966500..a26bc8b3f 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/auth/usecase/SignInUseCaseTests.kt @@ -177,4 +177,4 @@ class SignInUseCaseTests { signInUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCaseTests.kt index 8d99d0790..692b5fb30 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/file/usecase/UploadFileUseCaseTests.kt @@ -149,11 +149,10 @@ class UploadFileUseCaseTests { assertEquals(response, filePathStub) } - @Test fun `파일 확장자 잘못됨`() { assertThrows { uploadFileUseCase.execute(svgFileStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCaseTests.kt index 02abf8296..ec645f40f 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/FindManagerAccountIdUseCaseTests.kt @@ -131,4 +131,4 @@ class FindManagerAccountIdUseCaseTests { findManagerAccountIdUseCase.execute(schoolId, answer) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCaseTests.kt index 1a60ee310..398ef7db3 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ManagerMyPageUseCaseTests.kt @@ -8,7 +8,6 @@ import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension -import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.manager.dto.ManagerMyPageResponse import team.aliens.dms.domain.manager.exception.ManagerNotFoundException import team.aliens.dms.domain.manager.model.Manager @@ -17,10 +16,7 @@ import team.aliens.dms.domain.manager.spi.ManagerSecurityPort import team.aliens.dms.domain.manager.spi.QueryManagerPort import team.aliens.dms.domain.school.exception.SchoolNotFoundException import team.aliens.dms.domain.school.model.School -import team.aliens.dms.domain.user.exception.UserNotFoundException -import team.aliens.dms.domain.user.model.User import java.time.LocalDate -import java.time.LocalDateTime import java.util.UUID @ExtendWith(SpringExtension::class) @@ -128,4 +124,4 @@ class ManagerMyPageUseCaseTests { managerMyPageUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCaseTests.kt index 0a12f412f..ff967292a 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentDetailsUseCaseTests.kt @@ -10,7 +10,6 @@ import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension -import team.aliens.dms.domain.manager.dto.GetStudentDetailsResponse import team.aliens.dms.domain.manager.exception.ManagerNotFoundException import team.aliens.dms.domain.manager.model.Manager import team.aliens.dms.domain.manager.spi.ManagerQueryPointHistoryPort @@ -95,24 +94,6 @@ class QueryStudentDetailsUseCaseTests { ) } - private val responseStub by lazy { - GetStudentDetailsResponse( - name = studentStub.name, - gcn = studentStub.gcn, - profileImageUrl = studentStub.profileImageUrl ?: Student.PROFILE_IMAGE, - bonusPoint = bonusPoint, - minusPoint = minusPoint, - roomNumber = studentStub.roomNumber, - roomMates = listOf( - GetStudentDetailsResponse.RoomMate( - id = studentStub.id, - name = studentStub.name, - profileImageUrl = studentStub.profileImageUrl ?: Student.PROFILE_IMAGE - ) - ) - ) - } - @Test fun `학생 상세조회 성공`() { // given @@ -194,4 +175,4 @@ class QueryStudentDetailsUseCaseTests { queryStudentDetailsUseCase.execute(studentId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCaseTests.kt index b541923f3..0c225d5af 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/QueryStudentsUseCaseTests.kt @@ -1,26 +1,25 @@ package team.aliens.dms.domain.manager.usecase import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Assertions.assertAll import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test +import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension -import team.aliens.dms.domain.manager.dto.Sort -import team.aliens.dms.domain.manager.spi.ManagerQueryStudentPort -import team.aliens.dms.domain.student.model.Student -import java.util.UUID -import org.junit.jupiter.api.assertThrows -import team.aliens.dms.domain.manager.dto.PointFilterType import team.aliens.dms.domain.manager.dto.PointFilter +import team.aliens.dms.domain.manager.dto.PointFilterType +import team.aliens.dms.domain.manager.dto.Sort import team.aliens.dms.domain.manager.exception.ManagerNotFoundException import team.aliens.dms.domain.manager.model.Manager +import team.aliens.dms.domain.manager.spi.ManagerQueryStudentPort import team.aliens.dms.domain.manager.spi.ManagerSecurityPort import team.aliens.dms.domain.manager.spi.QueryManagerPort import team.aliens.dms.domain.point.exception.InvalidPointFilterRangeException import team.aliens.dms.domain.student.model.Sex +import team.aliens.dms.domain.student.model.Student +import java.util.UUID @ExtendWith(SpringExtension::class) class QueryStudentsUseCaseTests { @@ -34,7 +33,6 @@ class QueryStudentsUseCaseTests { @MockBean private lateinit var queryStudentPort: ManagerQueryStudentPort - private lateinit var queryStudentsUseCase: QueryStudentsUseCase @BeforeEach @@ -92,9 +90,11 @@ class QueryStudentsUseCaseTests { given(queryManagerPort.queryManagerById(currentUserId)) .willReturn(managerStub) - given(queryStudentPort.queryStudentsByNameAndSortAndFilter( - name, sort, managerStub.schoolId, pointFilterStub - )).willReturn(listOf(studentStub)) + given( + queryStudentPort.queryStudentsByNameAndSortAndFilter( + name, sort, managerStub.schoolId, pointFilterStub + ) + ).willReturn(listOf(studentStub)) // when val result = queryStudentsUseCase.execute(name, sort, filterType, 0, 10) @@ -128,7 +128,7 @@ class QueryStudentsUseCaseTests { given(queryManagerPort.queryManagerById(currentUserId)) .willReturn(managerStub) - //when & then + // when & then assertThrows { queryStudentsUseCase.execute( name, sort, filterType, 20, 10 diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCaseTests.kt index 5c106635f..5ecbf0b5e 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/RemoveStudentUseCaseTests.kt @@ -236,4 +236,4 @@ class RemoveStudentUseCaseTests { removeStudentUseCase.execute(studentId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCaseTests.kt index b2cc474f6..35a47c4da 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/manager/usecase/ResetManagerPasswordUseCaseTests.kt @@ -15,7 +15,6 @@ import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.auth.model.EmailType import team.aliens.dms.domain.manager.dto.ResetManagerPasswordRequest import team.aliens.dms.domain.manager.exception.ManagerInfoMismatchException -import team.aliens.dms.domain.manager.exception.ManagerNotFoundException import team.aliens.dms.domain.manager.spi.ManagerCommandUserPort import team.aliens.dms.domain.manager.spi.ManagerQueryAuthCodePort import team.aliens.dms.domain.manager.spi.ManagerQueryUserPort @@ -202,4 +201,4 @@ class ResetManagerPasswordUseCaseTests { resetManagerPasswordUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCaseTests.kt index 44b4abff7..1b4f18e90 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/meal/usecase/QueryMealsUseCaseTests.kt @@ -122,4 +122,4 @@ class QueryMealsUseCaseTests { queryMealsUseCase.execute(mealDate) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCaseTests.kt index b7a450f8d..213d6db9f 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryAllNoticesUseCaseTests.kt @@ -117,4 +117,4 @@ class QueryAllNoticesUseCaseTests { queryAllNoticesUseCase.execute(order) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCaseTests.kt index a677a8215..2add14072 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeDetailsUseCaseTests.kt @@ -190,4 +190,4 @@ class QueryNoticeDetailsUseCaseTests { queryNoticeDetailsUseCase.execute(noticeId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCaseTests.kt index 00589bcf3..5e4825ec6 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/QueryNoticeStatusUseCaseTests.kt @@ -51,4 +51,4 @@ class QueryNoticeStatusUseCaseTests { // then assertThat(response).isFalse } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCaseTests.kt index 057c2af8f..bde667a25 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/RemoveNoticeUseCaseTests.kt @@ -100,4 +100,4 @@ class RemoveNoticeUseCaseTests { removeNoticeUseCase.execute(noticeId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCaseTest.kt index 3090e643b..8186216de 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/notice/usecase/UpdateNoticeUseCaseTest.kt @@ -62,7 +62,7 @@ class UpdateNoticeUseCaseTest { given(queryNoticePort.queryNoticeByIdAndManagerId(noticeId, managerId)) .willReturn(noticeStub) - //when + // when val response = updateNoticeUseCase.execute(noticeId, title, content) // then @@ -83,4 +83,4 @@ class UpdateNoticeUseCaseTest { updateNoticeUseCase.execute(noticeId, title, content) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CancelGrantedPointUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CancelGrantedPointUseCaseTests.kt index c43e173c5..a7764cc3f 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CancelGrantedPointUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CancelGrantedPointUseCaseTests.kt @@ -136,4 +136,4 @@ class CancelGrantedPointUseCaseTests { cancelGrantedPointUseCase.execute(pointHistoryId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CreatePointOptionUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CreatePointOptionUseCaseTest.kt index 397fb1efa..5d80b7976 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CreatePointOptionUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/CreatePointOptionUseCaseTest.kt @@ -51,30 +51,29 @@ class CreatePointOptionUseCaseTest { @Test fun `상벌점 항목 생성 성공`() { - //given + // given every { securityPort.getCurrentUserId() } returns currentUserId every { queryManagerPort.queryManagerById(managerId) } returns managerStub every { queryPointOptionPort.existByNameAndSchoolId(requestStub.name, schoolId) } returns false - //when & then + // when & then assertDoesNotThrow { createPointOptionUseCase.execute(requestStub) } - } @Test fun `항목이 이미 존재하는 경우`() { - //given + // given every { securityPort.getCurrentUserId() } returns currentUserId every { queryManagerPort.queryManagerById(managerId) } returns managerStub every { queryPointOptionPort.existByNameAndSchoolId(requestStub.name, schoolId) } returns true - //when & then + // when & then assertThrows { createPointOptionUseCase.execute(requestStub) } @@ -87,11 +86,9 @@ class CreatePointOptionUseCaseTest { every { queryManagerPort.queryManagerById(managerId) } returns null - - //when & then + // when & then assertThrows { createPointOptionUseCase.execute(requestStub) } } - -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/ExportAllPointHistoryUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/ExportAllPointHistoryUseCaseTests.kt index de518e6fc..eb22a3bce 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/ExportAllPointHistoryUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/ExportAllPointHistoryUseCaseTests.kt @@ -144,8 +144,8 @@ class ExportAllPointHistoryUseCaseTests { val responseStub = ExportAllPointHistoryResponse( file = fileStub, fileName = "대덕소프트웨어마이스터고등학교_상벌점_부여내역" + - "_${oldestHistoryCreatedAt.format(File.FILE_DATE_FORMAT)}" + - "_${LocalDate.now().format(File.FILE_DATE_FORMAT)}" + "_${oldestHistoryCreatedAt.format(File.FILE_DATE_FORMAT)}" + + "_${LocalDate.now().format(File.FILE_DATE_FORMAT)}" ) every { securityPort.getCurrentUserId() } returns managerId @@ -188,4 +188,4 @@ class ExportAllPointHistoryUseCaseTests { exportAllPointHistoryUseCase.execute(start, end) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/GrantPointUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/GrantPointUseCaseTest.kt index 699b47011..7bfb553b4 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/GrantPointUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/GrantPointUseCaseTest.kt @@ -1,15 +1,13 @@ package team.aliens.dms.domain.point.usecase -import org.junit.jupiter.api.Test - - import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith -import org.springframework.test.context.junit.jupiter.SpringExtension import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean +import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.domain.manager.exception.ManagerNotFoundException import team.aliens.dms.domain.manager.model.Manager import team.aliens.dms.domain.point.dto.GrantPointRequest @@ -19,9 +17,9 @@ import team.aliens.dms.domain.point.model.PointOption import team.aliens.dms.domain.point.model.PointType import team.aliens.dms.domain.point.spi.CommandPointHistoryPort import team.aliens.dms.domain.point.spi.PointQueryManagerPort +import team.aliens.dms.domain.point.spi.PointQueryStudentPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointOptionPort -import team.aliens.dms.domain.point.spi.PointQueryStudentPort import team.aliens.dms.domain.point.spi.vo.StudentWithPointVO import team.aliens.dms.domain.student.exception.StudentNotFoundException import java.util.UUID @@ -61,14 +59,16 @@ class GrantPointUseCaseTest { private val pointOptionId = UUID.randomUUID() private val studentWithPointVOStub by lazy { - listOf( StudentWithPointVO( - grade = 2, - classRoom = 1, - number = 15, - name = "이하성", - bonusTotal = 29, - minusTotal = 10 - )) + listOf( + StudentWithPointVO( + grade = 2, + classRoom = 1, + number = 15, + name = "이하성", + bonusTotal = 29, + minusTotal = 10 + ) + ) } private val managerStub by lazy { Manager( @@ -114,7 +114,7 @@ class GrantPointUseCaseTest { @Test fun `상벌점부여 성공`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) @@ -127,7 +127,7 @@ class GrantPointUseCaseTest { given(queryStudentPort.queryStudentsWithPointHistory(requestStub.studentIdList)) .willReturn(studentWithPointVOStub) - //when & then + // when & then assertDoesNotThrow { grantPointUseCase.execute(requestStub) } @@ -135,7 +135,7 @@ class GrantPointUseCaseTest { @Test fun `상벌점항목이 올바르지 않은 경우`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) @@ -148,7 +148,7 @@ class GrantPointUseCaseTest { given(queryPointOptionPort.queryPointOptionById(pointOptionId)) .willReturn(pointOptionStub) - //when & then + // when & then assertThrows { grantPointUseCase.execute(requestStub) } @@ -156,14 +156,14 @@ class GrantPointUseCaseTest { @Test fun `상벌점항목을 찾을 수 없는 경우`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) given(queryManagerPort.queryManagerById(currentUserId)) .willReturn(managerStub) - //when & then + // when & then assertThrows { grantPointUseCase.execute(requestStub) } @@ -171,11 +171,11 @@ class GrantPointUseCaseTest { @Test fun `메니저를 찾을 수 없는 경우`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) - //when & then + // when & then assertThrows { grantPointUseCase.execute(requestStub) } @@ -183,7 +183,7 @@ class GrantPointUseCaseTest { @Test fun `학생을 찾을 수 없는경우`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) @@ -196,10 +196,9 @@ class GrantPointUseCaseTest { given(queryStudentPort.queryStudentsWithPointHistory(requestStub.studentIdList)) .willReturn(studentWithPointVOStub) - - //when & then + // when & then assertThrows { grantPointUseCase.execute(requestStubWithInvalidStudent) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryAllPointHistoryUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryAllPointHistoryUseCaseTests.kt index 999c73234..8bdffc301 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryAllPointHistoryUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryAllPointHistoryUseCaseTests.kt @@ -4,8 +4,8 @@ import io.mockk.every import io.mockk.mockk import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.assertAll +import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.common.dto.PageData @@ -16,8 +16,8 @@ import team.aliens.dms.domain.point.model.PointType import team.aliens.dms.domain.point.spi.PointQueryUserPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointHistoryPort -import team.aliens.dms.domain.user.model.User import team.aliens.dms.domain.user.exception.UserNotFoundException +import team.aliens.dms.domain.user.model.User import java.time.LocalDate import java.util.UUID diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointHistoryUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointHistoryUseCaseTests.kt index f8127a754..49e08ae82 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointHistoryUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointHistoryUseCaseTests.kt @@ -10,12 +10,12 @@ import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.common.dto.PageData +import team.aliens.dms.domain.point.dto.PointHistoryDto import team.aliens.dms.domain.point.dto.PointRequestType import team.aliens.dms.domain.point.model.PointType import team.aliens.dms.domain.point.spi.PointQueryStudentPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointHistoryPort -import team.aliens.dms.domain.point.dto.PointHistoryDto import team.aliens.dms.domain.student.exception.StudentNotFoundException import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.student.model.Student diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointOptionsUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointOptionsUseCaseTest.kt index ce6acb2f4..9c2c1e1e5 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointOptionsUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/QueryPointOptionsUseCaseTest.kt @@ -15,7 +15,6 @@ import team.aliens.dms.domain.point.model.PointType import team.aliens.dms.domain.point.spi.PointQueryManagerPort import team.aliens.dms.domain.point.spi.PointSecurityPort import team.aliens.dms.domain.point.spi.QueryPointOptionPort -import team.aliens.dms.domain.user.exception.UserNotFoundException import java.util.UUID @ExtendWith(SpringExtension::class) @@ -63,17 +62,17 @@ class QueryPointOptionsUseCaseTest { @Test fun `상벌점 항목 조회 성공`() { - //given + // given every { securityPort.getCurrentUserId() } returns managerId every { queryManagerPort.queryManagerById(managerId) } returns managerStub every { queryPointOptionPort.queryPointOptionsBySchoolIdAndKeyword(schoolId, keyword) } returns listOf(pointOptionStub) - //when + // when val response = queryPointOptionsUseCase.execute(keyword).pointOptions - //then + // then assertEquals(response[0], responseStub) } @@ -89,4 +88,4 @@ class QueryPointOptionsUseCaseTest { queryPointOptionsUseCase.execute(keyword) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/RemovePointOptionUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/RemovePointOptionUseCaseTest.kt index 146d83801..00b5ab00d 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/RemovePointOptionUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/RemovePointOptionUseCaseTest.kt @@ -65,7 +65,7 @@ class RemovePointOptionUseCaseTest { @Test fun `상벌점 항목 삭제 성공`() { - //given + // given every { securityPort.getCurrentUserId() } returns currentUserId every { queryManagerPort.queryManagerById(managerId) } returns managerStub @@ -80,7 +80,7 @@ class RemovePointOptionUseCaseTest { @Test fun `상벌점 항목 미존재`() { - //given + // given every { securityPort.getCurrentUserId() } returns currentUserId every { queryManagerPort.queryManagerById(managerId) } returns managerStub @@ -95,7 +95,7 @@ class RemovePointOptionUseCaseTest { @Test fun `학교 불일치`() { - //given + // given every { securityPort.getCurrentUserId() } returns currentUserId every { queryManagerPort.queryManagerById(managerId) } returns managerStub @@ -115,9 +115,8 @@ class RemovePointOptionUseCaseTest { every { queryManagerPort.queryManagerById(managerId) } returns null - assertThrows { removePointOptionUseCase.execute(pointOptionId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/UpdatePointOptionUseCaseTest.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/UpdatePointOptionUseCaseTest.kt index 815e0e594..9737d62ca 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/UpdatePointOptionUseCaseTest.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/point.usecase/UpdatePointOptionUseCaseTest.kt @@ -2,7 +2,6 @@ package team.aliens.dms.domain.point.usecase import io.mockk.every import io.mockk.mockk -import java.util.UUID import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows @@ -19,6 +18,7 @@ import team.aliens.dms.domain.point.spi.QueryPointOptionPort import team.aliens.dms.domain.school.exception.SchoolMismatchException import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User +import java.util.UUID @ExtendWith(SpringExtension::class) class UpdatePointOptionUseCaseTest { @@ -39,16 +39,16 @@ class UpdatePointOptionUseCaseTest { private val schoolId2 = UUID.randomUUID() private val userStub by lazy { - User( - id = managerId, - schoolId = schoolId, - accountId = "manager", - password = "pw", - email = "manaager@manager.com", - authority = Authority.MANAGER, - createdAt = null, - deletedAt = null - ) + User( + id = managerId, + schoolId = schoolId, + accountId = "manager", + password = "pw", + email = "manaager@manager.com", + authority = Authority.MANAGER, + createdAt = null, + deletedAt = null + ) } private val pointOptionStub by lazy { @@ -127,4 +127,4 @@ class UpdatePointOptionUseCaseTest { updatePointOptionUseCase.execute(pointOptionId, name, score) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCaseTests.kt index 1a0dece4a..8f1869707 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ApplyRemainUseCaseTests.kt @@ -66,11 +66,13 @@ class ApplyRemainUseCaseTests { @Test fun `잔류 신청 성공`() { - //given + // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns userStub every { queryRemainOptionPort.queryRemainOptionById(remainOptionId) } returns remainOptionStub - every { queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) } returns remainAvailableTimeStub + every { + queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) + } returns remainAvailableTimeStub every { remainAvailableTimeStub.isAvailable() } returns true // when & then @@ -81,7 +83,7 @@ class ApplyRemainUseCaseTests { @Test fun `유저가 존재하지 않음`() { - //given + // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns null @@ -93,11 +95,13 @@ class ApplyRemainUseCaseTests { @Test fun `잔류 신청 가능 시간이 아님`() { - //given + // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns userStub every { queryRemainOptionPort.queryRemainOptionById(remainOptionId) } returns remainOptionStub - every { queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) } returns remainAvailableTimeStub + every { + queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) + } returns remainAvailableTimeStub every { remainAvailableTimeStub.isAvailable() } returns false // when & then @@ -108,7 +112,7 @@ class ApplyRemainUseCaseTests { @Test fun `잔류 항목이 존재하지 않음`() { - //given + // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns userStub every { queryRemainOptionPort.queryRemainOptionById(remainOptionId) } returns null @@ -130,11 +134,13 @@ class ApplyRemainUseCaseTests { @Test fun `다른 학교의 잔류 항목임`() { - //given + // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns userStub every { queryRemainOptionPort.queryRemainOptionById(remainOptionId) } returns otherRemainOptionStub - every { queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) } returns remainAvailableTimeStub + every { + queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) + } returns remainAvailableTimeStub every { remainAvailableTimeStub.isAvailable() } returns true // when & then @@ -142,4 +148,4 @@ class ApplyRemainUseCaseTests { applyRemainUseCase.execute(remainOptionId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainUseCaseTests.kt index d6dac6b30..7f20dbf69 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/CreateRemainUseCaseTests.kt @@ -23,7 +23,9 @@ class CreateRemainUseCaseTests { private val queryUserPort: QueryUserPort = mockk(relaxed = true) private val commentRemainOptionPort: CommandRemainOptionPort = mockk(relaxed = true) - private val createRemainOptionUseCase = CreateRemainOptionUseCase(securityPort, queryUserPort, commentRemainOptionPort) + private val createRemainOptionUseCase = CreateRemainOptionUseCase( + securityPort, queryUserPort, commentRemainOptionPort + ) private val managerId = UUID.randomUUID() private val schoolId = UUID.randomUUID() @@ -79,5 +81,4 @@ class CreateRemainUseCaseTests { createRemainOptionUseCase.execute(title, description) } } - -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCaseTests.kt index c739fd2eb..101bddfee 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/ExportRemainStatusUseCaseTests.kt @@ -146,4 +146,4 @@ class ExportRemainStatusUseCaseTests { exportRemainStatusUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCaseTests.kt index 019f900a7..5e640666d 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryCurrentAppliedRemainOptionUseCaseTests.kt @@ -92,4 +92,4 @@ class QueryCurrentAppliedRemainOptionUseCaseTests { queryCurrentAppliedRemainOptionUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCaseTests.kt index 35c2f0c32..a4dc6ddcc 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainAvailableTimeUseCaseTests.kt @@ -50,19 +50,20 @@ class QueryRemainAvailableTimeUseCaseTests { RemainAvailableTime( id = schoolId, startDayOfWeek = DayOfWeek.WEDNESDAY, - startTime = LocalTime.of(0,0), + startTime = LocalTime.of(0, 0), endDayOfWeek = DayOfWeek.FRIDAY, endTime = LocalTime.of(23, 59) ) } - @Test fun `잔류 신청 시간 보기 성공`() { // given every { securityPort.getCurrentUserId() } returns userId every { queryUserPort.queryUserById(userId) } returns userStub - every { queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) } returns remainAvailableTimeStub + every { + queryRemainAvailableTimePort.queryRemainAvailableTimeBySchoolId(schoolId) + } returns remainAvailableTimeStub // when & then assertDoesNotThrow { diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCaseTests.kt index 53699a0a3..461403289 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/QueryRemainOptionsUseCaseTests.kt @@ -116,4 +116,4 @@ class QueryRemainOptionsUseCaseTests { queryRemainOptionsUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCaseTests.kt index b7cb8615c..c5ba76427 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/RemoveRemainOptionUseCaseTests.kt @@ -103,7 +103,7 @@ class RemoveRemainOptionUseCaseTests { @Test fun `같은 학교의 매니저가 아님`() { - //given + // given every { securityPort.getCurrentUserId() } returns managerId every { queryUserPort.queryUserById(managerId) } returns userStub @@ -118,7 +118,7 @@ class RemoveRemainOptionUseCaseTests { @Test fun `유저가 존재하지 않음`() { - //given + // given every { securityPort.getCurrentUserId() } returns managerId every { queryUserPort.queryUserById(managerId) } returns null @@ -128,4 +128,4 @@ class RemoveRemainOptionUseCaseTests { removeRemainOptionUseCase.execute(remainOptionId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCaseTests.kt index d6c28c80a..a72ebc6bc 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainAvailableTimeUseCaseTests.kt @@ -36,10 +36,10 @@ class UpdateRemainAvailableTimeUseCaseTests { @BeforeEach fun setUp() { updateRemainAvailableTimeUseCase = UpdateRemainAvailableTimeUseCase( - securityPort, - queryUserPort, - commandRemainAvailableTimePort - ) + securityPort, + queryUserPort, + commandRemainAvailableTimePort + ) } private val userId = UUID.randomUUID() @@ -96,4 +96,4 @@ class UpdateRemainAvailableTimeUseCaseTests { updateRemainAvailableTimeUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCaseTests.kt index 87e791d19..2745358e3 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/remain/usecase/UpdateRemainOptionUseCaseTests.kt @@ -6,7 +6,6 @@ import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.extension.ExtendWith -import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.remain.exception.RemainOptionNotFoundException @@ -27,7 +26,7 @@ class UpdateRemainOptionUseCaseTests { private val queryUserPort: RemainQueryUserPort = mockk(relaxed = true) private val queryRemainOptionPort: QueryRemainOptionPort = mockk(relaxed = true) private val commandRemainOptionPort: CommandRemainOptionPort = mockk(relaxed = true) - + private val updateRemainOptionUseCase = UpdateRemainOptionUseCase( securityPort, queryUserPort, queryRemainOptionPort, commandRemainOptionPort ) @@ -70,7 +69,7 @@ class UpdateRemainOptionUseCaseTests { every { queryRemainOptionPort.queryRemainOptionById(remainOptionId) } returns remainOptionStub - //when & then + // when & then assertDoesNotThrow { updateRemainOptionUseCase.execute(remainOptionId, title, description) } diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCaseTests.kt index 20a4b0941..a9c33c9ac 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolAnswerUseCaseTests.kt @@ -82,4 +82,4 @@ class CheckSchoolAnswerUseCaseTests { checkSchoolAnswerUseCase.execute(schoolId, "wrong answer") } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCaseTests.kt index c88cd7b76..06174f5fd 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/CheckSchoolCodeUseCaseTests.kt @@ -67,4 +67,4 @@ class CheckSchoolCodeUseCaseTests { checkSchoolCodeUseCase.execute(schoolCode) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCaseTests.kt index a27289764..db9916d44 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolQuestionUseCaseTests.kt @@ -68,4 +68,4 @@ class QuerySchoolQuestionUseCaseTests { querySchoolQuestionUseCase.execute(schoolId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCaseTests.kt index 09d35cf6d..46ada07de 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/QuerySchoolsUseCaseTests.kt @@ -65,5 +65,4 @@ class QuerySchoolsUseCaseTests { // then assertThat(response).isNotNull } - -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCaseTests.kt index f11883c01..f498a016d 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/ReissueSchoolCodeUseCaseTests.kt @@ -127,4 +127,4 @@ class ReissueSchoolCodeUseCaseTests { reissueSchoolCodeUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCaseTests.kt index 07be7fe82..83417f500 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/school/usecase/UpdateQuestionUseCaseTests.kt @@ -131,4 +131,4 @@ class UpdateQuestionUseCaseTests { updateQuestionUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCaseTests.kt index 5fc220da6..b179e10bd 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedAccountIdUseCaseTests.kt @@ -49,4 +49,4 @@ class CheckDuplicatedAccountIdUseCaseTests { checkDuplicatedAccountIdUseCase.execute(accountId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCaseTests.kt index ce9ccd68b..4bda11cc5 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckDuplicatedEmailUseCaseTests.kt @@ -49,4 +49,4 @@ class CheckDuplicatedEmailUseCaseTests { checkDuplicatedEmailUseCase.execute(email) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCaseTests.kt index 55d54e8b9..c399f86d6 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/CheckStudentGcnUseCaseTests.kt @@ -11,14 +11,14 @@ import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.domain.school.exception.SchoolNotFoundException import team.aliens.dms.domain.school.model.School import team.aliens.dms.domain.student.dto.CheckStudentGcnRequest +import team.aliens.dms.domain.student.exception.VerifiedStudentNotFoundException import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.student.model.Student +import team.aliens.dms.domain.student.model.VerifiedStudent import team.aliens.dms.domain.student.spi.StudentQuerySchoolPort +import team.aliens.dms.domain.student.spi.StudentQueryVerifiedStudentPort import java.time.LocalDate import java.util.UUID -import team.aliens.dms.domain.student.exception.VerifiedStudentNotFoundException -import team.aliens.dms.domain.student.model.VerifiedStudent -import team.aliens.dms.domain.student.spi.StudentQueryVerifiedStudentPort @ExtendWith(SpringExtension::class) class CheckStudentGcnUseCaseTests { @@ -92,7 +92,6 @@ class CheckStudentGcnUseCaseTests { assertEquals(response, verifiedStudent.name) } - @Test fun `학교 존재하지 않음`() { // given @@ -124,4 +123,4 @@ class CheckStudentGcnUseCaseTests { checkStudentGcnUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCaseTests.kt index e33eeecfd..61d2e1549 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/FindStudentAccountIdUseCaseTests.kt @@ -166,4 +166,4 @@ class FindStudentAccountIdUseCaseTests { findStudentAccountIdUseCase.execute(schoolId, requestStub.copy(name = "이준서")) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCaseTests.kt index 807cdcfe9..ef6c4aa29 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/ResetStudentPasswordUseCaseTests.kt @@ -15,7 +15,6 @@ import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.auth.model.EmailType import team.aliens.dms.domain.student.dto.ResetStudentPasswordRequest import team.aliens.dms.domain.student.exception.StudentInfoMismatchException -import team.aliens.dms.domain.student.exception.StudentNotFoundException import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.student.model.Student import team.aliens.dms.domain.student.spi.QueryStudentPort @@ -23,6 +22,7 @@ import team.aliens.dms.domain.student.spi.StudentCommandUserPort import team.aliens.dms.domain.student.spi.StudentQueryAuthCodePort import team.aliens.dms.domain.student.spi.StudentQueryUserPort import team.aliens.dms.domain.student.spi.StudentSecurityPort +import team.aliens.dms.domain.user.exception.InvalidRoleException import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User import team.aliens.dms.domain.user.service.CheckUserAuthority @@ -183,12 +183,11 @@ class ResetStudentPasswordUseCaseTests { .willReturn(Authority.MANAGER) // when & then - assertThrows { + assertThrows { resetStudentPasswordUseCase.execute(requestStub) } } - @Test fun `학생 정보 이름 불일치`() { // given @@ -284,4 +283,4 @@ class ResetStudentPasswordUseCaseTests { resetStudentPasswordUseCase.execute(requestStub.copy(authCode = "222222")) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCaseTests.kt index 062db214e..0f289294b 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/SignUpUseCaseTests.kt @@ -7,20 +7,16 @@ import org.junit.jupiter.api.extension.ExtendWith import org.mockito.BDDMockito.given import org.springframework.boot.test.mock.mockito.MockBean import org.springframework.test.context.junit.jupiter.SpringExtension -import team.aliens.dms.domain.auth.dto.TokenResponse import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException import team.aliens.dms.domain.auth.exception.AuthCodeNotFoundException import team.aliens.dms.domain.auth.model.AuthCode -import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.auth.model.EmailType import team.aliens.dms.domain.room.exception.RoomNotFoundException import team.aliens.dms.domain.room.model.Room import team.aliens.dms.domain.school.exception.AnswerMismatchException import team.aliens.dms.domain.school.exception.SchoolCodeMismatchException -import team.aliens.dms.domain.school.model.AvailableFeature import team.aliens.dms.domain.school.model.School import team.aliens.dms.domain.student.dto.SignUpRequest -import team.aliens.dms.domain.student.dto.SignUpResponse import team.aliens.dms.domain.student.exception.VerifiedStudentNotFoundException import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.student.model.Student @@ -36,9 +32,7 @@ import team.aliens.dms.domain.student.spi.StudentQueryVerifiedStudentPort import team.aliens.dms.domain.student.spi.StudentSecurityPort import team.aliens.dms.domain.user.exception.UserAccountIdExistsException import team.aliens.dms.domain.user.exception.UserEmailExistsException -import team.aliens.dms.domain.user.model.User import java.time.LocalDate -import java.time.LocalDateTime import java.util.UUID @ExtendWith(SpringExtension::class) @@ -89,7 +83,6 @@ class SignUpUseCaseTests { } private val id = UUID.randomUUID() - private val userId = UUID.randomUUID() private val code = "12345678" private val email = "test@test.com" private val accountId = "test accountId" @@ -139,62 +132,6 @@ class SignUpUseCaseTests { ) } - private val userStub by lazy { - User( - id = userId, - schoolId = schoolStub.id, - accountId = accountId, - password = password, - email = email, - authority = Authority.STUDENT, - createdAt = LocalDateTime.now(), - deletedAt = null - ) - } - - private val savedUserStub by lazy { - User( - id = userStub.id, - schoolId = userStub.schoolId, - accountId = userStub.accountId, - password = userStub.password, - email = userStub.email, - authority = userStub.authority, - createdAt = LocalDateTime.now(), - deletedAt = null - ) - } - - private val studentStub by lazy { - Student( - id = savedUserStub.id, - roomId = UUID.randomUUID(), - roomNumber = 123, - schoolId = savedUserStub.schoolId, - grade = 1, - classRoom = 1, - number = 1, - name = name, - profileImageUrl = profileImageUrl, - sex = Sex.FEMALE - ) - } - - private val savedStudentStub by lazy { - Student( - id = studentStub.id, - roomId = studentStub.roomId, - roomNumber = studentStub.roomNumber, - schoolId = studentStub.schoolId, - grade = studentStub.grade, - classRoom = studentStub.classRoom, - number = studentStub.number, - name = studentStub.name, - profileImageUrl = studentStub.profileImageUrl, - sex = studentStub.sex - ) - } - private val requestStub by lazy { SignUpRequest( schoolCode = code, @@ -232,21 +169,6 @@ class SignUpUseCaseTests { private val gcnStub = "${requestStub.grade}${requestStub.classRoom}${Student.processNumber(requestStub.number)}" - private val signUpResponseStub by lazy { - SignUpResponse( - accessToken = tokenResponseStub.accessToken, - accessTokenExpiredAt = tokenResponseStub.accessTokenExpiredAt, - refreshToken = tokenResponseStub.refreshToken, - refreshTokenExpiredAt = tokenResponseStub.refreshTokenExpiredAt, - features = SignUpResponse.Features( - mealService = true, - noticeService = true, - pointService = true, - studyRoomService = false - ) - ) - } - // @Test // fun `회원가입 성공`() { // // given @@ -482,4 +404,4 @@ class SignUpUseCaseTests { // signUpUseCase.execute(requestStub) // } // } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCaseTests.kt index 5488cc768..9096b25b9 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/StudentMyPageUseCaseTests.kt @@ -210,4 +210,4 @@ class StudentMyPageUseCaseTests { studentMyPageUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCaseTests.kt index 22cf3f4f4..bc0136ff4 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/student/usecase/UpdateStudentProfileUseCaseTests.kt @@ -87,4 +87,4 @@ class UpdateStudentProfileUseCaseTests { updateStudentProfileUseCase.execute(profileImageUrl) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCaseTests.kt index 5487d4041..164b976d0 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/CreateStudyRoomUseCaseTests.kt @@ -168,4 +168,4 @@ class CreateStudyRoomUseCaseTests { createStudyRoomUseCase.execute(requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCaseTests.kt index 9f695ab9b..54c68b361 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomUseCaseTests.kt @@ -1,7 +1,5 @@ package team.aliens.dms.domain.studyroom.usecase -import java.time.LocalDateTime -import java.util.UUID import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow @@ -13,7 +11,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.school.exception.SchoolMismatchException import team.aliens.dms.domain.student.model.Sex -import team.aliens.dms.domain.student.model.Student import team.aliens.dms.domain.studyroom.exception.StudyRoomNotFoundException import team.aliens.dms.domain.studyroom.model.SeatStatus import team.aliens.dms.domain.studyroom.model.StudyRoom @@ -23,6 +20,8 @@ import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User +import java.time.LocalDateTime +import java.util.UUID @ExtendWith(SpringExtension::class) class ManagerQueryStudyRoomUseCaseTests { @@ -101,21 +100,6 @@ class ManagerQueryStudyRoomUseCaseTests { ) } - private val studentStub by lazy { - Student( - id = studentId, - roomId = UUID.randomUUID(), - roomNumber = 1, - schoolId = schoolId, - grade = 1, - classRoom = 1, - number = 1, - name = "이정윤", - profileImageUrl = "https://~", - sex = Sex.MALE - ) - } - @Test fun `자습실 조회 성공`() { // given @@ -355,4 +339,4 @@ class ManagerQueryStudyRoomUseCaseTests { managerQueryStudyRoomUseCase.execute(studyRoomId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCaseTests.kt index f402696b4..b100fdbea 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/ManagerQueryStudyRoomsUseCaseTests.kt @@ -1,7 +1,5 @@ package team.aliens.dms.domain.studyroom.usecase -import java.time.LocalDateTime -import java.util.UUID import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow @@ -20,6 +18,8 @@ import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.studyroom.spi.vo.StudyRoomVO import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User +import java.time.LocalDateTime +import java.util.UUID @ExtendWith(SpringExtension::class) class ManagerQueryStudyRoomsUseCaseTests { @@ -119,4 +119,4 @@ class ManagerQueryStudyRoomsUseCaseTests { managerQueryStudyRoomsUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCaseTests.kt index db52fc4f3..214aaf4bf 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/QueryCurrentAppliedStudyRoomUseCaseTests.kt @@ -105,7 +105,7 @@ class QueryCurrentAppliedStudyRoomUseCaseTests { @Test fun `자습실을 찾지 못함`() { - //given + // given given(securityPort.getCurrentUserId()) .willReturn(currentUserId) @@ -115,9 +115,9 @@ class QueryCurrentAppliedStudyRoomUseCaseTests { given(queryStudyRoomPort.queryStudyRoomById(studyRoomId)) .willReturn(null) - //when & then + // when & then assertThrows { queryCurrentAppliedStudyRoomUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCaseTests.kt index 768a31502..426ac4c7a 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomUseCaseTests.kt @@ -1,7 +1,5 @@ package team.aliens.dms.domain.studyroom.usecase -import java.time.LocalDateTime -import java.util.UUID import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow @@ -13,15 +11,17 @@ import org.springframework.test.context.junit.jupiter.SpringExtension import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.school.exception.SchoolMismatchException import team.aliens.dms.domain.student.model.Sex -import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.exception.StudyRoomNotFoundException import team.aliens.dms.domain.studyroom.model.SeatStatus import team.aliens.dms.domain.studyroom.model.StudyRoom import team.aliens.dms.domain.studyroom.spi.QueryStudyRoomPort import team.aliens.dms.domain.studyroom.spi.StudyRoomQueryUserPort import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort +import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User +import java.time.LocalDateTime +import java.util.UUID @ExtendWith(SpringExtension::class) class StudentQueryStudyRoomUseCaseTests { @@ -338,4 +338,4 @@ class StudentQueryStudyRoomUseCaseTests { studentQueryStudyRoomUseCase.execute(studyRoomId) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCaseTests.kt index 6d49399fc..2a64640f6 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/StudentQueryStudyRoomsUseCaseTests.kt @@ -1,7 +1,5 @@ package team.aliens.dms.domain.studyroom.usecase -import java.time.LocalDateTime -import java.util.UUID import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertDoesNotThrow @@ -20,6 +18,8 @@ import team.aliens.dms.domain.studyroom.spi.StudyRoomSecurityPort import team.aliens.dms.domain.studyroom.spi.vo.StudyRoomVO import team.aliens.dms.domain.user.exception.UserNotFoundException import team.aliens.dms.domain.user.model.User +import java.time.LocalDateTime +import java.util.UUID @ExtendWith(SpringExtension::class) class StudentQueryStudyRoomsUseCaseTests { @@ -161,4 +161,4 @@ class StudentQueryStudyRoomsUseCaseTests { studentQueryStudyRoomsUseCase.execute() } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCaseTests.kt index 9bd13f0d4..2fb0294a2 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/studyroom/usecase/UpdateStudyRoomUseCaseTests.kt @@ -131,8 +131,9 @@ class UpdateStudyRoomUseCaseTests { ) ) - given(queryStudyRoomPort.existsStudyRoomByFloorAndNameAndSchoolId(requestStub.floor, requestStub.name, schoolId)) - .willReturn(false) + given( + queryStudyRoomPort.existsStudyRoomByFloorAndNameAndSchoolId(requestStub.floor, requestStub.name, schoolId) + ).willReturn(false) // when & then assertDoesNotThrow { @@ -242,4 +243,4 @@ class UpdateStudyRoomUseCaseTests { updateStudyRoomUseCase.execute(studyRoomId, requestStub) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCaseTests.kt index 7d7cdb81a..6078a4ffb 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UpdateUserPasswordUseCaseTests.kt @@ -119,4 +119,4 @@ class UpdateUserPasswordUseCaseTests { updateUserPasswordUseCase.execute(updateUserPasswordRequest) } } -} \ No newline at end of file +} diff --git a/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCaseTests.kt b/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCaseTests.kt index e6cf8c6cc..f0b1431c0 100644 --- a/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCaseTests.kt +++ b/dms-application/src/test/kotlin/team/aliens/dms/domain/user/usecase/UserPasswordCompareUseCaseTests.kt @@ -101,4 +101,4 @@ class UserPasswordCompareUseCaseTests { userPasswordCompareUseCase.execute(password) } } -} \ No newline at end of file +} diff --git a/dms-domain/config/detekt/detekt.yml b/dms-domain/config/detekt/detekt.yml new file mode 100644 index 000000000..15ced9138 --- /dev/null +++ b/dms-domain/config/detekt/detekt.yml @@ -0,0 +1,809 @@ +build: + maxIssues: -1 + excludeCorrectable: false + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +config: + validation: true + warningsAsErrors: false + # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' + excludes: '' + +processors: + active: true + exclude: + - 'DetektProgressListener' + # - 'KtFileCountProcessor' + # - 'PackageCountProcessor' + # - 'ClassCountProcessor' + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ProjectComplexityProcessor' + # - 'ProjectCognitiveComplexityProcessor' + # - 'ProjectLLOCProcessor' + # - 'ProjectCLOCProcessor' + # - 'ProjectLOCProcessor' + # - 'ProjectSLOCProcessor' + # - 'LicenseHeaderLoaderExtension' + +console-reports: + active: true + exclude: + - 'ProjectStatisticsReport' + - 'ComplexityReport' + - 'NotificationReport' + # - 'FindingsReport' + - 'FileBasedFindingsReport' + - 'LiteFindingsReport' + +output-reports: + active: true + exclude: + # - 'TxtOutputReport' + # - 'XmlOutputReport' + # - 'HtmlOutputReport' + +comments: + active: true + AbsentOrWrongFileLicense: + active: false + licenseTemplateFile: 'license.template' + licenseTemplateIsRegex: false + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + DeprecatedBlockTag: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' + OutdatedDocumentation: + active: false + matchTypeParameters: true + matchDeclarationsOrder: true + UndocumentedPublicClass: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UndocumentedPublicProperty: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + +complexity: + active: true + ComplexCondition: + active: true + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + includePrivateDeclarations: false + ComplexMethod: + active: true + threshold: 15 + ignoreSingleWhenExpression: false + ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: + - 'also' + - 'apply' + - 'forEach' + - 'isNotNull' + - 'ifNull' + - 'let' + - 'run' + - 'use' + - 'with' + LabeledExpression: + active: false + ignoredLabels: [] + LargeClass: + active: true + threshold: 600 + LongMethod: + active: true + threshold: 60 + LongParameterList: + active: true + functionThreshold: 6 + constructorThreshold: 7 + ignoreDefaultParameters: false + ignoreDataClasses: true + ignoreAnnotatedParameter: [] + excludes: ['**/vo/**', '**/usecase/**'] + MethodOverloading: + active: false + threshold: 6 + NamedArguments: + active: false + threshold: 3 + NestedBlockDepth: + active: true + threshold: 4 + ReplaceSafeCallChainWithRun: + active: false + StringLiteralDuplication: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + ignoreOverridden: false + +coroutines: + active: true + GlobalCoroutineUsage: + active: false + InjectDispatcher: + active: false + dispatcherNames: + - 'IO' + - 'Default' + - 'Unconfined' + RedundantSuspendModifier: + active: false + SleepInsteadOfDelay: + active: false + SuspendFunWithFlowReturnType: + active: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: '_|(ignore|expected).*' + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverridden: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyTryBlock: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: true + methodNames: + - 'equals' + - 'finalize' + - 'hashCode' + - 'toString' + InstanceOfCheckForException: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + NotImplementedDeclaration: + active: false + ObjectExtendsThrowable: + active: false + PrintStackTrace: + active: true + RethrowCaughtException: + active: true + ReturnFromFinally: + active: true + ignoreLabeled: false + SwallowedException: + active: true + ignoredExceptionTypes: + - 'InterruptedException' + - 'MalformedURLException' + - 'NumberFormatException' + - 'ParseException' + allowedExceptionNameRegex: '_|(ignore|expected).*' + ThrowingExceptionFromFinally: + active: true + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptions: + - 'ArrayIndexOutOfBoundsException' + - 'Exception' + - 'IllegalArgumentException' + - 'IllegalMonitorStateException' + - 'IllegalStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + ThrowingNewInstanceOfSameException: + active: true + TooGenericExceptionCaught: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptionNames: + - 'ArrayIndexOutOfBoundsException' + - 'Error' + - 'Exception' + - 'IllegalMonitorStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + allowedExceptionNameRegex: '_|(ignore|expected).*' + TooGenericExceptionThrown: + active: true + exceptionNames: + - 'Error' + - 'Exception' + - 'RuntimeException' + - 'Throwable' + +formatting: + active: true + android: false + autoCorrect: true + AnnotationOnSeparateLine: + active: false + autoCorrect: true + AnnotationSpacing: + active: false + autoCorrect: true + ArgumentListWrapping: + active: false + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + EnumEntryNameCase: + active: false + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + insertFinalNewLine: true + ImportOrdering: + active: true + autoCorrect: true + layout: '*,java.**,javax.**,kotlin.**,^' + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: true + maxLineLength: 120 + ignoreBackTickedIdentifier: false + ModifierOrdering: + active: true + autoCorrect: true + MultiLineIfElse: + active: false + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoEmptyFirstLineInMethodBlock: + active: false + autoCorrect: true + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + PackageName: + active: false + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + SpacingAroundAngleBrackets: + active: false + autoCorrect: true + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundDot: + active: true + autoCorrect: true + SpacingAroundDoubleColon: + active: false + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundParens: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + SpacingAroundUnaryOperator: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithAnnotations: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithComments: + active: false + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + BooleanPropertyNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + allowedPattern: '^(is|has|are)' + ClassNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + classPattern: '[A-Z][a-zA-Z0-9]*' + ConstructorParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + EnumNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + forbiddenName: [] + FunctionMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' + excludeClassPattern: '$^' + ignoreOverridden: true + FunctionParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + InvalidPackageDeclaration: + active: false + rootPackage: '' + LambdaParameterNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*|_' + MatchingDeclarationName: + active: true + mustBeFirst: true + MemberNameEqualsClassName: + active: true + ignoreOverridden: true + NoNameShadowing: + active: false + NonBooleanPropertyPrefixedWithIs: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ObjectPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' + TopLevelPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' + VariableMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumVariableNameLength: 64 + VariableMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumVariableNameLength: 1 + VariableNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + +performance: + active: true + ArrayPrimitive: + active: true + ForEachOnRange: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + SpreadOperator: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + AvoidReferentialEquality: + active: false + forbiddenTypePatterns: + - 'kotlin.String' + CastToNullableType: + active: false + Deprecation: + active: false + DontDowncastCollectionTypes: + active: false + DoubleMutabilityForCollection: + active: false + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: true + EqualsWithHashCodeExist: + active: true + ExitOutsideMain: + active: false + ExplicitGarbageCollectionCall: + active: true + HasPlatformType: + active: false + IgnoredReturnValue: + active: false + restrictToAnnotatedMethods: true + returnValueAnnotations: + - '*.CheckResult' + - '*.CheckReturnValue' + ignoreReturnValueAnnotations: + - '*.CanIgnoreReturnValue' + ImplicitDefaultLocale: + active: true + ImplicitUnitReturnType: + active: false + allowExplicitReturnType: true + InvalidRange: + active: true + IteratorHasNextCallsNextMethod: + active: true + IteratorNotThrowingNoSuchElementException: + active: true + LateinitUsage: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreOnClassesPattern: '' + MapGetWithNotNullAssertionOperator: + active: false + MissingPackageDeclaration: + active: false + excludes: ['**/*.kts'] + MissingWhenCase: + active: true + allowElseExpression: true + NullableToStringCall: + active: false + RedundantElseInWhen: + active: true + UnconditionalJumpStatementInLoop: + active: false + UnnecessaryNotNullOperator: + active: true + UnnecessarySafeCall: + active: true + UnreachableCatchBlock: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnsafeCast: + active: true + UnusedUnaryOperator: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: true + +style: + active: true + ClassOrdering: + active: false + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + DataClassShouldBeImmutable: + active: false + DestructuringDeclarationWithTooManyEntries: + active: false + maxDestructuringEntries: 3 + EqualsNullCall: + active: true + EqualsOnSignatureLine: + active: false + ExplicitCollectionElementAccessMethod: + active: false + ExplicitItLambdaParameter: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: + - 'FIXME:' + - 'STOPSHIP:' + - 'TODO:' + allowedPatterns: '' + customMessage: '' + ForbiddenImport: + active: false + imports: [] + forbiddenPatterns: '' + ForbiddenMethodCall: + active: false + methods: + - 'kotlin.io.print' + - 'kotlin.io.println' + ForbiddenPublicDataClass: + active: true + excludes: ['**'] + ignorePackages: + - '*.internal' + - '*.internal.*' + ForbiddenVoid: + active: false + ignoreOverridden: false + ignoreUsageInGenerics: false + FunctionOnlyReturningConstant: + active: true + ignoreOverridableFunction: true + ignoreActualFunction: true + excludedFunctions: '' + LibraryCodeMustSpecifyReturnType: + active: true + excludes: ['**'] + LibraryEntitiesShouldNotBePublic: + active: true + excludes: ['**'] + LoopWithTooManyJumpStatements: + active: true + maxJumpCount: 1 + MagicNumber: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreNumbers: + - '-1' + - '0' + - '1' + - '2' + ignoreHashCodeFunction: true + ignorePropertyDeclaration: false + ignoreLocalVariableDeclaration: false + ignoreConstantDeclaration: true + ignoreCompanionObjectPropertyDeclaration: true + ignoreAnnotation: false + ignoreNamedArgument: true + ignoreEnums: false + ignoreRanges: false + ignoreExtensionFunctions: true + MandatoryBracesIfStatements: + active: false + MandatoryBracesLoops: + active: false + MaxLineLength: + active: true + maxLineLength: 120 + excludePackageStatements: true + excludeImportStatements: true + excludeCommentStatements: false + MayBeConst: + active: true + ModifierOrder: + active: true + MultilineLambdaItParameter: + active: false + NestedClassesVisibility: + active: true + NewLineAtEndOfFile: + active: true + NoTabs: + active: false + ObjectLiteralToLambda: + active: false + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: true + RedundantExplicitType: + active: false + RedundantHigherOrderMapUsage: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: 'equals' + excludeLabeled: false + excludeReturnFromLambda: true + excludeGuardClauses: false + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: true + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 4 + excludeGuardClauses: true + TrailingWhitespace: + active: false + UnderscoresInNumericLiterals: + active: false + acceptableLength: 4 + UnnecessaryAbstractClass: + active: true + UnnecessaryAnnotationUseSiteTarget: + active: false + UnnecessaryApply: + active: true + UnnecessaryFilter: + active: false + UnnecessaryInheritance: + active: true + UnnecessaryLet: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateClass: + active: true + UnusedPrivateMember: + active: true + allowedNames: '(_|ignored|expected|serialVersionUID)' + UseAnyOrNoneInsteadOfFind: + active: false + UseArrayLiteralsInAnnotations: + active: false + UseCheckNotNull: + active: false + UseCheckOrError: + active: false + UseDataClass: + active: false + allowVars: false + UseEmptyCounterpart: + active: false + UseIfEmptyOrIfBlank: + active: false + UseIfInsteadOfWhen: + active: false + UseIsNullOrEmpty: + active: false + UseOrEmpty: + active: false + UseRequire: + active: false + UseRequireNotNull: + active: false + UselessCallOnNotNull: + active: true + UtilityClassWithPublicConstructor: + active: true + VarCouldBeVal: + active: true + WildcardImport: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] +# excludeImports: +# - 'java.util.*' diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/common/annotation/DomainService.kt b/dms-domain/src/main/kotlin/team/aliens/dms/common/annotation/DomainService.kt index 54d90189e..b5b027f8c 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/common/annotation/DomainService.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/common/annotation/DomainService.kt @@ -2,4 +2,4 @@ package team.aliens.dms.common.annotation @Retention(AnnotationRetention.RUNTIME) @Target(AnnotationTarget.CLASS) -annotation class DomainService() \ No newline at end of file +annotation class DomainService() diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/common/error/DmsException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/common/error/DmsException.kt index 05ddb3549..6670a222f 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/common/error/DmsException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/common/error/DmsException.kt @@ -2,7 +2,7 @@ package team.aliens.dms.common.error abstract class DmsException( val errorProperty: ErrorProperty -): RuntimeException() { +) : RuntimeException() { override fun fillInStackTrace() = this -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.kt b/dms-domain/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.kt index 88cfca4f6..ce9a9e797 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/common/error/ErrorProperty.kt @@ -5,5 +5,4 @@ interface ErrorProperty { fun status(): Int fun message(): String - -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/error/AuthErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/error/AuthErrorCode.kt index 63f4720a5..3213a4ed9 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/error/AuthErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/error/AuthErrorCode.kt @@ -22,4 +22,4 @@ enum class AuthErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt similarity index 99% rename from dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt rename to dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt index 0b19f5561..45d266aa0 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeMismatchException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object AuthCodeMismatchException : DmsException( AuthErrorCode.AUTH_CODE_MISMATCH -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeOverLimitException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeOverLimitException.kt index 801fa1bd6..2fe58b254 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeOverLimitException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/exception/AuthCodeOverLimitException.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.auth.exception -import team.aliens.dms.domain.auth.error.AuthErrorCode import team.aliens.dms.common.error.DmsException +import team.aliens.dms.domain.auth.error.AuthErrorCode object AuthCodeOverLimitException : DmsException( AuthErrorCode.AUTH_CODE_OVER_LIMITED -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCode.kt index 762f823f9..6b9632fcf 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCode.kt @@ -1,6 +1,7 @@ package team.aliens.dms.domain.auth.model import team.aliens.dms.common.annotation.Aggregate +import team.aliens.dms.domain.auth.exception.AuthCodeMismatchException @Aggregate data class AuthCode( @@ -23,5 +24,12 @@ data class AuthCode( companion object { const val EXPIRED = 180 + const val AUTH_CODE_SIZE = 6 + } + + fun validateAuthCode(code: String) { + if (this.code == code) { + throw AuthCodeMismatchException + } } } diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCodeLimit.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCodeLimit.kt index 97b3153dd..1e7c684d5 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCodeLimit.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/AuthCodeLimit.kt @@ -1,7 +1,7 @@ package team.aliens.dms.domain.auth.model -import team.aliens.dms.domain.auth.exception.AuthCodeOverLimitException import team.aliens.dms.common.annotation.Aggregate +import team.aliens.dms.domain.auth.exception.AuthCodeOverLimitException import java.util.UUID @Aggregate diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.kt index 621c803db..65a939062 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/Authority.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.auth.model enum class Authority { STUDENT, MANAGER -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/EmailType.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/EmailType.kt index 9ee2c3e1b..ba6fdfbd4 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/EmailType.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/auth/model/EmailType.kt @@ -8,4 +8,4 @@ enum class EmailType( SIGNUP("signup_template", "DMS_SIGNUP_TEMPLATE", "DMS 회원가입 이메일 승인코드"), PASSWORD("password_template", "DMS_PASSWORD_TEMPLATE", "DMS 비밀번호 변경 이메일 승인코드") -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/error/FileErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/error/FileErrorCode.kt index cc72e43af..b0e4e2b1e 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/error/FileErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/error/FileErrorCode.kt @@ -14,4 +14,4 @@ enum class FileErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/model/File.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/model/File.kt index 49d2c1a47..9855fec7e 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/model/File.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/file/model/File.kt @@ -8,4 +8,4 @@ class File() { companion object { val FILE_DATE_FORMAT: DateTimeFormatter = DateTimeFormatter.ofPattern("yyyyMMdd") } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/error/ManagerErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/error/ManagerErrorCode.kt index 7c57f3aa8..b4ced62ce 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/error/ManagerErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/error/ManagerErrorCode.kt @@ -14,4 +14,4 @@ enum class ManagerErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/model/Manager.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/model/Manager.kt index ae39b952b..f0aad88f1 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/model/Manager.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/manager/model/Manager.kt @@ -19,4 +19,4 @@ data class Manager( companion object { const val PROFILE_IMAGE = "a" // TODO 기본 프로필 이미지 넣기 } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/meal/model/Meal.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/meal/model/Meal.kt index 909e73cef..8ba186c3f 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/meal/model/Meal.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/meal/model/Meal.kt @@ -23,4 +23,4 @@ data class Meal( * '||' 를 기준으로 급식 구분 **/ fun toSplit(meal: String?) = meal?.split("||").orEmpty() -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/error/NoticeErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/error/NoticeErrorCode.kt index 063b73aa9..f19924f41 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/error/NoticeErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/error/NoticeErrorCode.kt @@ -14,4 +14,4 @@ enum class NoticeErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/Notice.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/Notice.kt index fb0ca6c9b..fea396c0e 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/Notice.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/Notice.kt @@ -19,4 +19,4 @@ data class Notice( val updatedAt: LocalDateTime? -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/OrderType.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/OrderType.kt index a9f4cfee1..bc59c3bd4 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/OrderType.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/notice/model/OrderType.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.notice.model enum class OrderType { NEW, OLD -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointHistoryErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointHistoryErrorCode.kt index 15dae81ad..90cda8f23 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointHistoryErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointHistoryErrorCode.kt @@ -14,4 +14,4 @@ enum class PointHistoryErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointOptionErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointOptionErrorCode.kt index 55751047f..38539b226 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointOptionErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/error/PointOptionErrorCode.kt @@ -14,4 +14,4 @@ enum class PointOptionErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointHistoryCanNotCancelException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointHistoryCanNotCancelException.kt index 52d13efc2..a0da01bf7 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointHistoryCanNotCancelException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointHistoryCanNotCancelException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.point.error.PointHistoryErrorCode object PointHistoryCanNotCancelException : DmsException( PointHistoryErrorCode.POINT_HISTORY_CAN_NOT_CANCEL -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionSchoolMismatchException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionSchoolMismatchException.kt index 61b495b47..efd0586fb 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionSchoolMismatchException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/exception/PointOptionSchoolMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.point.error.PointOptionErrorCode object PointOptionSchoolMismatchException : DmsException( PointOptionErrorCode.POINT_OPTION_SCHOOL_MISMATCH -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/Phrase.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/Phrase.kt index 58112a2fc..eff082c19 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/Phrase.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/Phrase.kt @@ -18,4 +18,4 @@ data class Phrase( companion object { const val NO_PHRASE = "문구가 없습니다." } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointHistory.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointHistory.kt index cab1dcd84..96b15f508 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointHistory.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointHistory.kt @@ -60,4 +60,4 @@ data class PointHistory( Pair(this.bonusTotal, this.minusTotal - pointScore) } } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointOption.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointOption.kt index a0f5260f7..d99086ba8 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointOption.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointOption.kt @@ -19,8 +19,8 @@ data class PointOption( ) { fun checkSchoolId(schoolId: UUID) { - if(schoolId != this.schoolId) { + if (schoolId != this.schoolId) { throw PointOptionSchoolMismatchException } } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointType.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointType.kt index 682171293..e3326966a 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointType.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/point/model/PointType.kt @@ -5,4 +5,4 @@ enum class PointType( ) { BONUS("상점"), MINUS("벌점"); -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainAvailableTimeErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainAvailableTimeErrorCode.kt index 3049312ed..583ff2ebd 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainAvailableTimeErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainAvailableTimeErrorCode.kt @@ -15,4 +15,4 @@ enum class RemainAvailableTimeErrorCode( override fun status() = status override fun message() = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainOptionErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainOptionErrorCode.kt index 22f7e751c..a8bfc30fe 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainOptionErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainOptionErrorCode.kt @@ -12,4 +12,4 @@ enum class RemainOptionErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainStatusErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainStatusErrorCode.kt index cb23b3f69..65b3ca9b1 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainStatusErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/error/RemainStatusErrorCode.kt @@ -12,4 +12,4 @@ enum class RemainStatusErrorCode( override fun status() = status override fun message() = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainAvailableTime.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainAvailableTime.kt index 0b89dc3db..2bbdecb79 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainAvailableTime.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainAvailableTime.kt @@ -41,4 +41,4 @@ data class RemainAvailableTime( private fun isAfterEndTime(dayOfWeek: Int, now: LocalTime) = (dayOfWeek == endDayOfWeek.value && endTime < now) -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainOption.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainOption.kt index ee9b3e87d..4414effff 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainOption.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainOption.kt @@ -14,4 +14,4 @@ data class RemainOption( val description: String -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainStatus.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainStatus.kt index 3c3dc9cf7..f16433578 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainStatus.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/remain/model/RemainStatus.kt @@ -5,7 +5,7 @@ import java.time.LocalDateTime import java.util.UUID @Aggregate -data class RemainStatus ( +data class RemainStatus( val id: UUID = UUID(0, 0), @@ -13,4 +13,4 @@ data class RemainStatus ( val createdAt: LocalDateTime -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/error/RoomErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/error/RoomErrorCode.kt index 3b903d710..84f933b40 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/error/RoomErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/error/RoomErrorCode.kt @@ -12,4 +12,4 @@ enum class RoomErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/model/Room.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/model/Room.kt index f55227922..8644bc0de 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/model/Room.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/room/model/Room.kt @@ -12,4 +12,4 @@ data class Room( val schoolId: UUID -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/error/SchoolErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/error/SchoolErrorCode.kt index f03d0c991..8de2a6860 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/error/SchoolErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/error/SchoolErrorCode.kt @@ -17,4 +17,4 @@ enum class SchoolErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/AvailableFeature.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/AvailableFeature.kt index 555e98df7..45e5da87b 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/AvailableFeature.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/AvailableFeature.kt @@ -18,4 +18,4 @@ data class AvailableFeature( val remainService: Boolean -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/School.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/School.kt index 4279f94da..29a86041b 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/School.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/school/model/School.kt @@ -23,4 +23,8 @@ data class School( val contractEndedAt: LocalDate? -) \ No newline at end of file +) { + companion object { + const val SCHOOL_CODE_SIZE: Int = 8 + } +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/StudentErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/StudentErrorCode.kt index 04d736efd..3fbae7151 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/StudentErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/StudentErrorCode.kt @@ -14,4 +14,4 @@ enum class StudentErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/VerifiedStudentErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/VerifiedStudentErrorCode.kt index 3de407c61..204a05da2 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/VerifiedStudentErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/error/VerifiedStudentErrorCode.kt @@ -12,4 +12,4 @@ enum class VerifiedStudentErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Sex.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Sex.kt index c016a13d1..f59cc15b6 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Sex.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Sex.kt @@ -7,4 +7,4 @@ enum class Sex( FEMALE("여"), ALL("전체") ; -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Student.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Student.kt index ba165c851..3a5202a31 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Student.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/Student.kt @@ -33,6 +33,6 @@ data class Student( companion object { const val PROFILE_IMAGE = "https://image-dms.s3.ap-northeast-2.amazonaws.com/59fd0067-93ef-4bcb-8722-5bc8786c5156%7C%7C%E1%84%83%E1%85%A1%E1%84%8B%E1%85%AE%E1%86%AB%E1%84%85%E1%85%A9%E1%84%83%E1%85%B3.png" - fun processNumber(number: Int) = if (number < 10) "0${number}" else number.toString() + fun processNumber(number: Int) = if (number < 10) "0$number" else number.toString() } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/VerifiedStudent.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/VerifiedStudent.kt index f9e7661d0..f29f17c3d 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/VerifiedStudent.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/student/model/VerifiedStudent.kt @@ -18,4 +18,4 @@ data class VerifiedStudent( val sex: Sex -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/AvailableTimeErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/AvailableTimeErrorCode.kt index 7a47b2692..75c5a85da 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/AvailableTimeErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/AvailableTimeErrorCode.kt @@ -12,4 +12,4 @@ enum class AvailableTimeErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatErrorCode.kt index 526492e15..bd58e2d83 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatErrorCode.kt @@ -17,4 +17,4 @@ enum class SeatErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatTypeErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatTypeErrorCode.kt index 844343b9a..0ac9ce900 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatTypeErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/SeatTypeErrorCode.kt @@ -15,4 +15,4 @@ enum class SeatTypeErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/StudyRoomErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/StudyRoomErrorCode.kt index 5e07f8682..312e90710 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/StudyRoomErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/error/StudyRoomErrorCode.kt @@ -17,4 +17,4 @@ enum class StudyRoomErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt similarity index 99% rename from dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt rename to dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt index 41e53d6a9..5f7ec3761 100644 --- a/dms-application/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/exception/SeatAlreadyAppliedException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.domain.studyroom.error.SeatErrorCode object SeatAlreadyAppliedException : DmsException( SeatErrorCode.SEAT_ALREADY_APPLIED -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/AvailableTime.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/AvailableTime.kt index 90e67211a..f6627e8b7 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/AvailableTime.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/AvailableTime.kt @@ -1,8 +1,8 @@ package team.aliens.dms.domain.studyroom.model +import team.aliens.dms.common.annotation.Aggregate import java.time.LocalTime import java.util.UUID -import team.aliens.dms.common.annotation.Aggregate @Aggregate data class AvailableTime( @@ -13,4 +13,4 @@ data class AvailableTime( val endAt: LocalTime -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/Seat.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/Seat.kt index 6256a4f76..335df4cd6 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/Seat.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/Seat.kt @@ -1,5 +1,6 @@ package team.aliens.dms.domain.studyroom.model +import team.aliens.dms.domain.studyroom.exception.SeatAlreadyAppliedException import java.util.UUID data class Seat( @@ -22,10 +23,16 @@ data class Seat( ) { - fun use(studentId: UUID) = this.copy( - studentId = studentId, - status = SeatStatus.IN_USE - ) + fun use(studentId: UUID): Seat { + this.studentId?.let { + throw SeatAlreadyAppliedException + } + + return this.copy( + studentId = studentId, + status = SeatStatus.IN_USE + ) + } fun unUse() = this.copy( studentId = null, diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/SeatStatus.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/SeatStatus.kt index fca09b247..b25d9c1b9 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/SeatStatus.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/SeatStatus.kt @@ -5,4 +5,4 @@ enum class SeatStatus { UNAVAILABLE, IN_USE, EMPTY -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/StudyRoom.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/StudyRoom.kt index ee85559dc..29a0c62e8 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/StudyRoom.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/studyroom/model/StudyRoom.kt @@ -1,9 +1,8 @@ package team.aliens.dms.domain.studyroom.model -import java.util.UUID import team.aliens.dms.common.annotation.Aggregate import team.aliens.dms.domain.student.model.Sex -import kotlin.math.min +import java.util.UUID @Aggregate data class StudyRoom( diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/error/UserErrorCode.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/error/UserErrorCode.kt index e598a6b73..fee792bf2 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/error/UserErrorCode.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/error/UserErrorCode.kt @@ -17,4 +17,4 @@ enum class UserErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/model/User.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/model/User.kt index 34ddc2a16..65eac3973 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/model/User.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/model/User.kt @@ -24,4 +24,4 @@ data class User( val deletedAt: LocalDateTime? -) \ No newline at end of file +) diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthority.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthority.kt index 92bb2cd3e..d2b3b3d4a 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthority.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthority.kt @@ -6,5 +6,4 @@ import java.util.UUID interface CheckUserAuthority { fun execute(userId: UUID): Authority - -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthorityService.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthorityService.kt index 0089e4eaf..2758ed2ca 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthorityService.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/service/CheckUserAuthorityService.kt @@ -1,9 +1,9 @@ package team.aliens.dms.domain.user.service +import team.aliens.dms.common.annotation.DomainService import team.aliens.dms.domain.auth.model.Authority import team.aliens.dms.domain.student.model.Student import team.aliens.dms.domain.user.spi.UserQueryStudentPort -import team.aliens.dms.common.annotation.DomainService import java.util.UUID @DomainService @@ -15,4 +15,4 @@ class CheckUserAuthorityService( is Student -> Authority.STUDENT else -> Authority.MANAGER } -} \ No newline at end of file +} diff --git a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/spi/UserQueryStudentPort.kt b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/spi/UserQueryStudentPort.kt index 16d16905a..5a736489b 100644 --- a/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/spi/UserQueryStudentPort.kt +++ b/dms-domain/src/main/kotlin/team/aliens/dms/domain/user/spi/UserQueryStudentPort.kt @@ -6,5 +6,4 @@ import java.util.UUID interface UserQueryStudentPort { fun queryStudentById(studentId: UUID): Student? - -} \ No newline at end of file +} diff --git a/dms-domain/src/test/kotlin/team/aliens/dms/point/model/PointHistoryTests.kt b/dms-domain/src/test/kotlin/team/aliens/dms/point/model/PointHistoryTests.kt index 24ca535a4..3c4e31c8a 100644 --- a/dms-domain/src/test/kotlin/team/aliens/dms/point/model/PointHistoryTests.kt +++ b/dms-domain/src/test/kotlin/team/aliens/dms/point/model/PointHistoryTests.kt @@ -60,4 +60,4 @@ class PointHistoryTests { canceledPointHistory.cancelHistory() } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/config/detekt/detekt.yml b/dms-infrastructure/config/detekt/detekt.yml new file mode 100644 index 000000000..15ced9138 --- /dev/null +++ b/dms-infrastructure/config/detekt/detekt.yml @@ -0,0 +1,809 @@ +build: + maxIssues: -1 + excludeCorrectable: false + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +config: + validation: true + warningsAsErrors: false + # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' + excludes: '' + +processors: + active: true + exclude: + - 'DetektProgressListener' + # - 'KtFileCountProcessor' + # - 'PackageCountProcessor' + # - 'ClassCountProcessor' + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ProjectComplexityProcessor' + # - 'ProjectCognitiveComplexityProcessor' + # - 'ProjectLLOCProcessor' + # - 'ProjectCLOCProcessor' + # - 'ProjectLOCProcessor' + # - 'ProjectSLOCProcessor' + # - 'LicenseHeaderLoaderExtension' + +console-reports: + active: true + exclude: + - 'ProjectStatisticsReport' + - 'ComplexityReport' + - 'NotificationReport' + # - 'FindingsReport' + - 'FileBasedFindingsReport' + - 'LiteFindingsReport' + +output-reports: + active: true + exclude: + # - 'TxtOutputReport' + # - 'XmlOutputReport' + # - 'HtmlOutputReport' + +comments: + active: true + AbsentOrWrongFileLicense: + active: false + licenseTemplateFile: 'license.template' + licenseTemplateIsRegex: false + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + DeprecatedBlockTag: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' + OutdatedDocumentation: + active: false + matchTypeParameters: true + matchDeclarationsOrder: true + UndocumentedPublicClass: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UndocumentedPublicProperty: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + +complexity: + active: true + ComplexCondition: + active: true + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + includePrivateDeclarations: false + ComplexMethod: + active: true + threshold: 15 + ignoreSingleWhenExpression: false + ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: + - 'also' + - 'apply' + - 'forEach' + - 'isNotNull' + - 'ifNull' + - 'let' + - 'run' + - 'use' + - 'with' + LabeledExpression: + active: false + ignoredLabels: [] + LargeClass: + active: true + threshold: 600 + LongMethod: + active: true + threshold: 60 + LongParameterList: + active: true + functionThreshold: 6 + constructorThreshold: 7 + ignoreDefaultParameters: false + ignoreDataClasses: true + ignoreAnnotatedParameter: [] + excludes: ['**/vo/**', '**/usecase/**'] + MethodOverloading: + active: false + threshold: 6 + NamedArguments: + active: false + threshold: 3 + NestedBlockDepth: + active: true + threshold: 4 + ReplaceSafeCallChainWithRun: + active: false + StringLiteralDuplication: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + ignoreOverridden: false + +coroutines: + active: true + GlobalCoroutineUsage: + active: false + InjectDispatcher: + active: false + dispatcherNames: + - 'IO' + - 'Default' + - 'Unconfined' + RedundantSuspendModifier: + active: false + SleepInsteadOfDelay: + active: false + SuspendFunWithFlowReturnType: + active: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: '_|(ignore|expected).*' + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverridden: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyTryBlock: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: true + methodNames: + - 'equals' + - 'finalize' + - 'hashCode' + - 'toString' + InstanceOfCheckForException: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + NotImplementedDeclaration: + active: false + ObjectExtendsThrowable: + active: false + PrintStackTrace: + active: true + RethrowCaughtException: + active: true + ReturnFromFinally: + active: true + ignoreLabeled: false + SwallowedException: + active: true + ignoredExceptionTypes: + - 'InterruptedException' + - 'MalformedURLException' + - 'NumberFormatException' + - 'ParseException' + allowedExceptionNameRegex: '_|(ignore|expected).*' + ThrowingExceptionFromFinally: + active: true + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptions: + - 'ArrayIndexOutOfBoundsException' + - 'Exception' + - 'IllegalArgumentException' + - 'IllegalMonitorStateException' + - 'IllegalStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + ThrowingNewInstanceOfSameException: + active: true + TooGenericExceptionCaught: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptionNames: + - 'ArrayIndexOutOfBoundsException' + - 'Error' + - 'Exception' + - 'IllegalMonitorStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + allowedExceptionNameRegex: '_|(ignore|expected).*' + TooGenericExceptionThrown: + active: true + exceptionNames: + - 'Error' + - 'Exception' + - 'RuntimeException' + - 'Throwable' + +formatting: + active: true + android: false + autoCorrect: true + AnnotationOnSeparateLine: + active: false + autoCorrect: true + AnnotationSpacing: + active: false + autoCorrect: true + ArgumentListWrapping: + active: false + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + EnumEntryNameCase: + active: false + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + insertFinalNewLine: true + ImportOrdering: + active: true + autoCorrect: true + layout: '*,java.**,javax.**,kotlin.**,^' + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: true + maxLineLength: 120 + ignoreBackTickedIdentifier: false + ModifierOrdering: + active: true + autoCorrect: true + MultiLineIfElse: + active: false + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoEmptyFirstLineInMethodBlock: + active: false + autoCorrect: true + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + PackageName: + active: false + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + SpacingAroundAngleBrackets: + active: false + autoCorrect: true + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundDot: + active: true + autoCorrect: true + SpacingAroundDoubleColon: + active: false + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundParens: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + SpacingAroundUnaryOperator: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithAnnotations: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithComments: + active: false + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + BooleanPropertyNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + allowedPattern: '^(is|has|are)' + ClassNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + classPattern: '[A-Z][a-zA-Z0-9]*' + ConstructorParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + EnumNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + forbiddenName: [] + FunctionMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' + excludeClassPattern: '$^' + ignoreOverridden: true + FunctionParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + InvalidPackageDeclaration: + active: false + rootPackage: '' + LambdaParameterNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*|_' + MatchingDeclarationName: + active: true + mustBeFirst: true + MemberNameEqualsClassName: + active: true + ignoreOverridden: true + NoNameShadowing: + active: false + NonBooleanPropertyPrefixedWithIs: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ObjectPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' + TopLevelPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' + VariableMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumVariableNameLength: 64 + VariableMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumVariableNameLength: 1 + VariableNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + +performance: + active: true + ArrayPrimitive: + active: true + ForEachOnRange: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + SpreadOperator: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + AvoidReferentialEquality: + active: false + forbiddenTypePatterns: + - 'kotlin.String' + CastToNullableType: + active: false + Deprecation: + active: false + DontDowncastCollectionTypes: + active: false + DoubleMutabilityForCollection: + active: false + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: true + EqualsWithHashCodeExist: + active: true + ExitOutsideMain: + active: false + ExplicitGarbageCollectionCall: + active: true + HasPlatformType: + active: false + IgnoredReturnValue: + active: false + restrictToAnnotatedMethods: true + returnValueAnnotations: + - '*.CheckResult' + - '*.CheckReturnValue' + ignoreReturnValueAnnotations: + - '*.CanIgnoreReturnValue' + ImplicitDefaultLocale: + active: true + ImplicitUnitReturnType: + active: false + allowExplicitReturnType: true + InvalidRange: + active: true + IteratorHasNextCallsNextMethod: + active: true + IteratorNotThrowingNoSuchElementException: + active: true + LateinitUsage: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreOnClassesPattern: '' + MapGetWithNotNullAssertionOperator: + active: false + MissingPackageDeclaration: + active: false + excludes: ['**/*.kts'] + MissingWhenCase: + active: true + allowElseExpression: true + NullableToStringCall: + active: false + RedundantElseInWhen: + active: true + UnconditionalJumpStatementInLoop: + active: false + UnnecessaryNotNullOperator: + active: true + UnnecessarySafeCall: + active: true + UnreachableCatchBlock: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnsafeCast: + active: true + UnusedUnaryOperator: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: true + +style: + active: true + ClassOrdering: + active: false + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + DataClassShouldBeImmutable: + active: false + DestructuringDeclarationWithTooManyEntries: + active: false + maxDestructuringEntries: 3 + EqualsNullCall: + active: true + EqualsOnSignatureLine: + active: false + ExplicitCollectionElementAccessMethod: + active: false + ExplicitItLambdaParameter: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: + - 'FIXME:' + - 'STOPSHIP:' + - 'TODO:' + allowedPatterns: '' + customMessage: '' + ForbiddenImport: + active: false + imports: [] + forbiddenPatterns: '' + ForbiddenMethodCall: + active: false + methods: + - 'kotlin.io.print' + - 'kotlin.io.println' + ForbiddenPublicDataClass: + active: true + excludes: ['**'] + ignorePackages: + - '*.internal' + - '*.internal.*' + ForbiddenVoid: + active: false + ignoreOverridden: false + ignoreUsageInGenerics: false + FunctionOnlyReturningConstant: + active: true + ignoreOverridableFunction: true + ignoreActualFunction: true + excludedFunctions: '' + LibraryCodeMustSpecifyReturnType: + active: true + excludes: ['**'] + LibraryEntitiesShouldNotBePublic: + active: true + excludes: ['**'] + LoopWithTooManyJumpStatements: + active: true + maxJumpCount: 1 + MagicNumber: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreNumbers: + - '-1' + - '0' + - '1' + - '2' + ignoreHashCodeFunction: true + ignorePropertyDeclaration: false + ignoreLocalVariableDeclaration: false + ignoreConstantDeclaration: true + ignoreCompanionObjectPropertyDeclaration: true + ignoreAnnotation: false + ignoreNamedArgument: true + ignoreEnums: false + ignoreRanges: false + ignoreExtensionFunctions: true + MandatoryBracesIfStatements: + active: false + MandatoryBracesLoops: + active: false + MaxLineLength: + active: true + maxLineLength: 120 + excludePackageStatements: true + excludeImportStatements: true + excludeCommentStatements: false + MayBeConst: + active: true + ModifierOrder: + active: true + MultilineLambdaItParameter: + active: false + NestedClassesVisibility: + active: true + NewLineAtEndOfFile: + active: true + NoTabs: + active: false + ObjectLiteralToLambda: + active: false + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: true + RedundantExplicitType: + active: false + RedundantHigherOrderMapUsage: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: 'equals' + excludeLabeled: false + excludeReturnFromLambda: true + excludeGuardClauses: false + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: true + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 4 + excludeGuardClauses: true + TrailingWhitespace: + active: false + UnderscoresInNumericLiterals: + active: false + acceptableLength: 4 + UnnecessaryAbstractClass: + active: true + UnnecessaryAnnotationUseSiteTarget: + active: false + UnnecessaryApply: + active: true + UnnecessaryFilter: + active: false + UnnecessaryInheritance: + active: true + UnnecessaryLet: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateClass: + active: true + UnusedPrivateMember: + active: true + allowedNames: '(_|ignored|expected|serialVersionUID)' + UseAnyOrNoneInsteadOfFind: + active: false + UseArrayLiteralsInAnnotations: + active: false + UseCheckNotNull: + active: false + UseCheckOrError: + active: false + UseDataClass: + active: false + allowVars: false + UseEmptyCounterpart: + active: false + UseIfEmptyOrIfBlank: + active: false + UseIfInsteadOfWhen: + active: false + UseIsNullOrEmpty: + active: false + UseOrEmpty: + active: false + UseRequire: + active: false + UseRequireNotNull: + active: false + UselessCallOnNotNull: + active: true + UtilityClassWithPublicConstructor: + active: true + VarCouldBeVal: + active: true + WildcardImport: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] +# excludeImports: +# - 'java.util.*' diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/ComponentScanConfiguration.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/ComponentScanConfiguration.kt index 4d04611be..ea8470199 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/ComponentScanConfiguration.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/ComponentScanConfiguration.kt @@ -22,5 +22,4 @@ import team.aliens.dms.common.annotation.UseCase ) ] ) -class ComponentScanConfiguration { -} \ No newline at end of file +class ComponentScanConfiguration diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfiguration.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfiguration.kt index b50c8bfd9..8697e556e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfiguration.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/PropertiesScanConfiguration.kt @@ -4,8 +4,8 @@ import org.springframework.boot.context.properties.ConfigurationPropertiesScan import org.springframework.context.annotation.Configuration import team.aliens.dms.global.security.SecurityProperties import team.aliens.dms.thirdparty.AwsProperties -import team.aliens.dms.thirdparty.storage.AwsS3Properties import team.aliens.dms.thirdparty.email.AwsSESProperties +import team.aliens.dms.thirdparty.storage.AwsS3Properties @ConfigurationPropertiesScan( basePackageClasses = [ @@ -16,5 +16,4 @@ import team.aliens.dms.thirdparty.email.AwsSESProperties ] ) @Configuration -class PropertiesScanConfiguration { -} \ No newline at end of file +class PropertiesScanConfiguration diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/QuerydslConfig.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/QuerydslConfig.kt index 25a2188aa..d01ab90fd 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/QuerydslConfig.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/QuerydslConfig.kt @@ -12,4 +12,4 @@ class QuerydslConfig( @Bean protected fun queryFactory() = JPAQueryFactory(entityManager) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RedisConfig.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RedisConfig.kt index f681c01b0..db27ae0be 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RedisConfig.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/config/RedisConfig.kt @@ -38,4 +38,4 @@ class RedisConfig( return LettuceConnectionFactory(redisConfig, clientConfig) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/ErrorResponse.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/ErrorResponse.kt index 0d952dfb2..bf194b008 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/ErrorResponse.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/ErrorResponse.kt @@ -1,11 +1,10 @@ package team.aliens.dms.global.error -import javax.validation.ConstraintViolation -import javax.validation.ConstraintViolationException import org.springframework.validation.BindingResult import org.springframework.validation.FieldError import team.aliens.dms.common.error.ErrorProperty - +import javax.validation.ConstraintViolation +import javax.validation.ConstraintViolationException data class ErrorResponse( val status: Int, @@ -34,7 +33,7 @@ data class ErrorResponse( fun of(e: ConstraintViolationException): ValidationErrorResponse { val errorMap = HashMap() - for(error: ConstraintViolation<*> in e.constraintViolations) { + for (error: ConstraintViolation<*> in e.constraintViolations) { val errorPropertyPath = error.propertyPath.toString() /** @@ -57,4 +56,4 @@ data class ErrorResponse( data class ValidationErrorResponse( val status: Int, val fieldError: Map -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.kt index ae21cbf51..f4af0b43e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorCode.kt @@ -20,4 +20,4 @@ enum class GlobalErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorHandler.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorHandler.kt index 606c0f4b9..b31656a80 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorHandler.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/error/GlobalErrorHandler.kt @@ -1,6 +1,5 @@ package team.aliens.dms.global.error -import javax.validation.ConstraintViolationException import org.springframework.http.HttpStatus import org.springframework.validation.BindException import org.springframework.validation.BindingResult @@ -8,6 +7,7 @@ import org.springframework.web.bind.MethodArgumentNotValidException import org.springframework.web.bind.annotation.ExceptionHandler import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestControllerAdvice +import javax.validation.ConstraintViolationException @RestControllerAdvice class GlobalErrorHandler { @@ -23,4 +23,4 @@ class GlobalErrorHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) @ExceptionHandler(MethodArgumentNotValidException::class) protected fun handleMethodArgumentNotViolationException(e: BindingResult): ValidationErrorResponse? = ErrorResponse.of(e) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/exception/InternalServerErrorException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/exception/InternalServerErrorException.kt index 61024ba1c..292f4b4f1 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/exception/InternalServerErrorException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/exception/InternalServerErrorException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object InternalServerErrorException : DmsException( GlobalErrorCode.INTERNAL_SERVER_ERROR -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/ExceptionFilter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/ExceptionFilter.kt index fcde6053b..fb600d78f 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/ExceptionFilter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/ExceptionFilter.kt @@ -1,13 +1,13 @@ package team.aliens.dms.global.filter import com.fasterxml.jackson.databind.ObjectMapper -import java.nio.charset.StandardCharsets import org.springframework.http.MediaType import org.springframework.web.filter.OncePerRequestFilter import team.aliens.dms.common.error.DmsException import team.aliens.dms.common.error.ErrorProperty import team.aliens.dms.global.error.ErrorResponse import team.aliens.dms.global.exception.InternalServerErrorException +import java.nio.charset.StandardCharsets import javax.servlet.FilterChain import javax.servlet.http.HttpServletRequest import javax.servlet.http.HttpServletResponse @@ -42,4 +42,4 @@ class ExceptionFilter( response.contentType = MediaType.APPLICATION_JSON_VALUE response.writer.write(objectMapper.writeValueAsString(ErrorResponse.of(errorProperty))) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/FilterConfig.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/FilterConfig.kt index 23283e0e8..77b408a2f 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/FilterConfig.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/FilterConfig.kt @@ -18,4 +18,4 @@ class FilterConfig( builder.addFilterBefore(JwtFilter(jwtParser), UsernamePasswordAuthenticationFilter::class.java) builder.addFilterBefore(ExceptionFilter(objectMapper), JwtFilter::class.java) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtFilter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtFilter.kt index 6c1183379..f4ed94227 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtFilter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/filter/JwtFilter.kt @@ -33,5 +33,4 @@ class JwtFilter( return it.substring(JwtProperties.PREFIX.length) } } - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAccessDeniedHandler.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAccessDeniedHandler.kt index 23024aa3c..45e6717cc 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAccessDeniedHandler.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAccessDeniedHandler.kt @@ -17,4 +17,4 @@ class CustomAccessDeniedHandler : AccessDeniedHandler { ) { throw InvalidRoleException } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAuthenticationEntryPoint.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAuthenticationEntryPoint.kt index 46c056a4b..7f3774002 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAuthenticationEntryPoint.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/CustomAuthenticationEntryPoint.kt @@ -17,4 +17,4 @@ class CustomAuthenticationEntryPoint : AuthenticationEntryPoint { ) { throw ForbiddenException } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityAdapter.kt index ae03b2b3a..50ce740cf 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityAdapter.kt @@ -20,4 +20,4 @@ class SecurityAdapter( ) override fun encodePassword(password: String): String = passwordEncoder.encode(password) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityConfiguration.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityConfiguration.kt index 52ef9893f..bf18cd249 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityConfiguration.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityConfiguration.kt @@ -32,10 +32,8 @@ class SecurityConfiguration( .sessionCreationPolicy(SessionCreationPolicy.STATELESS) http .authorizeRequests() - // healthcheck .antMatchers(HttpMethod.GET, "/").permitAll() - // /auth .antMatchers(HttpMethod.GET, "/auth/account-id").permitAll() .antMatchers(HttpMethod.GET, "/auth/email").permitAll() @@ -43,17 +41,14 @@ class SecurityConfiguration( .antMatchers(HttpMethod.POST, "/auth/code").permitAll() .antMatchers(HttpMethod.POST, "/auth/tokens").permitAll() .antMatchers(HttpMethod.PUT, "/auth/reissue").permitAll() - // /users .antMatchers(HttpMethod.GET, "/users/password").hasAnyAuthority(STUDENT.name, MANAGER.name) .antMatchers(HttpMethod.PATCH, "/users/password").hasAnyAuthority(STUDENT.name, MANAGER.name) - // /students .antMatchers(HttpMethod.GET, "/students/email/duplication").permitAll() .antMatchers(HttpMethod.GET, "/students/account-id/duplication").permitAll() .antMatchers(HttpMethod.GET, "/students/account-id/{school-id}").permitAll() .antMatchers(HttpMethod.GET, "/students/name").permitAll() - .antMatchers(HttpMethod.GET, "/students/name").permitAll() .antMatchers(HttpMethod.GET, "/students/profile").hasAuthority(STUDENT.name) .antMatchers(HttpMethod.POST, "/students/signup").permitAll() .antMatchers(HttpMethod.PATCH, "/students/password/initialization").permitAll() @@ -66,9 +61,7 @@ class SecurityConfiguration( .antMatchers(HttpMethod.GET, "/managers/students/{student-id}").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.GET, "/managers/profile").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.PATCH, "managers/password/initialization").permitAll() - .antMatchers(HttpMethod.PATCH, "/managers/password/initialization").permitAll() .antMatchers(HttpMethod.DELETE, "/managers/students/{student-id}").hasAuthority(MANAGER.name) - // /schools .antMatchers(HttpMethod.GET, "/schools").permitAll() .antMatchers(HttpMethod.GET, "/schools/question/{school-id}").permitAll() @@ -76,7 +69,6 @@ class SecurityConfiguration( .antMatchers(HttpMethod.GET, "/schools/code").permitAll() .antMatchers(HttpMethod.PATCH, "/schools/question").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.PATCH, "/schools/code").hasAuthority(MANAGER.name) - // /notices .antMatchers(HttpMethod.GET, "/notices/status").hasAuthority(STUDENT.name) .antMatchers(HttpMethod.GET, "/notices").hasAnyAuthority(STUDENT.name, MANAGER.name) @@ -84,14 +76,11 @@ class SecurityConfiguration( .antMatchers(HttpMethod.POST, "/notices").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.PATCH, "/notices/{notice-id}").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.DELETE, "/notices/{notice-id}").hasAuthority(MANAGER.name) - // /files .antMatchers(HttpMethod.POST, "/files").permitAll() .antMatchers(HttpMethod.POST, "/files/verified-student").permitAll() - // /meals .antMatchers(HttpMethod.GET, "/meals/{date}").hasAuthority(STUDENT.name) - // /points .antMatchers(HttpMethod.GET, "/points").hasAuthority(STUDENT.name) .antMatchers(HttpMethod.POST, "/points/options").hasAuthority(MANAGER.name) @@ -103,13 +92,11 @@ class SecurityConfiguration( .antMatchers(HttpMethod.PUT, "/points/history/{point-history-id}").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.GET, "/points/options").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.PATCH, "/points/options/{point-option-id}").hasAuthority(MANAGER.name) - // /templates .antMatchers(HttpMethod.GET, "/templates").permitAll() .antMatchers(HttpMethod.POST, "/templates").permitAll() .antMatchers(HttpMethod.PATCH, "/templates").permitAll() .antMatchers(HttpMethod.DELETE, "/templates").permitAll() - // /study-rooms .antMatchers(HttpMethod.GET, "/study-rooms/available-time").hasAnyAuthority(STUDENT.name, MANAGER.name) .antMatchers(HttpMethod.PUT, "/study-rooms/available-time").hasAuthority(MANAGER.name) @@ -126,7 +113,6 @@ class SecurityConfiguration( .antMatchers(HttpMethod.GET, "/study-rooms/list/managers").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.DELETE, "/study-rooms/types/{type-id}").hasAuthority(MANAGER.name) .antMatchers(HttpMethod.GET, "/study-rooms/my").hasAuthority(STUDENT.name) - // /remains .antMatchers(HttpMethod.PUT, "/remains/{remain-option-id}").hasAuthority(STUDENT.name) .antMatchers(HttpMethod.POST, "/remains/options").hasAuthority(MANAGER.name) @@ -152,4 +138,4 @@ class SecurityConfiguration( @Bean protected fun passwordEncoder() = BCryptPasswordEncoder() -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.kt index b0b180677..262a43547 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/SecurityProperties.kt @@ -12,4 +12,4 @@ class SecurityProperties( val refreshExp: Int ) { val secretKey: String = Base64.getEncoder().encodeToString(secretKey.toByteArray()) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/error/SecurityErrorCode.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/error/SecurityErrorCode.kt index 1cbfb71a7..25476fc89 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/error/SecurityErrorCode.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/error/SecurityErrorCode.kt @@ -17,4 +17,4 @@ enum class SecurityErrorCode( override fun status(): Int = status override fun message(): String = message -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.kt index 0a2b6503a..65127032e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ExpiredTokenException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.security.error.SecurityErrorCode object ExpiredTokenException : DmsException( SecurityErrorCode.EXPIRED_TOKEN -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ForbiddenException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ForbiddenException.kt index 43886dcf3..0c5db1c24 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ForbiddenException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/ForbiddenException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.security.error.SecurityErrorCode object ForbiddenException : DmsException( SecurityErrorCode.FORBIDDEN -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidRoleException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidRoleException.kt index c4589e1e2..ef567f8ef 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidRoleException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidRoleException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.security.error.SecurityErrorCode object InvalidRoleException : DmsException( SecurityErrorCode.INVALID_ROLE -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.kt index 483d1f307..ae7b9a447 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/exception/InvalidTokenException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.security.error.SecurityErrorCode object InvalidTokenException : DmsException( SecurityErrorCode.INVALID_TOKEN -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetails.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetails.kt index 068083e49..d6a286db1 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetails.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetails.kt @@ -25,4 +25,4 @@ class ManagerDetails( override fun isCredentialsNonExpired(): Boolean = true override fun isEnabled(): Boolean = true -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetailsService.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetailsService.kt index 298698372..2a3948e2e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetailsService.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/ManagerDetailsService.kt @@ -18,4 +18,4 @@ class ManagerDetailsService( return ManagerDetails(manager.id) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetails.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetails.kt index aa0a59089..1b0dcef5a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetails.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetails.kt @@ -25,4 +25,4 @@ class StudentDetails( override fun isCredentialsNonExpired(): Boolean = true override fun isEnabled(): Boolean = true -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetailsService.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetailsService.kt index d4b811624..71728c7d2 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetailsService.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/principle/StudentDetailsService.kt @@ -18,4 +18,4 @@ class StudentDetailsService( return StudentDetails(student.id) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/GenerateJwtAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/GenerateJwtAdapter.kt index b74b4c6aa..0340ae210 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/GenerateJwtAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/GenerateJwtAdapter.kt @@ -55,4 +55,4 @@ class GenerateJwtAdapter( return token } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt index 22fd64579..e9b97e8cb 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtParser.kt @@ -64,4 +64,4 @@ class JwtParser( else -> throw InvalidRoleException } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.kt index b87f410a8..bac1c0157 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/global/security/token/JwtProperties.kt @@ -6,4 +6,4 @@ object JwtProperties { const val ACCESS = "access" const val REFRESH = "refresh" const val AUTHORITY = "authority" -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseEntity.kt index 0e452899c..e1f2a9941 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseEntity.kt @@ -1,11 +1,11 @@ package team.aliens.dms.persistence +import org.hibernate.annotations.GenericGenerator import java.util.UUID import javax.persistence.Column import javax.persistence.GeneratedValue import javax.persistence.Id import javax.persistence.MappedSuperclass -import org.hibernate.annotations.GenericGenerator @MappedSuperclass abstract class BaseEntity( diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseTimeEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseTimeEntity.kt index 32e8fc662..7e2e07642 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseTimeEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseTimeEntity.kt @@ -10,4 +10,4 @@ abstract class BaseTimeEntity( @Column(nullable = false, updatable = false, columnDefinition = "DATETIME") val createdAt: LocalDateTime = LocalDateTime.now() -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseUUIDEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseUUIDEntity.kt index 8ba2522bd..9bb2eaed9 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseUUIDEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/BaseUUIDEntity.kt @@ -1,11 +1,11 @@ package team.aliens.dms.persistence +import org.hibernate.annotations.GenericGenerator import java.util.UUID import javax.persistence.Column import javax.persistence.GeneratedValue import javax.persistence.Id import javax.persistence.MappedSuperclass -import org.hibernate.annotations.GenericGenerator @MappedSuperclass abstract class BaseUUIDEntity( @@ -16,4 +16,4 @@ abstract class BaseUUIDEntity( @Column(columnDefinition = "BINARY(16)", nullable = false) val id: UUID? -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/GenericMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/GenericMapper.kt index 81d140b7c..772aa2f3c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/GenericMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/GenericMapper.kt @@ -5,5 +5,4 @@ interface GenericMapper { fun toDomain(entity: E?): D? fun toEntity(domain: D): E - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/TimeBasedUUIDGenerator.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/TimeBasedUUIDGenerator.kt index 0ac35a075..c43f5bca8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/TimeBasedUUIDGenerator.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/TimeBasedUUIDGenerator.kt @@ -1,9 +1,9 @@ package team.aliens.dms.persistence import com.fasterxml.uuid.Generators -import java.io.Serializable import org.hibernate.engine.spi.SharedSessionContractImplementor import org.hibernate.id.IdentifierGenerator +import java.io.Serializable class TimeBasedUUIDGenerator : IdentifierGenerator { @@ -13,4 +13,4 @@ class TimeBasedUUIDGenerator : IdentifierGenerator { override fun generate(session: SharedSessionContractImplementor?, entity: Any?): Serializable { return Generators.timeBasedGenerator().generate() } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodeLimitPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodeLimitPersistenceAdapter.kt index 58a2d6696..1ec23e54c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodeLimitPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodeLimitPersistenceAdapter.kt @@ -25,4 +25,4 @@ class AuthCodeLimitPersistenceAdapter( authCodeLimitMapper.toEntity(authCodeLimit) ) )!! -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodePersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodePersistenceAdapter.kt index 9e8e197ba..315c79189 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodePersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/AuthCodePersistenceAdapter.kt @@ -26,4 +26,4 @@ class AuthCodePersistenceAdapter( override fun queryAuthCodeByEmail(email: String) = authCodeMapper.toDomain( authCodeRepository.findByEmail(email) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/RefreshTokenPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/RefreshTokenPersistenceAdapter.kt index 28d5bdca2..6420bfadd 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/RefreshTokenPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/RefreshTokenPersistenceAdapter.kt @@ -15,4 +15,4 @@ class RefreshTokenPersistenceAdapter( override fun queryRefreshTokenByToken(token: String) = refreshTokenMapper.toDomain( refreshTokenRepository.findByIdOrNull(token) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeEntity.kt index 7293b5e2d..24020dc57 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeEntity.kt @@ -25,4 +25,4 @@ data class AuthCodeEntity( @TimeToLive val expirationTime: Int -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeLimitEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeLimitEntity.kt index 4ad2da3dd..5098c8f13 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeLimitEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/entity/AuthCodeLimitEntity.kt @@ -32,4 +32,4 @@ class AuthCodeLimitEntity( @TimeToLive val expirationTime: Int -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeLimitMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeLimitMapper.kt index f62a04913..5295455da 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeLimitMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeLimitMapper.kt @@ -31,4 +31,4 @@ class AuthCodeLimitMapper : GenericMapper { expirationTime = domain.expirationTime ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeMapper.kt index 4178050f4..50b8eeea2 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/AuthCodeMapper.kt @@ -27,4 +27,4 @@ class AuthCodeMapper : GenericMapper { expirationTime = domain.expirationTime, ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/RefreshTokenMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/RefreshTokenMapper.kt index 10b93096a..9f189f980 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/RefreshTokenMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/mapper/RefreshTokenMapper.kt @@ -27,4 +27,4 @@ class RefreshTokenMapper : GenericMapper { expirationTime = domain.expirationTime ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeEntityRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeEntityRepository.kt index eff45ce3c..53255115b 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeEntityRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeEntityRepository.kt @@ -11,5 +11,4 @@ interface AuthCodeEntityRepository : CrudRepository { fun findByEmail(email: String): AuthCodeEntity? fun findByEmailAndType(email: String, type: EmailType): AuthCodeEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeLimitRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeLimitRepository.kt index e4eafdaf2..7cc2391ac 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeLimitRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/AuthCodeLimitRepository.kt @@ -10,5 +10,4 @@ import java.util.UUID interface AuthCodeLimitRepository : CrudRepository { fun findByEmailAndType(email: String, type: EmailType): AuthCodeLimitEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/RefreshTokenRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/RefreshTokenRepository.kt index cf98734ff..ad6395076 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/RefreshTokenRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/auth/repository/RefreshTokenRepository.kt @@ -5,5 +5,4 @@ import org.springframework.stereotype.Repository import team.aliens.dms.persistence.auth.entity.RefreshTokenEntity @Repository -interface RefreshTokenRepository : CrudRepository { -} \ No newline at end of file +interface RefreshTokenRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/ManagerPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/ManagerPersistenceAdapter.kt index 3568c5f17..fb8c4bf7c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/ManagerPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/ManagerPersistenceAdapter.kt @@ -16,4 +16,4 @@ class ManagerPersistenceAdapter( override fun queryManagerById(managerId: UUID) = managerMapper.toDomain( managerRepository.findByIdOrNull(managerId) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/entity/ManagerJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/entity/ManagerJpaEntity.kt index 07edb9105..22b5228dc 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/entity/ManagerJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/entity/ManagerJpaEntity.kt @@ -30,4 +30,4 @@ class ManagerJpaEntity( @Column(columnDefinition = "VARCHAR(255)", nullable = false) val profileImageUrl: String -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/mapper/ManagerMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/mapper/ManagerMapper.kt index a58f83217..39eeca1f0 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/mapper/ManagerMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/mapper/ManagerMapper.kt @@ -33,4 +33,4 @@ class ManagerMapper( profileImageUrl = domain.profileImageUrl!! ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/repository/ManagerJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/repository/ManagerJpaRepository.kt index 6daab99ca..adbf290f2 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/repository/ManagerJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/manager/repository/ManagerJpaRepository.kt @@ -6,5 +6,4 @@ import team.aliens.dms.persistence.manager.entity.ManagerJpaEntity import java.util.UUID @Repository -interface ManagerJpaRepository : CrudRepository { -} \ No newline at end of file +interface ManagerJpaRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/MealPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/MealPersistenceAdapter.kt index 79177d4cf..1f7885727 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/MealPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/MealPersistenceAdapter.kt @@ -23,4 +23,4 @@ class MealPersistenceAdapter( mealMapper.toDomain(it)!! } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/entity/MealJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/entity/MealJpaEntity.kt index 15d93eb55..f59b4e215 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/entity/MealJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/entity/MealJpaEntity.kt @@ -46,4 +46,4 @@ data class MealJpaEntityId( @Column(nullable = false) val schoolId: UUID -) : Serializable \ No newline at end of file +) : Serializable diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/mapper/MealMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/mapper/MealMapper.kt index ed0e5a2a3..7a6af6243 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/mapper/MealMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/mapper/MealMapper.kt @@ -39,4 +39,4 @@ class MealMapper( dinner = domain.dinner ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/repository/MealJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/repository/MealJpaRepository.kt index faae4d490..aca4870f5 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/repository/MealJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/meal/repository/MealJpaRepository.kt @@ -11,5 +11,4 @@ import java.util.UUID interface MealJpaRepository : CrudRepository { fun findBySchoolIdAndIdMealDateBetween(schoolId: UUID, startAt: LocalDate, endAt: LocalDate): List - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/NoticePersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/NoticePersistenceAdapter.kt index 18e347988..8fc615ea0 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/NoticePersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/NoticePersistenceAdapter.kt @@ -52,4 +52,4 @@ class NoticePersistenceAdapter( noticeMapper.toEntity(notice) ) )!! -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/entity/NoticeJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/entity/NoticeJpaEntity.kt index 48fa85881..7fc390d42 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/entity/NoticeJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/entity/NoticeJpaEntity.kt @@ -32,4 +32,4 @@ class NoticeJpaEntity( @Column(columnDefinition = "DATETIME", nullable = false) val updatedAt: LocalDateTime = createdAt -) : BaseEntity(id) \ No newline at end of file +) : BaseEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/mapper/NoticeMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/mapper/NoticeMapper.kt index 133cc4be1..ae41576c2 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/mapper/NoticeMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/mapper/NoticeMapper.kt @@ -37,4 +37,4 @@ class NoticeMapper( updatedAt = domain.updatedAt!! ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/repository/NoticeJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/repository/NoticeJpaRepository.kt index d703c5aa6..3a89e352a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/repository/NoticeJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/notice/repository/NoticeJpaRepository.kt @@ -17,5 +17,4 @@ interface NoticeJpaRepository : CrudRepository { fun findAllByManagerUserSchoolIdOrderByCreatedAtDesc(schoolId: UUID): List fun findByIdAndManagerUserId(id: UUID, managerId: UUID): NoticeJpaEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PhrasePersistenceAdapterStudent.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PhrasePersistenceAdapterStudent.kt index e5cc79434..945c94f56 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PhrasePersistenceAdapterStudent.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PhrasePersistenceAdapterStudent.kt @@ -29,4 +29,4 @@ class PhrasePersistenceAdapterStudent( phraseMapper.toDomain(it)!! } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PointOptionPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PointOptionPersistenceAdapter.kt index 77d782a52..72defceb0 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PointOptionPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/PointOptionPersistenceAdapter.kt @@ -40,4 +40,4 @@ class PointOptionPersistenceAdapter( pointOptionMapper.toDomain(it)!! } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PhraseJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PhraseJpaEntity.kt index 71a5040b4..216b74ed9 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PhraseJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PhraseJpaEntity.kt @@ -25,4 +25,4 @@ class PhraseJpaEntity( @Column(columnDefinition = "INT", nullable = false) val standard: Int -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointHistoryJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointHistoryJpaEntity.kt index 010af3947..97475c426 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointHistoryJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointHistoryJpaEntity.kt @@ -51,4 +51,4 @@ class PointHistoryJpaEntity( override val createdAt: LocalDateTime -) : BaseEntity(id) \ No newline at end of file +) : BaseEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointOptionJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointOptionJpaEntity.kt index c69d02e4b..4b230904c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointOptionJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/entity/PointOptionJpaEntity.kt @@ -33,4 +33,4 @@ class PointOptionJpaEntity( @Column(columnDefinition = "VARCHAR(5)", nullable = false) val type: PointType -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PhraseMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PhraseMapper.kt index ff1b95214..d9e9b4792 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PhraseMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PhraseMapper.kt @@ -27,4 +27,4 @@ class PhraseMapper : GenericMapper { standard = domain.standard ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointHistoryMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointHistoryMapper.kt index 1fe64ba04..18b0ceadb 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointHistoryMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointHistoryMapper.kt @@ -47,4 +47,4 @@ class PointHistoryMapper( createdAt = domain.createdAt ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointOptionMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointOptionMapper.kt index 88959fcbe..3945f6100 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointOptionMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/mapper/PointOptionMapper.kt @@ -35,4 +35,4 @@ class PointOptionMapper( type = domain.type ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PhraseJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PhraseJpaRepository.kt index 2b26e0a73..1892e7d85 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PhraseJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PhraseJpaRepository.kt @@ -1,14 +1,13 @@ package team.aliens.dms.persistence.point.repository +import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository +import team.aliens.dms.domain.point.model.PointType import team.aliens.dms.persistence.point.entity.PhraseJpaEntity import java.util.UUID -import org.springframework.data.repository.CrudRepository -import team.aliens.dms.domain.point.model.PointType @Repository interface PhraseJpaRepository : CrudRepository { fun findAllByTypeAndStandard(type: PointType, standard: Int): List - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointHistoryJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointHistoryJpaRepository.kt index 9d86b0161..01135a4a4 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointHistoryJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointHistoryJpaRepository.kt @@ -6,5 +6,4 @@ import team.aliens.dms.persistence.point.entity.PointHistoryJpaEntity import java.util.UUID @Repository -interface PointHistoryJpaRepository : CrudRepository { -} \ No newline at end of file +interface PointHistoryJpaRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointOptionJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointOptionJpaRepository.kt index e2d1ec7d3..5ce2b89c7 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointOptionJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/point/repository/PointOptionJpaRepository.kt @@ -10,4 +10,4 @@ interface PointOptionJpaRepository : CrudRepository fun existsByNameAndSchoolId(name: String, schoolId: UUID): Boolean fun findByIdAndSchoolId(id: UUID, schoolId: UUID): PointOptionJpaEntity? fun findBySchoolIdAndNameContains(schoolId: UUID, name: String): List -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainAvailableTimePersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainAvailableTimePersistenceAdapter.kt index 3efcfc0fe..7e964b6e1 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainAvailableTimePersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainAvailableTimePersistenceAdapter.kt @@ -23,4 +23,4 @@ class RemainAvailableTimePersistenceAdapter( override fun queryRemainAvailableTimeBySchoolId(schoolId: UUID) = remainAvailableTimeMapper.toDomain( remainAvailableTimeRepository.findByIdOrNull(schoolId) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainOptionPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainOptionPersistenceAdapter.kt index ce5a32532..e5aee284d 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainOptionPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainOptionPersistenceAdapter.kt @@ -35,4 +35,4 @@ class RemainOptionPersistenceAdapter( .map { remainOptionMapper.toDomain(it)!! } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainStatusPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainStatusPersistenceAdapter.kt index ca26c27ea..62d8676ea 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainStatusPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/RemainStatusPersistenceAdapter.kt @@ -60,4 +60,4 @@ class RemainStatusPersistenceAdapter( override fun queryRemainStatusById(userId: UUID) = remainStatusMapper.toDomain( remainStatusRepository.findByIdOrNull(userId) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainAvailableTimeJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainAvailableTimeJpaEntity.kt index e00ca3b46..8d6c2f7c8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainAvailableTimeJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainAvailableTimeJpaEntity.kt @@ -42,4 +42,4 @@ class RemainAvailableTimeJpaEntity( @Column(columnDefinition = "TIME", nullable = false) val endTime: LocalTime -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainOptionJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainOptionJpaEntity.kt index 7c3bd5b04..007186a63 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainOptionJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainOptionJpaEntity.kt @@ -26,4 +26,4 @@ class RemainOptionJpaEntity( @Column(columnDefinition = "VARCHAR(255)", nullable = false) val description: String -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainStatusJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainStatusJpaEntity.kt index eff1b9fe3..4e3868b44 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainStatusJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/entity/RemainStatusJpaEntity.kt @@ -34,4 +34,4 @@ class RemainStatusJpaEntity( override val createdAt: LocalDateTime -) : BaseTimeEntity() \ No newline at end of file +) : BaseTimeEntity() diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainAvailableTimeMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainAvailableTimeMapper.kt index 2a988ca6c..54c39011b 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainAvailableTimeMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainAvailableTimeMapper.kt @@ -36,4 +36,4 @@ class RemainAvailableTimeMapper( endDayOfWeek = domain.endDayOfWeek ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainOptionMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainOptionMapper.kt index 5cad21c58..e37863fde 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainOptionMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainOptionMapper.kt @@ -33,4 +33,4 @@ class RemainOptionMapper( description = domain.description ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainStatusMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainStatusMapper.kt index e6618e7e2..143cf9552 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainStatusMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/mapper/RemainStatusMapper.kt @@ -35,4 +35,4 @@ class RemainStatusMapper( createdAt = domain.createdAt ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainAvailableTimeJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainAvailableTimeJpaRepository.kt index 336ad7a96..5a66edf1e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainAvailableTimeJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainAvailableTimeJpaRepository.kt @@ -6,5 +6,4 @@ import team.aliens.dms.persistence.remain.entity.RemainAvailableTimeJpaEntity import java.util.UUID @Repository -interface RemainAvailableTimeJpaRepository : CrudRepository { -} \ No newline at end of file +interface RemainAvailableTimeJpaRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainOptionJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainOptionJpaRepository.kt index 626403603..07b61e47e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainOptionJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainOptionJpaRepository.kt @@ -9,5 +9,4 @@ import java.util.UUID interface RemainOptionJpaRepository : CrudRepository { fun findAllBySchoolId(schoolId: UUID): List - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainStatusJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainStatusJpaRepository.kt index 716a0d6b5..04d59f4e7 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainStatusJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/remain/repository/RemainStatusJpaRepository.kt @@ -9,4 +9,4 @@ import java.util.UUID interface RemainStatusJpaRepository : CrudRepository { fun deleteByRemainOptionId(remainOptionId: UUID) fun deleteByStudentId(studentId: UUID) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/RoomPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/RoomPersistenceAdapter.kt index e59bdc577..0de2693f3 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/RoomPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/RoomPersistenceAdapter.kt @@ -1,10 +1,10 @@ package team.aliens.dms.persistence.room -import java.util.UUID import org.springframework.stereotype.Component import team.aliens.dms.domain.room.spi.RoomPort import team.aliens.dms.persistence.room.mapper.RoomMapper import team.aliens.dms.persistence.room.repository.RoomJpaRepository +import java.util.UUID @Component class RoomPersistenceAdapter( @@ -18,4 +18,4 @@ class RoomPersistenceAdapter( number = number ) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/entity/RoomJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/entity/RoomJpaEntity.kt index 872f5324d..03c9b4bf8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/entity/RoomJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/entity/RoomJpaEntity.kt @@ -23,4 +23,4 @@ class RoomJpaEntity( @Column(columnDefinition = "INT UNSIGNED", nullable = false, unique = true) val number: Int -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/mapper/RoomMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/mapper/RoomMapper.kt index a171790b0..ef9fcb72e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/mapper/RoomMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/mapper/RoomMapper.kt @@ -31,4 +31,4 @@ class RoomMapper( number = domain.number ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/repository/RoomJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/repository/RoomJpaRepository.kt index 810d5e765..8a3b0cc8d 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/repository/RoomJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/room/repository/RoomJpaRepository.kt @@ -9,5 +9,4 @@ import java.util.UUID interface RoomJpaRepository : CrudRepository { fun findBySchoolIdAndNumber(schoolId: UUID, number: Int): RoomJpaEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/SchoolPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/SchoolPersistenceAdapter.kt index 144d4645f..a23f4cba9 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/SchoolPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/SchoolPersistenceAdapter.kt @@ -39,4 +39,4 @@ class SchoolPersistenceAdapter( override fun querySchoolByCode(code: String) = schoolMapper.toDomain( schoolRepository.findByCode(code) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/AvailableFeatureJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/AvailableFeatureJpaEntity.kt index b3641d38b..659c9a1a1 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/AvailableFeatureJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/AvailableFeatureJpaEntity.kt @@ -37,4 +37,4 @@ class AvailableFeatureJpaEntity( @Column(columnDefinition = "TINYINT(1)", nullable = false) val remainService: Boolean -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/SchoolJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/SchoolJpaEntity.kt index 5b1a43785..c4cfcb756 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/SchoolJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/entity/SchoolJpaEntity.kt @@ -9,7 +9,8 @@ import javax.persistence.Table import javax.persistence.UniqueConstraint @Entity -@Table(name = "tbl_school", +@Table( + name = "tbl_school", uniqueConstraints = [ UniqueConstraint(columnNames = arrayOf("name", "address")) ] @@ -39,4 +40,4 @@ class SchoolJpaEntity( @Column(columnDefinition = "DATE") val contractEndedAt: LocalDate? -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/AvailableFeatureMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/AvailableFeatureMapper.kt index 9dc35e335..520f2fb15 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/AvailableFeatureMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/AvailableFeatureMapper.kt @@ -38,4 +38,4 @@ class AvailableFeatureMapper( remainService = domain.remainService ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/SchoolMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/SchoolMapper.kt index 5b7a2d5ed..5452a6aad 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/SchoolMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/mapper/SchoolMapper.kt @@ -35,4 +35,4 @@ class SchoolMapper : GenericMapper { contractEndedAt = domain.contractEndedAt ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/AvailableFeatureJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/AvailableFeatureJpaRepository.kt index aadd79e9c..51c5579d7 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/AvailableFeatureJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/AvailableFeatureJpaRepository.kt @@ -6,5 +6,4 @@ import team.aliens.dms.persistence.school.entity.AvailableFeatureJpaEntity import java.util.UUID @Repository -interface AvailableFeatureJpaRepository : CrudRepository { -} \ No newline at end of file +interface AvailableFeatureJpaRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/SchoolJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/SchoolJpaRepository.kt index 4eb0c227d..d131363c3 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/SchoolJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/school/repository/SchoolJpaRepository.kt @@ -9,5 +9,4 @@ import java.util.UUID interface SchoolJpaRepository : CrudRepository { fun findByCode(code: String): SchoolJpaEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/StudentPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/StudentPersistenceAdapter.kt index b0b3e397f..560879d8f 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/StudentPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/StudentPersistenceAdapter.kt @@ -100,11 +100,11 @@ class StudentPersistenceAdapter( private fun nameContains(name: String?) = name?.run { studentJpaEntity.name.contains(this) } private fun pointTotalBetween(pointFilter: PointFilter): BooleanExpression? { - if(pointFilter.filterType == null) { + if (pointFilter.filterType == null) { return null } - return when(pointFilter.filterType) { + return when (pointFilter.filterType) { PointFilterType.BONUS -> { pointHistoryJpaEntity.bonusTotal.between(pointFilter.minPoint, pointFilter.maxPoint) } @@ -114,7 +114,7 @@ class StudentPersistenceAdapter( else -> { val pointTotal = pointHistoryJpaEntity.bonusTotal.subtract(pointHistoryJpaEntity.minusTotal) - pointTotal.between(pointFilter.minPoint, pointFilter.maxPoint ) + pointTotal.between(pointFilter.minPoint, pointFilter.maxPoint) } } } @@ -197,15 +197,17 @@ class StudentPersistenceAdapter( private fun eqStudentRecentPointHistory(): BooleanExpression? { return pointHistoryJpaEntity.studentName.eq(studentJpaEntity.name) .and(eqGcn()) - .and(pointHistoryJpaEntity.createdAt.eq( - select(pointHistoryJpaEntity.createdAt.max()) - .from(pointHistoryJpaEntity) - .where( - pointHistoryJpaEntity.school.id.eq(schoolJpaEntity.id), - pointHistoryJpaEntity.studentName.eq(studentJpaEntity.name), - eqGcn() - ) - )) + .and( + pointHistoryJpaEntity.createdAt.eq( + select(pointHistoryJpaEntity.createdAt.max()) + .from(pointHistoryJpaEntity) + .where( + pointHistoryJpaEntity.school.id.eq(schoolJpaEntity.id), + pointHistoryJpaEntity.studentName.eq(studentJpaEntity.name), + eqGcn() + ) + ) + ) } private fun eqGcn(): BooleanBuilder { diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/VerifiedStudentPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/VerifiedStudentPersistenceAdapter.kt index 9fbf9bbea..1161e8046 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/VerifiedStudentPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/VerifiedStudentPersistenceAdapter.kt @@ -17,4 +17,4 @@ class VerifiedStudentPersistenceAdapter( schoolName = schoolName ) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/StudentJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/StudentJpaEntity.kt index a7d3d96df..2db722d70 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/StudentJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/StudentJpaEntity.kt @@ -59,4 +59,4 @@ class StudentJpaEntity( @Enumerated(EnumType.STRING) val sex: Sex -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/VerifiedStudentJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/VerifiedStudentJpaEntity.kt index c410e8bb3..2ace509de 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/VerifiedStudentJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/entity/VerifiedStudentJpaEntity.kt @@ -1,13 +1,13 @@ package team.aliens.dms.persistence.student.entity -import java.util.UUID import team.aliens.dms.domain.student.model.Sex +import team.aliens.dms.persistence.BaseUUIDEntity +import java.util.UUID import javax.persistence.Column import javax.persistence.Entity import javax.persistence.EnumType import javax.persistence.Enumerated import javax.persistence.Table -import team.aliens.dms.persistence.BaseUUIDEntity @Entity @Table(name = "tbl_verified_student") @@ -31,4 +31,4 @@ class VerifiedStudentJpaEntity( @Enumerated(EnumType.STRING) val sex: Sex -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/StudentMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/StudentMapper.kt index d49d6e60f..13b50d849 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/StudentMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/StudentMapper.kt @@ -47,4 +47,4 @@ class StudentMapper( sex = domain.sex ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/VerifiedStudentMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/VerifiedStudentMapper.kt index f1075a40e..7e2bc4e4c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/VerifiedStudentMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/mapper/VerifiedStudentMapper.kt @@ -31,4 +31,4 @@ class VerifiedStudentMapper : GenericMapper { classRoom: Int, number: Int ): StudentJpaEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/repository/VerifiedStudentJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/repository/VerifiedStudentJpaRepository.kt index 6fff42ccc..546bd291a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/repository/VerifiedStudentJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/student/repository/VerifiedStudentJpaRepository.kt @@ -1,13 +1,12 @@ package team.aliens.dms.persistence.student.repository -import java.util.UUID import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository import team.aliens.dms.persistence.student.entity.VerifiedStudentJpaEntity +import java.util.UUID @Repository interface VerifiedStudentJpaRepository : CrudRepository { fun findByGcnAndSchoolName(gcn: String, schoolName: String): VerifiedStudentJpaEntity? - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/AvailableTimePersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/AvailableTimePersistenceAdapter.kt index 0c3a1638f..bba2d2483 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/AvailableTimePersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/AvailableTimePersistenceAdapter.kt @@ -23,4 +23,4 @@ class AvailableTimePersistenceAdapter( availableTimeMapper.toEntity(availableTime) ) )!! -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/SeatTypePersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/SeatTypePersistenceAdapter.kt index 431d0d4da..df75df5df 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/SeatTypePersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/SeatTypePersistenceAdapter.kt @@ -1,12 +1,12 @@ package team.aliens.dms.persistence.studyroom -import java.util.UUID import org.springframework.data.repository.findByIdOrNull import org.springframework.stereotype.Component import team.aliens.dms.domain.studyroom.model.SeatType import team.aliens.dms.domain.studyroom.spi.SeatTypePort import team.aliens.dms.persistence.studyroom.mapper.SeatTypeMapper import team.aliens.dms.persistence.studyroom.repository.SeatTypeJpaRepository +import java.util.UUID @Component class SeatTypePersistenceAdapter( @@ -34,4 +34,4 @@ class SeatTypePersistenceAdapter( override fun deleteSeatType(seatType: SeatType) = seatTypeRepository.delete( seatTypeMapper.toEntity(seatType) ) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/StudyRoomPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/StudyRoomPersistenceAdapter.kt index 478dc92af..5db4ef865 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/StudyRoomPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/StudyRoomPersistenceAdapter.kt @@ -1,13 +1,12 @@ package team.aliens.dms.persistence.studyroom import com.querydsl.jpa.impl.JPAQueryFactory -import java.util.UUID import org.springframework.data.repository.findByIdOrNull import org.springframework.stereotype.Component -import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.model.Seat import team.aliens.dms.domain.studyroom.model.StudyRoom import team.aliens.dms.domain.studyroom.spi.StudyRoomPort +import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.spi.vo.StudyRoomVO import team.aliens.dms.persistence.student.entity.QStudentJpaEntity.studentJpaEntity import team.aliens.dms.persistence.studyroom.entity.QSeatJpaEntity.seatJpaEntity @@ -19,6 +18,7 @@ import team.aliens.dms.persistence.studyroom.repository.SeatJpaRepository import team.aliens.dms.persistence.studyroom.repository.StudyRoomJpaRepository import team.aliens.dms.persistence.studyroom.repository.vo.QQuerySeatVO import team.aliens.dms.persistence.studyroom.repository.vo.QQueryStudyRoomVO +import java.util.UUID @Component class StudyRoomPersistenceAdapter( @@ -42,7 +42,9 @@ class StudyRoomPersistenceAdapter( ) override fun existsStudyRoomByFloorAndNameAndSchoolId( - floor: Int, name: String, schoolId: UUID + floor: Int, + name: String, + schoolId: UUID ) = studyRoomRepository.existsByNameAndFloorAndSchoolId(name, floor, schoolId) override fun queryAllSeatsByStudyRoomId(studyRoomId: UUID): List { @@ -126,4 +128,4 @@ class StudyRoomPersistenceAdapter( } override fun existsSeatBySeatTypeId(seatTypeId: UUID) = seatRepository.existsByTypeId(seatTypeId) -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/AvailableTimeJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/AvailableTimeJpaEntity.kt index babf39349..b869661a8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/AvailableTimeJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/AvailableTimeJpaEntity.kt @@ -1,5 +1,6 @@ package team.aliens.dms.persistence.studyroom.entity +import team.aliens.dms.persistence.school.entity.SchoolJpaEntity import java.time.LocalTime import java.util.UUID import javax.persistence.Column @@ -10,7 +11,6 @@ import javax.persistence.JoinColumn import javax.persistence.MapsId import javax.persistence.OneToOne import javax.persistence.Table -import team.aliens.dms.persistence.school.entity.SchoolJpaEntity @Entity @Table(name = "tbl_study_room_available_time") @@ -30,4 +30,4 @@ class AvailableTimeJpaEntity( @Column(columnDefinition = "TIME", nullable = false) val endAt: LocalTime -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatJpaEntity.kt index 3d621ed9b..22ddd6b69 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatJpaEntity.kt @@ -1,5 +1,8 @@ package team.aliens.dms.persistence.studyroom.entity +import team.aliens.dms.domain.studyroom.model.SeatStatus +import team.aliens.dms.persistence.BaseUUIDEntity +import team.aliens.dms.persistence.student.entity.StudentJpaEntity import java.util.UUID import javax.persistence.Column import javax.persistence.Entity @@ -11,9 +14,6 @@ import javax.persistence.ManyToOne import javax.persistence.OneToOne import javax.persistence.Table import javax.persistence.UniqueConstraint -import team.aliens.dms.domain.studyroom.model.SeatStatus -import team.aliens.dms.persistence.BaseUUIDEntity -import team.aliens.dms.persistence.student.entity.StudentJpaEntity @Entity @Table( @@ -52,4 +52,4 @@ class SeatJpaEntity( @Enumerated(EnumType.STRING) val status: SeatStatus -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatTypeJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatTypeJpaEntity.kt index 20d8f483f..b43f5f48a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatTypeJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/SeatTypeJpaEntity.kt @@ -1,5 +1,7 @@ package team.aliens.dms.persistence.studyroom.entity +import team.aliens.dms.persistence.BaseUUIDEntity +import team.aliens.dms.persistence.school.entity.SchoolJpaEntity import java.util.UUID import javax.persistence.Column import javax.persistence.Entity @@ -7,8 +9,6 @@ import javax.persistence.FetchType import javax.persistence.JoinColumn import javax.persistence.ManyToOne import javax.persistence.Table -import team.aliens.dms.persistence.BaseUUIDEntity -import team.aliens.dms.persistence.school.entity.SchoolJpaEntity @Entity @Table(name = "tbl_seat_type") @@ -26,4 +26,4 @@ class SeatTypeJpaEntity( @Column(columnDefinition = "CHAR(7)", nullable = false) val color: String -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/StudyRoomJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/StudyRoomJpaEntity.kt index c91523715..627896381 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/StudyRoomJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/entity/StudyRoomJpaEntity.kt @@ -1,5 +1,8 @@ package team.aliens.dms.persistence.studyroom.entity +import team.aliens.dms.domain.student.model.Sex +import team.aliens.dms.persistence.BaseUUIDEntity +import team.aliens.dms.persistence.school.entity.SchoolJpaEntity import java.util.UUID import javax.persistence.Column import javax.persistence.Entity @@ -10,9 +13,6 @@ import javax.persistence.JoinColumn import javax.persistence.ManyToOne import javax.persistence.Table import javax.persistence.UniqueConstraint -import team.aliens.dms.domain.student.model.Sex -import team.aliens.dms.persistence.BaseUUIDEntity -import team.aliens.dms.persistence.school.entity.SchoolJpaEntity @Entity @Table( @@ -66,4 +66,4 @@ class StudyRoomJpaEntity( @Column(columnDefinition = "VARCHAR(20)", nullable = false) val northDescription: String -) : BaseUUIDEntity(id) \ No newline at end of file +) : BaseUUIDEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/AvailableTimeMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/AvailableTimeMapper.kt index 079e2d4cf..765d3a572 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/AvailableTimeMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/AvailableTimeMapper.kt @@ -32,4 +32,4 @@ class AvailableTimeMapper( endAt = domain.endAt ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatMapper.kt index 16cbc5de9..3b16f1348 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatMapper.kt @@ -53,4 +53,4 @@ class SeatMapper( status = domain.status ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatTypeMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatTypeMapper.kt index f04fb93b9..02eda358d 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatTypeMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/SeatTypeMapper.kt @@ -10,7 +10,7 @@ import team.aliens.dms.persistence.studyroom.entity.SeatTypeJpaEntity @Component class SeatTypeMapper( private val schoolRepository: SchoolJpaRepository -) : GenericMapper{ +) : GenericMapper { override fun toDomain(entity: SeatTypeJpaEntity?): SeatType? { return entity?.let { @@ -33,4 +33,4 @@ class SeatTypeMapper( color = domain.color ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/StudyRoomMapper.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/StudyRoomMapper.kt index 3a2843ae4..83371d752 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/StudyRoomMapper.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/mapper/StudyRoomMapper.kt @@ -53,4 +53,4 @@ class StudyRoomMapper( northDescription = domain.northDescription ) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/AvailableTimeJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/AvailableTimeJpaRepository.kt index 6480dd229..924800f7a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/AvailableTimeJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/AvailableTimeJpaRepository.kt @@ -1,10 +1,9 @@ package team.aliens.dms.persistence.studyroom.repository -import java.util.UUID import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository import team.aliens.dms.persistence.studyroom.entity.AvailableTimeJpaEntity +import java.util.UUID @Repository -interface AvailableTimeJpaRepository : CrudRepository { -} \ No newline at end of file +interface AvailableTimeJpaRepository : CrudRepository diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatJpaRepository.kt index bf7e2f6e8..659d9ecb4 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatJpaRepository.kt @@ -1,9 +1,9 @@ package team.aliens.dms.persistence.studyroom.repository import org.springframework.data.jpa.repository.JpaRepository -import java.util.UUID import org.springframework.stereotype.Repository import team.aliens.dms.persistence.studyroom.entity.SeatJpaEntity +import java.util.UUID @Repository interface SeatJpaRepository : JpaRepository { @@ -15,5 +15,4 @@ interface SeatJpaRepository : JpaRepository { fun findByStudyRoomId(studyRoomId: UUID): SeatJpaEntity? fun existsByTypeId(seatTypeId: UUID): Boolean - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatTypeJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatTypeJpaRepository.kt index ab7dafdb0..03ba171a5 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatTypeJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/SeatTypeJpaRepository.kt @@ -1,9 +1,9 @@ package team.aliens.dms.persistence.studyroom.repository -import java.util.UUID import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository import team.aliens.dms.persistence.studyroom.entity.SeatTypeJpaEntity +import java.util.UUID @Repository interface SeatTypeJpaRepository : CrudRepository { @@ -11,5 +11,4 @@ interface SeatTypeJpaRepository : CrudRepository { fun findAllBySchoolId(schoolId: UUID): List fun existsByName(name: String): Boolean - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/StudyRoomJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/StudyRoomJpaRepository.kt index 8566f2398..8bc6d4056 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/StudyRoomJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/StudyRoomJpaRepository.kt @@ -1,13 +1,12 @@ package team.aliens.dms.persistence.studyroom.repository -import java.util.UUID import org.springframework.data.repository.CrudRepository import org.springframework.stereotype.Repository import team.aliens.dms.persistence.studyroom.entity.StudyRoomJpaEntity +import java.util.UUID @Repository interface StudyRoomJpaRepository : CrudRepository { fun existsByNameAndFloorAndSchoolId(name: String, floor: Int, schoolId: UUID): Boolean - -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QuerySeatVO.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QuerySeatVO.kt index 80c688a01..35c404058 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QuerySeatVO.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QuerySeatVO.kt @@ -1,9 +1,9 @@ package team.aliens.dms.persistence.studyroom.repository.vo import com.querydsl.core.annotations.QueryProjection -import java.util.UUID -import team.aliens.dms.domain.studyroom.spi.vo.SeatVO import team.aliens.dms.domain.studyroom.model.SeatStatus +import team.aliens.dms.domain.studyroom.spi.vo.SeatVO +import java.util.UUID class QuerySeatVO @QueryProjection constructor( seatId: UUID, @@ -35,4 +35,4 @@ class QuerySeatVO @QueryProjection constructor( studentClassRoom = studentClassRoom, studentNumber = studentNumber, studentProfileImageUrl = studentProfileImageUrl -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QueryStudyRoomVO.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QueryStudyRoomVO.kt index 90fac9d03..1643265c8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QueryStudyRoomVO.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/studyroom/repository/vo/QueryStudyRoomVO.kt @@ -1,9 +1,9 @@ package team.aliens.dms.persistence.studyroom.repository.vo import com.querydsl.core.annotations.QueryProjection -import java.util.UUID import team.aliens.dms.domain.student.model.Sex import team.aliens.dms.domain.studyroom.spi.vo.StudyRoomVO +import java.util.UUID class QueryStudyRoomVO @QueryProjection constructor( id: UUID, @@ -21,4 +21,4 @@ class QueryStudyRoomVO @QueryProjection constructor( availableSex = availableSex, inUseHeadcount = inUseHeadcount, totalAvailableSeat = totalAvailableSeat -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/UserPersistenceAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/UserPersistenceAdapter.kt index b38069b14..9a58b754e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/UserPersistenceAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/UserPersistenceAdapter.kt @@ -41,4 +41,4 @@ class UserPersistenceAdapter( userRepository.findByAccountId(accountId) ) } - + diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/entity/UserJpaEntity.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/entity/UserJpaEntity.kt index 143929956..c6167d38c 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/entity/UserJpaEntity.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/entity/UserJpaEntity.kt @@ -42,4 +42,4 @@ class UserJpaEntity( @Column(columnDefinition = "DATETIME") val deletedAt: LocalDateTime? -) : BaseEntity(id) \ No newline at end of file +) : BaseEntity(id) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/repository/UserJpaRepository.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/repository/UserJpaRepository.kt index 0afc66a6f..23c73eba8 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/repository/UserJpaRepository.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/persistence/user/repository/UserJpaRepository.kt @@ -18,4 +18,4 @@ interface UserJpaRepository : CrudRepository { fun findByEmail(email: String): UserJpaEntity? fun findByAccountId(accountId: String): UserJpaEntity? -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/AwsProperties.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/AwsProperties.kt index a374c2122..417a6cf99 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/AwsProperties.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/AwsProperties.kt @@ -8,4 +8,4 @@ import org.springframework.boot.context.properties.ConstructorBinding class AwsProperties( val accessKey: String, val secretKey: String -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESAdapter.kt index c4d938d6f..ae88f8e1f 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESAdapter.kt @@ -139,4 +139,4 @@ class AwsSESAdapter( throw SesException } } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESProperties.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESProperties.kt index 4767e6b43..80fea7023 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESProperties.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSESProperties.kt @@ -7,4 +7,4 @@ import org.springframework.boot.context.properties.ConstructorBinding @ConstructorBinding class AwsSESProperties( val source: String -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSesConfig.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSesConfig.kt index d6334943b..245fbfa67 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSesConfig.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/AwsSesConfig.kt @@ -23,4 +23,4 @@ class AwsSesConfig( .withRegion(Regions.AP_NORTHEAST_2) .build() } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SendEmailRejectedException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SendEmailRejectedException.kt index 32e5c609b..a37697b7a 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SendEmailRejectedException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SendEmailRejectedException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object SendEmailRejectedException : DmsException( GlobalErrorCode.SEND_EMAIL_REJECTED -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SesException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SesException.kt index c3fc542a0..271519f55 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SesException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/email/exception/SesException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object SesException : DmsException( GlobalErrorCode.SIMPLE_EMAIL_SERVICE -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapter.kt index e70b88d9b..57708f884 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapter.kt @@ -172,4 +172,4 @@ class ExcelAdapter : ParseFilePort, WriteFilePort { alignment = HorizontalAlignment.LEFT.ordinal.toShort() verticalAlignment = VerticalAlignment.CENTER.ordinal.toShort() } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelExtensionMismatchException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelExtensionMismatchException.kt index b11847980..8a95efcdc 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelExtensionMismatchException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelExtensionMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object ExcelExtensionMismatchException : DmsException( GlobalErrorCode.EXTENSION_MISMATCH -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelInvalidFileException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelInvalidFileException.kt index cc7b5e346..5aa0be832 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelInvalidFileException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelInvalidFileException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object ExcelInvalidFileException : DmsException( GlobalErrorCode.INVALID_FILE -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelSexMismatchException.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelSexMismatchException.kt index b5f1de78c..0bbf9a468 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelSexMismatchException.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/parser/exception/ExcelSexMismatchException.kt @@ -5,4 +5,4 @@ import team.aliens.dms.global.error.GlobalErrorCode object ExcelSexMismatchException : DmsException( GlobalErrorCode.SEX_MISMATCH -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Adapter.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Adapter.kt index e74c0d59d..c18029a36 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Adapter.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Adapter.kt @@ -47,4 +47,4 @@ class AwsS3Adapter( private fun getResource(fileName: String): String { return amazonS3Client.getResourceUrl(awsProperties.bucket, fileName) } -} \ No newline at end of file +} diff --git a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Properties.kt b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Properties.kt index 85c6259ee..977fdbc1e 100644 --- a/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Properties.kt +++ b/dms-infrastructure/src/main/kotlin/team/aliens/dms/thirdparty/storage/AwsS3Properties.kt @@ -7,4 +7,4 @@ import org.springframework.boot.context.properties.ConstructorBinding @ConstructorBinding class AwsS3Properties( val bucket: String -) \ No newline at end of file +) diff --git a/dms-infrastructure/src/test/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapterTests.kt b/dms-infrastructure/src/test/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapterTests.kt index f54cb6a39..7298a985e 100644 --- a/dms-infrastructure/src/test/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapterTests.kt +++ b/dms-infrastructure/src/test/kotlin/team/aliens/dms/thirdparty/parser/ExcelAdapterTests.kt @@ -95,5 +95,4 @@ class ExcelAdapterTests { { assertEquals(datasList.captured[0].size, attributes.captured.size) } ) } - -} \ No newline at end of file +} diff --git a/dms-presentation/config/detekt/detekt.yml b/dms-presentation/config/detekt/detekt.yml new file mode 100644 index 000000000..15ced9138 --- /dev/null +++ b/dms-presentation/config/detekt/detekt.yml @@ -0,0 +1,809 @@ +build: + maxIssues: -1 + excludeCorrectable: false + weights: + # complexity: 2 + # LongParameterList: 1 + # style: 1 + # comments: 1 + +config: + validation: true + warningsAsErrors: false + # when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]' + excludes: '' + +processors: + active: true + exclude: + - 'DetektProgressListener' + # - 'KtFileCountProcessor' + # - 'PackageCountProcessor' + # - 'ClassCountProcessor' + # - 'FunctionCountProcessor' + # - 'PropertyCountProcessor' + # - 'ProjectComplexityProcessor' + # - 'ProjectCognitiveComplexityProcessor' + # - 'ProjectLLOCProcessor' + # - 'ProjectCLOCProcessor' + # - 'ProjectLOCProcessor' + # - 'ProjectSLOCProcessor' + # - 'LicenseHeaderLoaderExtension' + +console-reports: + active: true + exclude: + - 'ProjectStatisticsReport' + - 'ComplexityReport' + - 'NotificationReport' + # - 'FindingsReport' + - 'FileBasedFindingsReport' + - 'LiteFindingsReport' + +output-reports: + active: true + exclude: + # - 'TxtOutputReport' + # - 'XmlOutputReport' + # - 'HtmlOutputReport' + +comments: + active: true + AbsentOrWrongFileLicense: + active: false + licenseTemplateFile: 'license.template' + licenseTemplateIsRegex: false + CommentOverPrivateFunction: + active: false + CommentOverPrivateProperty: + active: false + DeprecatedBlockTag: + active: false + EndOfSentenceFormat: + active: false + endOfSentenceFormat: '([.?!][ \t\n\r\f<])|([.?!:]$)' + OutdatedDocumentation: + active: false + matchTypeParameters: true + matchDeclarationsOrder: true + UndocumentedPublicClass: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + searchInNestedClass: true + searchInInnerClass: true + searchInInnerObject: true + searchInInnerInterface: true + UndocumentedPublicFunction: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UndocumentedPublicProperty: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + +complexity: + active: true + ComplexCondition: + active: true + threshold: 4 + ComplexInterface: + active: false + threshold: 10 + includeStaticDeclarations: false + includePrivateDeclarations: false + ComplexMethod: + active: true + threshold: 15 + ignoreSingleWhenExpression: false + ignoreSimpleWhenEntries: false + ignoreNestingFunctions: false + nestingFunctions: + - 'also' + - 'apply' + - 'forEach' + - 'isNotNull' + - 'ifNull' + - 'let' + - 'run' + - 'use' + - 'with' + LabeledExpression: + active: false + ignoredLabels: [] + LargeClass: + active: true + threshold: 600 + LongMethod: + active: true + threshold: 60 + LongParameterList: + active: true + functionThreshold: 6 + constructorThreshold: 7 + ignoreDefaultParameters: false + ignoreDataClasses: true + ignoreAnnotatedParameter: [] + excludes: ['**/vo/**', '**/usecase/**'] + MethodOverloading: + active: false + threshold: 6 + NamedArguments: + active: false + threshold: 3 + NestedBlockDepth: + active: true + threshold: 4 + ReplaceSafeCallChainWithRun: + active: false + StringLiteralDuplication: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + threshold: 3 + ignoreAnnotation: true + excludeStringsWithLessThan5Characters: true + ignoreStringsRegex: '$^' + TooManyFunctions: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + thresholdInFiles: 11 + thresholdInClasses: 11 + thresholdInInterfaces: 11 + thresholdInObjects: 11 + thresholdInEnums: 11 + ignoreDeprecated: false + ignorePrivate: false + ignoreOverridden: false + +coroutines: + active: true + GlobalCoroutineUsage: + active: false + InjectDispatcher: + active: false + dispatcherNames: + - 'IO' + - 'Default' + - 'Unconfined' + RedundantSuspendModifier: + active: false + SleepInsteadOfDelay: + active: false + SuspendFunWithFlowReturnType: + active: false + +empty-blocks: + active: true + EmptyCatchBlock: + active: true + allowedExceptionNameRegex: '_|(ignore|expected).*' + EmptyClassBlock: + active: true + EmptyDefaultConstructor: + active: true + EmptyDoWhileBlock: + active: true + EmptyElseBlock: + active: true + EmptyFinallyBlock: + active: true + EmptyForBlock: + active: true + EmptyFunctionBlock: + active: true + ignoreOverridden: false + EmptyIfBlock: + active: true + EmptyInitBlock: + active: true + EmptyKtFile: + active: true + EmptySecondaryConstructor: + active: true + EmptyTryBlock: + active: true + EmptyWhenBlock: + active: true + EmptyWhileBlock: + active: true + +exceptions: + active: true + ExceptionRaisedInUnexpectedLocation: + active: true + methodNames: + - 'equals' + - 'finalize' + - 'hashCode' + - 'toString' + InstanceOfCheckForException: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + NotImplementedDeclaration: + active: false + ObjectExtendsThrowable: + active: false + PrintStackTrace: + active: true + RethrowCaughtException: + active: true + ReturnFromFinally: + active: true + ignoreLabeled: false + SwallowedException: + active: true + ignoredExceptionTypes: + - 'InterruptedException' + - 'MalformedURLException' + - 'NumberFormatException' + - 'ParseException' + allowedExceptionNameRegex: '_|(ignore|expected).*' + ThrowingExceptionFromFinally: + active: true + ThrowingExceptionInMain: + active: false + ThrowingExceptionsWithoutMessageOrCause: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptions: + - 'ArrayIndexOutOfBoundsException' + - 'Exception' + - 'IllegalArgumentException' + - 'IllegalMonitorStateException' + - 'IllegalStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + ThrowingNewInstanceOfSameException: + active: true + TooGenericExceptionCaught: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + exceptionNames: + - 'ArrayIndexOutOfBoundsException' + - 'Error' + - 'Exception' + - 'IllegalMonitorStateException' + - 'IndexOutOfBoundsException' + - 'NullPointerException' + - 'RuntimeException' + - 'Throwable' + allowedExceptionNameRegex: '_|(ignore|expected).*' + TooGenericExceptionThrown: + active: true + exceptionNames: + - 'Error' + - 'Exception' + - 'RuntimeException' + - 'Throwable' + +formatting: + active: true + android: false + autoCorrect: true + AnnotationOnSeparateLine: + active: false + autoCorrect: true + AnnotationSpacing: + active: false + autoCorrect: true + ArgumentListWrapping: + active: false + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + ChainWrapping: + active: true + autoCorrect: true + CommentSpacing: + active: true + autoCorrect: true + EnumEntryNameCase: + active: false + autoCorrect: true + Filename: + active: true + FinalNewline: + active: true + autoCorrect: true + insertFinalNewLine: true + ImportOrdering: + active: true + autoCorrect: true + layout: '*,java.**,javax.**,kotlin.**,^' + Indentation: + active: true + autoCorrect: true + indentSize: 4 + continuationIndentSize: 4 + MaximumLineLength: + active: true + maxLineLength: 120 + ignoreBackTickedIdentifier: false + ModifierOrdering: + active: true + autoCorrect: true + MultiLineIfElse: + active: false + autoCorrect: true + NoBlankLineBeforeRbrace: + active: true + autoCorrect: true + NoConsecutiveBlankLines: + active: true + autoCorrect: true + NoEmptyClassBody: + active: true + autoCorrect: true + NoEmptyFirstLineInMethodBlock: + active: false + autoCorrect: true + NoLineBreakAfterElse: + active: true + autoCorrect: true + NoLineBreakBeforeAssignment: + active: true + autoCorrect: true + NoMultipleSpaces: + active: true + autoCorrect: true + NoSemicolons: + active: true + autoCorrect: true + NoTrailingSpaces: + active: true + autoCorrect: true + NoUnitReturn: + active: true + autoCorrect: true + NoUnusedImports: + active: true + autoCorrect: true + NoWildcardImports: + active: true + PackageName: + active: false + autoCorrect: true + ParameterListWrapping: + active: true + autoCorrect: true + indentSize: 4 + maxLineLength: 120 + SpacingAroundAngleBrackets: + active: false + autoCorrect: true + SpacingAroundColon: + active: true + autoCorrect: true + SpacingAroundComma: + active: true + autoCorrect: true + SpacingAroundCurly: + active: true + autoCorrect: true + SpacingAroundDot: + active: true + autoCorrect: true + SpacingAroundDoubleColon: + active: false + autoCorrect: true + SpacingAroundKeyword: + active: true + autoCorrect: true + SpacingAroundOperators: + active: true + autoCorrect: true + SpacingAroundParens: + active: true + autoCorrect: true + SpacingAroundRangeOperator: + active: true + autoCorrect: true + SpacingAroundUnaryOperator: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithAnnotations: + active: false + autoCorrect: true + SpacingBetweenDeclarationsWithComments: + active: false + autoCorrect: true + StringTemplate: + active: true + autoCorrect: true + +naming: + active: true + BooleanPropertyNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + allowedPattern: '^(is|has|are)' + ClassNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + classPattern: '[A-Z][a-zA-Z0-9]*' + ConstructorParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + privateParameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + EnumNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + enumEntryPattern: '[A-Z][_a-zA-Z0-9]*' + ForbiddenClassName: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + forbiddenName: [] + FunctionMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumFunctionNameLength: 30 + FunctionMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumFunctionNameLength: 3 + FunctionNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + functionPattern: '([a-z][a-zA-Z0-9]*)|(`.*`)' + excludeClassPattern: '$^' + ignoreOverridden: true + FunctionParameterNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + InvalidPackageDeclaration: + active: false + rootPackage: '' + LambdaParameterNaming: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + parameterPattern: '[a-z][A-Za-z0-9]*|_' + MatchingDeclarationName: + active: true + mustBeFirst: true + MemberNameEqualsClassName: + active: true + ignoreOverridden: true + NoNameShadowing: + active: false + NonBooleanPropertyPrefixedWithIs: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ObjectPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Za-z][_A-Za-z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '(_)?[A-Za-z][_A-Za-z0-9]*' + PackageNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + packagePattern: '[a-z]+(\.[a-z][A-Za-z0-9]*)*' + TopLevelPropertyNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + constantPattern: '[A-Z][_A-Z0-9]*' + propertyPattern: '[A-Za-z][_A-Za-z0-9]*' + privatePropertyPattern: '_?[A-Za-z][_A-Za-z0-9]*' + VariableMaxLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + maximumVariableNameLength: 64 + VariableMinLength: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + minimumVariableNameLength: 1 + VariableNaming: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + variablePattern: '[a-z][A-Za-z0-9]*' + privateVariablePattern: '(_)?[a-z][A-Za-z0-9]*' + excludeClassPattern: '$^' + ignoreOverridden: true + +performance: + active: true + ArrayPrimitive: + active: true + ForEachOnRange: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + SpreadOperator: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnnecessaryTemporaryInstantiation: + active: true + +potential-bugs: + active: true + AvoidReferentialEquality: + active: false + forbiddenTypePatterns: + - 'kotlin.String' + CastToNullableType: + active: false + Deprecation: + active: false + DontDowncastCollectionTypes: + active: false + DoubleMutabilityForCollection: + active: false + DuplicateCaseInWhenExpression: + active: true + EqualsAlwaysReturnsTrueOrFalse: + active: true + EqualsWithHashCodeExist: + active: true + ExitOutsideMain: + active: false + ExplicitGarbageCollectionCall: + active: true + HasPlatformType: + active: false + IgnoredReturnValue: + active: false + restrictToAnnotatedMethods: true + returnValueAnnotations: + - '*.CheckResult' + - '*.CheckReturnValue' + ignoreReturnValueAnnotations: + - '*.CanIgnoreReturnValue' + ImplicitDefaultLocale: + active: true + ImplicitUnitReturnType: + active: false + allowExplicitReturnType: true + InvalidRange: + active: true + IteratorHasNextCallsNextMethod: + active: true + IteratorNotThrowingNoSuchElementException: + active: true + LateinitUsage: + active: false + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreOnClassesPattern: '' + MapGetWithNotNullAssertionOperator: + active: false + MissingPackageDeclaration: + active: false + excludes: ['**/*.kts'] + MissingWhenCase: + active: true + allowElseExpression: true + NullableToStringCall: + active: false + RedundantElseInWhen: + active: true + UnconditionalJumpStatementInLoop: + active: false + UnnecessaryNotNullOperator: + active: true + UnnecessarySafeCall: + active: true + UnreachableCatchBlock: + active: false + UnreachableCode: + active: true + UnsafeCallOnNullableType: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + UnsafeCast: + active: true + UnusedUnaryOperator: + active: false + UselessPostfixExpression: + active: false + WrongEqualsTypeParameter: + active: true + +style: + active: true + ClassOrdering: + active: false + CollapsibleIfStatements: + active: false + DataClassContainsFunctions: + active: false + conversionFunctionPrefix: 'to' + DataClassShouldBeImmutable: + active: false + DestructuringDeclarationWithTooManyEntries: + active: false + maxDestructuringEntries: 3 + EqualsNullCall: + active: true + EqualsOnSignatureLine: + active: false + ExplicitCollectionElementAccessMethod: + active: false + ExplicitItLambdaParameter: + active: false + ExpressionBodySyntax: + active: false + includeLineWrapping: false + ForbiddenComment: + active: true + values: + - 'FIXME:' + - 'STOPSHIP:' + - 'TODO:' + allowedPatterns: '' + customMessage: '' + ForbiddenImport: + active: false + imports: [] + forbiddenPatterns: '' + ForbiddenMethodCall: + active: false + methods: + - 'kotlin.io.print' + - 'kotlin.io.println' + ForbiddenPublicDataClass: + active: true + excludes: ['**'] + ignorePackages: + - '*.internal' + - '*.internal.*' + ForbiddenVoid: + active: false + ignoreOverridden: false + ignoreUsageInGenerics: false + FunctionOnlyReturningConstant: + active: true + ignoreOverridableFunction: true + ignoreActualFunction: true + excludedFunctions: '' + LibraryCodeMustSpecifyReturnType: + active: true + excludes: ['**'] + LibraryEntitiesShouldNotBePublic: + active: true + excludes: ['**'] + LoopWithTooManyJumpStatements: + active: true + maxJumpCount: 1 + MagicNumber: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] + ignoreNumbers: + - '-1' + - '0' + - '1' + - '2' + ignoreHashCodeFunction: true + ignorePropertyDeclaration: false + ignoreLocalVariableDeclaration: false + ignoreConstantDeclaration: true + ignoreCompanionObjectPropertyDeclaration: true + ignoreAnnotation: false + ignoreNamedArgument: true + ignoreEnums: false + ignoreRanges: false + ignoreExtensionFunctions: true + MandatoryBracesIfStatements: + active: false + MandatoryBracesLoops: + active: false + MaxLineLength: + active: true + maxLineLength: 120 + excludePackageStatements: true + excludeImportStatements: true + excludeCommentStatements: false + MayBeConst: + active: true + ModifierOrder: + active: true + MultilineLambdaItParameter: + active: false + NestedClassesVisibility: + active: true + NewLineAtEndOfFile: + active: true + NoTabs: + active: false + ObjectLiteralToLambda: + active: false + OptionalAbstractKeyword: + active: true + OptionalUnit: + active: false + OptionalWhenBraces: + active: false + PreferToOverPairSyntax: + active: false + ProtectedMemberInFinalClass: + active: true + RedundantExplicitType: + active: false + RedundantHigherOrderMapUsage: + active: false + RedundantVisibilityModifierRule: + active: false + ReturnCount: + active: true + max: 2 + excludedFunctions: 'equals' + excludeLabeled: false + excludeReturnFromLambda: true + excludeGuardClauses: false + SafeCast: + active: true + SerialVersionUIDInSerializableClass: + active: true + SpacingBetweenPackageAndImports: + active: false + ThrowsCount: + active: true + max: 4 + excludeGuardClauses: true + TrailingWhitespace: + active: false + UnderscoresInNumericLiterals: + active: false + acceptableLength: 4 + UnnecessaryAbstractClass: + active: true + UnnecessaryAnnotationUseSiteTarget: + active: false + UnnecessaryApply: + active: true + UnnecessaryFilter: + active: false + UnnecessaryInheritance: + active: true + UnnecessaryLet: + active: false + UnnecessaryParentheses: + active: false + UntilInsteadOfRangeTo: + active: false + UnusedImports: + active: false + UnusedPrivateClass: + active: true + UnusedPrivateMember: + active: true + allowedNames: '(_|ignored|expected|serialVersionUID)' + UseAnyOrNoneInsteadOfFind: + active: false + UseArrayLiteralsInAnnotations: + active: false + UseCheckNotNull: + active: false + UseCheckOrError: + active: false + UseDataClass: + active: false + allowVars: false + UseEmptyCounterpart: + active: false + UseIfEmptyOrIfBlank: + active: false + UseIfInsteadOfWhen: + active: false + UseIsNullOrEmpty: + active: false + UseOrEmpty: + active: false + UseRequire: + active: false + UseRequireNotNull: + active: false + UselessCallOnNotNull: + active: true + UtilityClassWithPublicConstructor: + active: true + VarCouldBeVal: + active: true + WildcardImport: + active: true + excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**'] +# excludeImports: +# - 'java.util.*' diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/common/WebMvcConfig.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/common/WebMvcConfig.kt index c7c708740..c4c0ad41d 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/common/WebMvcConfig.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/common/WebMvcConfig.kt @@ -17,4 +17,4 @@ class WebMvcConfig : WebMvcConfigurer { "http://team-aliens-dev.dsm-dms.com" ) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/common/dto/PageWebData.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/common/dto/PageWebData.kt index c0baab0a2..c3cd3847d 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/common/dto/PageWebData.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/common/dto/PageWebData.kt @@ -3,4 +3,4 @@ package team.aliens.dms.common.dto data class PageWebData( val page: Long?, val size: Long? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/HealthCheckWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/HealthCheckWebAdapter.kt index 3d44875c6..c4a53a39d 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/HealthCheckWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/HealthCheckWebAdapter.kt @@ -8,5 +8,4 @@ class HealthCheckWebAdapter { @GetMapping fun healthCheck() = "OK" - -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/AuthWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/AuthWebAdapter.kt index 339a02ae9..e635e5446 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/AuthWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/AuthWebAdapter.kt @@ -1,5 +1,6 @@ package team.aliens.dms.domain.auth +import org.hibernate.validator.constraints.Length import org.springframework.validation.annotation.Validated import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PostMapping @@ -9,15 +10,16 @@ import org.springframework.web.bind.annotation.RequestHeader import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.RestController -import team.aliens.dms.domain.auth.dto.request.SendEmailCodeWebRequest -import team.aliens.dms.domain.auth.dto.request.SignInWebRequest -import team.aliens.dms.domain.auth.dto.response.CheckAccountIdExistenceResponse import team.aliens.dms.domain.auth.dto.CertifyEmailCodeRequest import team.aliens.dms.domain.auth.dto.CertifyEmailRequest import team.aliens.dms.domain.auth.dto.ReissueResponse import team.aliens.dms.domain.auth.dto.SendEmailCodeRequest import team.aliens.dms.domain.auth.dto.SignInRequest import team.aliens.dms.domain.auth.dto.SignInResponse +import team.aliens.dms.domain.auth.dto.request.SendEmailCodeWebRequest +import team.aliens.dms.domain.auth.dto.request.SignInWebRequest +import team.aliens.dms.domain.auth.dto.request.WebEmailType +import team.aliens.dms.domain.auth.dto.response.CheckAccountIdExistenceResponse import team.aliens.dms.domain.auth.usecase.CertifyEmailCodeUseCase import team.aliens.dms.domain.auth.usecase.CertifyEmailUseCase import team.aliens.dms.domain.auth.usecase.CheckAccountIdExistenceUseCase @@ -28,8 +30,6 @@ import javax.validation.Valid import javax.validation.constraints.Email import javax.validation.constraints.NotBlank import javax.validation.constraints.NotNull -import org.hibernate.validator.constraints.Length -import team.aliens.dms.domain.auth.dto.request.WebEmailType @Validated @RequestMapping("/auth") @@ -102,4 +102,4 @@ class AuthWebAdapter( checkAccountIdExistenceUseCase.execute(accountId) ) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SendEmailCodeWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SendEmailCodeWebRequest.kt index ade9fe28c..e516a9915 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SendEmailCodeWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SendEmailCodeWebRequest.kt @@ -15,4 +15,4 @@ data class SendEmailCodeWebRequest( @field:NotNull val type: WebEmailType? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SignInWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SignInWebRequest.kt index 68a4f39f8..720456225 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SignInWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/SignInWebRequest.kt @@ -13,4 +13,4 @@ data class SignInWebRequest( @field:Size(min = 8, max = 20) val password: String? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/WebEmailType.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/WebEmailType.kt index 575f59b83..95d0b842f 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/WebEmailType.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/auth/dto/request/WebEmailType.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.auth.dto.request enum class WebEmailType { SIGNUP, PASSWORD -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileExtension.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileExtension.kt index c10174929..41aa9796f 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileExtension.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileExtension.kt @@ -10,4 +10,4 @@ object FileExtension { // excel const val XLS = "xls" const val XLSX = "xlsx" -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileWebAdapter.kt index fd783126f..695bf0fe4 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/file/FileWebAdapter.kt @@ -1,20 +1,20 @@ package team.aliens.dms.domain.file +import org.springframework.http.HttpStatus +import org.springframework.validation.annotation.Validated import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestPart +import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import org.springframework.web.multipart.MultipartFile -import team.aliens.dms.domain.file.usecase.UploadFileUseCase import team.aliens.dms.domain.file.dto.response.UploadFileResponse +import team.aliens.dms.domain.file.usecase.ImportVerifiedStudentUseCase +import team.aliens.dms.domain.file.usecase.UploadFileUseCase import java.io.File import java.io.FileOutputStream import java.util.UUID import javax.validation.constraints.NotNull -import org.springframework.http.HttpStatus -import org.springframework.validation.annotation.Validated -import org.springframework.web.bind.annotation.ResponseStatus -import team.aliens.dms.domain.file.usecase.ImportVerifiedStudentUseCase @Validated @RequestMapping("/files") @@ -50,4 +50,4 @@ class FileWebAdapter( it } } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/ManagerWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/ManagerWebAdapter.kt index 91a051665..dc607e76a 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/ManagerWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/ManagerWebAdapter.kt @@ -3,7 +3,6 @@ package team.aliens.dms.domain.manager import org.springframework.http.HttpStatus import org.springframework.validation.annotation.Validated import org.springframework.web.bind.annotation.DeleteMapping -import team.aliens.dms.domain.manager.dto.GetStudentDetailsResponse import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PatchMapping import org.springframework.web.bind.annotation.PathVariable @@ -12,23 +11,24 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController +import team.aliens.dms.domain.manager.dto.GetStudentDetailsResponse import team.aliens.dms.domain.manager.dto.ManagerMyPageResponse import team.aliens.dms.domain.manager.dto.PointFilterType import team.aliens.dms.domain.manager.dto.QueryStudentsResponse import team.aliens.dms.domain.manager.dto.ResetManagerPasswordRequest +import team.aliens.dms.domain.manager.dto.Sort +import team.aliens.dms.domain.manager.dto.request.ResetPasswordManagerWebRequest +import team.aliens.dms.domain.manager.dto.response.FindManagerAccountIdResponse import team.aliens.dms.domain.manager.usecase.FindManagerAccountIdUseCase +import team.aliens.dms.domain.manager.usecase.ManagerMyPageUseCase import team.aliens.dms.domain.manager.usecase.QueryStudentDetailsUseCase import team.aliens.dms.domain.manager.usecase.QueryStudentsUseCase -import team.aliens.dms.domain.manager.usecase.ManagerMyPageUseCase import team.aliens.dms.domain.manager.usecase.RemoveStudentUseCase import team.aliens.dms.domain.manager.usecase.ResetManagerPasswordUseCase -import team.aliens.dms.domain.manager.dto.request.ResetPasswordManagerWebRequest -import team.aliens.dms.domain.manager.dto.response.FindManagerAccountIdResponse import java.util.UUID import javax.validation.Valid import javax.validation.constraints.NotBlank import javax.validation.constraints.NotNull -import team.aliens.dms.domain.manager.dto.Sort @Validated @RequestMapping("/managers") @@ -52,7 +52,7 @@ class ManagerWebAdapter( answer = answer ) - return FindManagerAccountIdResponse(result); + return FindManagerAccountIdResponse(result) } @ResponseStatus(HttpStatus.NO_CONTENT) @@ -84,7 +84,7 @@ class ManagerWebAdapter( maxPoint = maxPoint ) } - + @GetMapping("/students/{student-id}") fun getStudentDetails(@PathVariable("student-id") @NotNull studentId: UUID?): GetStudentDetailsResponse { return queryStudentDetailsUseCase.execute(studentId!!) @@ -100,4 +100,4 @@ class ManagerWebAdapter( fun myPage(): ManagerMyPageResponse { return managerMyPageUseCase.execute() } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/request/Password.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/request/Password.kt index 441bcbede..6c8ac998f 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/request/Password.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/request/Password.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.manager.dto.request object Password { const val PATTERN = "(?=.*[a-z])(?=.*[0-9])(?=.*[!#\$%&'()*+,./:;<=>?@\^_`{|}~])[a-zA-Z0-9!#\$%&'()*+,./:;<=>?@\^_`{|}~]{8,20}\$" const val MESSAGE = "영문, 숫자, 기호를 포함한 8~20자이어야 합니다." -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/response/FindManagerAccountIdResponse.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/response/FindManagerAccountIdResponse.kt index 389a64b33..bfb2bb3a3 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/response/FindManagerAccountIdResponse.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/manager/dto/response/FindManagerAccountIdResponse.kt @@ -1,5 +1,5 @@ package team.aliens.dms.domain.manager.dto.response -data class FindManagerAccountIdResponse ( +data class FindManagerAccountIdResponse( val email: String -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/meal/MealWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/meal/MealWebAdapter.kt index b19f112ee..f85e127f4 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/meal/MealWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/meal/MealWebAdapter.kt @@ -1,5 +1,7 @@ package team.aliens.dms.domain.meal +import org.springframework.format.annotation.DateTimeFormat +import org.springframework.validation.annotation.Validated import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.RequestMapping @@ -8,8 +10,6 @@ import team.aliens.dms.domain.meal.dto.QueryMealsResponse import team.aliens.dms.domain.meal.usecase.QueryMealsUseCase import java.time.LocalDate import javax.validation.constraints.NotNull -import org.springframework.format.annotation.DateTimeFormat -import org.springframework.validation.annotation.Validated @Validated @RequestMapping("/meals") @@ -22,4 +22,4 @@ class MealWebAdapter( fun getMeals(@PathVariable("date") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) @NotNull mealDate: LocalDate?): QueryMealsResponse { return queryMealsUseCase.execute(mealDate!!) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/NoticeWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/NoticeWebAdapter.kt index 0eca57d97..4b8fe103e 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/NoticeWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/NoticeWebAdapter.kt @@ -13,22 +13,22 @@ import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import team.aliens.dms.domain.notice.dto.QueryAllNoticesResponse +import team.aliens.dms.domain.notice.dto.QueryNoticeDetailsResponse +import team.aliens.dms.domain.notice.dto.request.CreateNoticeWebRequest +import team.aliens.dms.domain.notice.dto.request.UpdateNoticeWebRequest import team.aliens.dms.domain.notice.dto.request.WebOrderType +import team.aliens.dms.domain.notice.dto.response.CreateNoticeResponse import team.aliens.dms.domain.notice.dto.response.GetNoticeStatusResponse -import team.aliens.dms.domain.notice.dto.QueryNoticeDetailsResponse +import team.aliens.dms.domain.notice.dto.response.UpdateNoticeResponse import team.aliens.dms.domain.notice.usecase.CreateNoticeUseCase import team.aliens.dms.domain.notice.usecase.QueryAllNoticesUseCase import team.aliens.dms.domain.notice.usecase.QueryNoticeDetailsUseCase import team.aliens.dms.domain.notice.usecase.QueryNoticeStatusUseCase import team.aliens.dms.domain.notice.usecase.RemoveNoticeUseCase import team.aliens.dms.domain.notice.usecase.UpdateNoticeUseCase -import team.aliens.dms.domain.notice.dto.request.UpdateNoticeWebRequest -import team.aliens.dms.domain.notice.dto.request.CreateNoticeWebRequest import java.util.UUID import javax.validation.Valid import javax.validation.constraints.NotNull -import team.aliens.dms.domain.notice.dto.response.CreateNoticeResponse -import team.aliens.dms.domain.notice.dto.response.UpdateNoticeResponse @Validated @RequestMapping("/notices") diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/CreateNoticeWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/CreateNoticeWebRequest.kt index 28f110d48..c73402196 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/CreateNoticeWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/CreateNoticeWebRequest.kt @@ -13,4 +13,4 @@ data class CreateNoticeWebRequest( @field:Size(max = 1000) val content: String? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/UpdateNoticeWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/UpdateNoticeWebRequest.kt index 467cba234..6922f2b80 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/UpdateNoticeWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/UpdateNoticeWebRequest.kt @@ -1,6 +1,5 @@ package team.aliens.dms.domain.notice.dto.request -import org.hibernate.validator.constraints.Length import javax.validation.constraints.NotBlank import javax.validation.constraints.Size diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/WebOrderType.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/WebOrderType.kt index 0f0e87c39..9bedada4b 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/WebOrderType.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/request/WebOrderType.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.notice.dto.request enum class WebOrderType { NEW, OLD -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/CreateNoticeResponse.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/CreateNoticeResponse.kt index 06d164ebc..76b901c27 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/CreateNoticeResponse.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/CreateNoticeResponse.kt @@ -4,4 +4,4 @@ import java.util.UUID data class CreateNoticeResponse( val noticeId: UUID -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/UpdateNoticeResponse.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/UpdateNoticeResponse.kt index 4846626c1..70e663558 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/UpdateNoticeResponse.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/notice/dto/response/UpdateNoticeResponse.kt @@ -4,4 +4,4 @@ import java.util.UUID data class UpdateNoticeResponse( val noticeId: UUID -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/PointWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/PointWebAdapter.kt index a48d2f625..89c888f3d 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/PointWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/PointWebAdapter.kt @@ -7,6 +7,7 @@ import org.springframework.validation.annotation.Validated import org.springframework.web.bind.annotation.DeleteMapping import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.ModelAttribute +import org.springframework.web.bind.annotation.PatchMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.PutMapping @@ -27,6 +28,7 @@ import team.aliens.dms.domain.point.dto.QueryPointOptionsResponse import team.aliens.dms.domain.point.dto.QueryStudentPointHistoryResponse import team.aliens.dms.domain.point.dto.request.CreatePointOptionWebRequest import team.aliens.dms.domain.point.dto.request.GrantPointWebRequest +import team.aliens.dms.domain.point.dto.request.UpdatePointOptionWebRequest import team.aliens.dms.domain.point.usecase.CancelGrantedPointUseCase import team.aliens.dms.domain.point.usecase.CreatePointOptionUseCase import team.aliens.dms.domain.point.usecase.ExportAllPointHistoryUseCase @@ -36,15 +38,13 @@ import team.aliens.dms.domain.point.usecase.QueryPointHistoryUseCase import team.aliens.dms.domain.point.usecase.QueryPointOptionsUseCase import team.aliens.dms.domain.point.usecase.QueryStudentPointHistoryUseCase import team.aliens.dms.domain.point.usecase.RemovePointOptionUseCase +import team.aliens.dms.domain.point.usecase.UpdatePointOptionUseCase import java.net.URLEncoder import java.time.LocalDateTime import java.util.UUID import javax.servlet.http.HttpServletResponse import javax.validation.Valid import javax.validation.constraints.NotNull -import org.springframework.web.bind.annotation.PatchMapping -import team.aliens.dms.domain.point.dto.request.UpdatePointOptionWebRequest -import team.aliens.dms.domain.point.usecase.UpdatePointOptionUseCase @Validated @RequestMapping("/points") @@ -155,4 +155,4 @@ class PointWebAdapter( ): QueryStudentPointHistoryResponse { return queryStudentPointHistoryUseCase.execute(studentId!!, pageData) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/dto/request/WebPointType.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/dto/request/WebPointType.kt index b7369e668..aaefde34b 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/dto/request/WebPointType.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/point/dto/request/WebPointType.kt @@ -3,4 +3,4 @@ package team.aliens.dms.domain.point.dto.request enum class WebPointType { BONUS, MINUS -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/RemainWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/RemainWebAdapter.kt index cf1675956..d0e020ab5 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/RemainWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/RemainWebAdapter.kt @@ -3,8 +3,8 @@ package team.aliens.dms.domain.remain import org.springframework.http.HttpHeaders import org.springframework.http.HttpStatus import org.springframework.validation.annotation.Validated -import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.DeleteMapping +import org.springframework.web.bind.annotation.GetMapping import org.springframework.web.bind.annotation.PatchMapping import org.springframework.web.bind.annotation.PathVariable import org.springframework.web.bind.annotation.PostMapping @@ -14,8 +14,8 @@ import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import team.aliens.dms.domain.remain.dto.QueryCurrentAppliedRemainOptionResponse -import team.aliens.dms.domain.remain.dto.QueryRemainOptionsResponse import team.aliens.dms.domain.remain.dto.QueryRemainAvailableTimeResponse +import team.aliens.dms.domain.remain.dto.QueryRemainOptionsResponse import team.aliens.dms.domain.remain.dto.UpdateRemainAvailableTimeRequest import team.aliens.dms.domain.remain.dto.request.CreateRemainOptionWebRequest import team.aliens.dms.domain.remain.dto.request.UpdateRemainAvailableTimeWebRequest @@ -23,10 +23,10 @@ import team.aliens.dms.domain.remain.dto.request.UpdateRemainOptionWebRequest import team.aliens.dms.domain.remain.dto.response.CreateRemainOptionResponse import team.aliens.dms.domain.remain.usecase.ApplyRemainUseCase import team.aliens.dms.domain.remain.usecase.CreateRemainOptionUseCase -import team.aliens.dms.domain.remain.usecase.QueryCurrentAppliedRemainOptionUseCase -import team.aliens.dms.domain.remain.usecase.QueryRemainOptionsUseCase import team.aliens.dms.domain.remain.usecase.ExportRemainStatusUseCase +import team.aliens.dms.domain.remain.usecase.QueryCurrentAppliedRemainOptionUseCase import team.aliens.dms.domain.remain.usecase.QueryRemainAvailableTimeUseCase +import team.aliens.dms.domain.remain.usecase.QueryRemainOptionsUseCase import team.aliens.dms.domain.remain.usecase.RemoveRemainOptionUseCase import team.aliens.dms.domain.remain.usecase.UpdateRemainAvailableTimeUseCase import team.aliens.dms.domain.remain.usecase.UpdateRemainOptionUseCase @@ -82,18 +82,18 @@ class RemainWebAdapter( @GetMapping("/my") fun getCurrentAppliedRemainOption(): QueryCurrentAppliedRemainOptionResponse { return queryCurrentAppliedRemainOptionUseCase.execute() - } - + } + @GetMapping("/options") fun getRemainOptions(): QueryRemainOptionsResponse { return queryRemainOptionsUseCase.execute() } - + @GetMapping("/available-time") fun getRemainAvailableTime(): QueryRemainAvailableTimeResponse { return queryRemainAvailableTimeUseCase.execute() } - + @ResponseStatus(HttpStatus.NO_CONTENT) @DeleteMapping("/options/{remain-option-id}") fun removeRemainOption(@PathVariable("remain-option-id") @NotNull remainOptionId: UUID?) { @@ -109,8 +109,8 @@ class RemainWebAdapter( endDayOfWeek = request.endDayOfWeek!!, endTime = request.endTime!! ) - ) - } + ) + } @GetMapping("/status/file") fun exportRemainStatus( @@ -123,4 +123,4 @@ class RemainWebAdapter( ) return response.file } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/CreateRemainOptionWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/CreateRemainOptionWebRequest.kt index 529f61a97..3d43cb0e9 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/CreateRemainOptionWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/CreateRemainOptionWebRequest.kt @@ -13,4 +13,4 @@ data class CreateRemainOptionWebRequest( @field:Size(max = 255) val description: String? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainAvailableTimeWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainAvailableTimeWebRequest.kt index d13fdf09a..08e08aa79 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainAvailableTimeWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainAvailableTimeWebRequest.kt @@ -18,4 +18,4 @@ data class UpdateRemainAvailableTimeWebRequest( @field:NotNull val endTime: LocalTime? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainOptionWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainOptionWebRequest.kt index b937c4874..83d021d9e 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainOptionWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/request/UpdateRemainOptionWebRequest.kt @@ -12,4 +12,4 @@ data class UpdateRemainOptionWebRequest( @field:NotBlank @field:Size(max = 255) val description: String? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/CreateRemainOptionResponse.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/CreateRemainOptionResponse.kt index 88145c75e..ec32a7904 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/CreateRemainOptionResponse.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/remain/dto/response/CreateRemainOptionResponse.kt @@ -4,4 +4,4 @@ import java.util.UUID data class CreateRemainOptionResponse( val remainOptionId: UUID -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/school/SchoolWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/school/SchoolWebAdapter.kt index 0995a9863..81ea544a5 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/school/SchoolWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/school/SchoolWebAdapter.kt @@ -12,16 +12,16 @@ import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import team.aliens.dms.domain.school.dto.SchoolsResponse import team.aliens.dms.domain.school.dto.UpdateQuestionRequest +import team.aliens.dms.domain.school.dto.request.UpdateQuestionWebRequest +import team.aliens.dms.domain.school.dto.response.ReissueSchoolCodeResponse +import team.aliens.dms.domain.school.dto.response.SchoolIdResponse +import team.aliens.dms.domain.school.dto.response.SchoolQuestionResponse import team.aliens.dms.domain.school.usecase.CheckSchoolAnswerUseCase import team.aliens.dms.domain.school.usecase.CheckSchoolCodeUseCase import team.aliens.dms.domain.school.usecase.QuerySchoolQuestionUseCase import team.aliens.dms.domain.school.usecase.QuerySchoolsUseCase -import team.aliens.dms.domain.school.usecase.UpdateQuestionUseCase -import team.aliens.dms.domain.school.dto.request.UpdateQuestionWebRequest import team.aliens.dms.domain.school.usecase.ReissueSchoolCodeUseCase -import team.aliens.dms.domain.school.dto.response.ReissueSchoolCodeResponse -import team.aliens.dms.domain.school.dto.response.SchoolIdResponse -import team.aliens.dms.domain.school.dto.response.SchoolQuestionResponse +import team.aliens.dms.domain.school.usecase.UpdateQuestionUseCase import java.util.UUID import javax.validation.Valid import javax.validation.constraints.NotBlank @@ -89,4 +89,4 @@ class SchoolWebAdapter( updateQuestionUseCase.execute(request) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/StudentWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/StudentWebAdapter.kt index 9e2a4c2a3..a2840caa6 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/StudentWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/StudentWebAdapter.kt @@ -152,4 +152,3 @@ class StudentWebAdapter( studentWithdrawalUseCase.execute() } } - diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/dto/request/SignUpWebRequest.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/dto/request/SignUpWebRequest.kt index 279e831c1..2e78b8e81 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/dto/request/SignUpWebRequest.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/student/dto/request/SignUpWebRequest.kt @@ -56,4 +56,4 @@ data class SignUpWebRequest( @field:Size(max = 500) val profileImageUrl: String? -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/StudyRoomWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/StudyRoomWebAdapter.kt index c34ea43c2..46d22c7a4 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/StudyRoomWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/StudyRoomWebAdapter.kt @@ -1,49 +1,49 @@ package team.aliens.dms.domain.studyroom -import java.util.UUID import org.springframework.http.HttpStatus +import org.springframework.validation.annotation.Validated +import org.springframework.web.bind.annotation.DeleteMapping import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.PatchMapping +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping import org.springframework.web.bind.annotation.PutMapping import org.springframework.web.bind.annotation.RequestBody import org.springframework.web.bind.annotation.RequestMapping import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController -import team.aliens.dms.domain.studyroom.dto.QuerySeatTypesResponse -import team.aliens.dms.domain.studyroom.dto.QueryAvailableTimeResponse -import team.aliens.dms.domain.studyroom.dto.UpdateAvailableTimeWebRequest -import team.aliens.dms.domain.studyroom.usecase.QuerySeatTypesUseCase -import javax.validation.Valid -import javax.validation.constraints.NotNull -import org.springframework.validation.annotation.Validated -import org.springframework.web.bind.annotation.DeleteMapping -import org.springframework.web.bind.annotation.PatchMapping -import org.springframework.web.bind.annotation.PathVariable -import org.springframework.web.bind.annotation.PostMapping import team.aliens.dms.domain.studyroom.dto.CreateSeatTypeWebRequest import team.aliens.dms.domain.studyroom.dto.CreateStudyRoomRequest import team.aliens.dms.domain.studyroom.dto.CreateStudyRoomResponse import team.aliens.dms.domain.studyroom.dto.CreateStudyRoomWebRequest import team.aliens.dms.domain.studyroom.dto.ManagerQueryStudyRoomResponse import team.aliens.dms.domain.studyroom.dto.ManagerQueryStudyRoomsResponse +import team.aliens.dms.domain.studyroom.dto.QueryAvailableTimeResponse import team.aliens.dms.domain.studyroom.dto.QueryCurrentAppliedStudyRoomResponse +import team.aliens.dms.domain.studyroom.dto.QuerySeatTypesResponse import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomResponse +import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomsResponse +import team.aliens.dms.domain.studyroom.dto.UpdateAvailableTimeWebRequest import team.aliens.dms.domain.studyroom.dto.UpdateStudyRoomRequest import team.aliens.dms.domain.studyroom.dto.UpdateStudyRoomWebRequest -import team.aliens.dms.domain.studyroom.dto.StudentQueryStudyRoomsResponse import team.aliens.dms.domain.studyroom.usecase.ApplySeatUseCase import team.aliens.dms.domain.studyroom.usecase.CreateSeatTypeUseCase import team.aliens.dms.domain.studyroom.usecase.CreateStudyRoomUseCase import team.aliens.dms.domain.studyroom.usecase.ManagerQueryStudyRoomUseCase import team.aliens.dms.domain.studyroom.usecase.ManagerQueryStudyRoomsUseCase -import team.aliens.dms.domain.studyroom.usecase.UnApplySeatUseCase import team.aliens.dms.domain.studyroom.usecase.QueryAvailableTimeUseCase +import team.aliens.dms.domain.studyroom.usecase.QueryCurrentAppliedStudyRoomUseCase +import team.aliens.dms.domain.studyroom.usecase.QuerySeatTypesUseCase import team.aliens.dms.domain.studyroom.usecase.RemoveSeatTypeUseCase import team.aliens.dms.domain.studyroom.usecase.RemoveStudyRoomUseCase -import team.aliens.dms.domain.studyroom.usecase.QueryCurrentAppliedStudyRoomUseCase import team.aliens.dms.domain.studyroom.usecase.StudentQueryStudyRoomUseCase import team.aliens.dms.domain.studyroom.usecase.StudentQueryStudyRoomsUseCase +import team.aliens.dms.domain.studyroom.usecase.UnApplySeatUseCase import team.aliens.dms.domain.studyroom.usecase.UpdateAvailableTimeUseCase import team.aliens.dms.domain.studyroom.usecase.UpdateStudyRoomUseCase +import java.util.UUID +import javax.validation.Valid +import javax.validation.constraints.NotNull @Validated @RequestMapping("/study-rooms") @@ -208,4 +208,4 @@ class StudyRoomWebAdapter( fun getMyStudyRoom(): QueryCurrentAppliedStudyRoomResponse { return queryCurrentAppliedStudyRoomUseCase.execute() } -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/CreateStudyRoomResponse.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/CreateStudyRoomResponse.kt index 2d0c13f01..6ab6a4701 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/CreateStudyRoomResponse.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/CreateStudyRoomResponse.kt @@ -4,4 +4,4 @@ import java.util.UUID data class CreateStudyRoomResponse( val studyRoomId: UUID -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSeatStatus.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSeatStatus.kt index 93a231a55..cb9bbfff6 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSeatStatus.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSeatStatus.kt @@ -5,4 +5,4 @@ enum class WebSeatStatus { UNAVAILABLE, IN_USE, EMPTY -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSex.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSex.kt index a453f4386..417af39f2 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSex.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/studyroom/dto/WebSex.kt @@ -4,4 +4,4 @@ enum class WebSex { MALE, FEMALE, ALL -} \ No newline at end of file +} diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/template/EmailTemplateWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/template/EmailTemplateWebAdapter.kt index 1c99ea2cc..07e2ff367 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/template/EmailTemplateWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/template/EmailTemplateWebAdapter.kt @@ -39,4 +39,4 @@ class EmailTemplateWebAdapter( data class TemplateRequest( val type: String -) \ No newline at end of file +) diff --git a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/user/UserWebAdapter.kt b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/user/UserWebAdapter.kt index 214a6ffe5..9cf77a6ca 100644 --- a/dms-presentation/src/main/kotlin/team/aliens/dms/domain/user/UserWebAdapter.kt +++ b/dms-presentation/src/main/kotlin/team/aliens/dms/domain/user/UserWebAdapter.kt @@ -10,9 +10,9 @@ import org.springframework.web.bind.annotation.RequestParam import org.springframework.web.bind.annotation.ResponseStatus import org.springframework.web.bind.annotation.RestController import team.aliens.dms.domain.user.dto.UpdateUserPasswordRequest +import team.aliens.dms.domain.user.dto.request.UpdateUserPasswordWebRequest import team.aliens.dms.domain.user.usecase.UpdateUserPasswordUseCase import team.aliens.dms.domain.user.usecase.UserPasswordCompareUseCase -import team.aliens.dms.domain.user.dto.request.UpdateUserPasswordWebRequest import javax.validation.Valid import javax.validation.constraints.NotBlank @@ -39,4 +39,4 @@ class UserWebAdapter( updateUserPasswordUseCase.execute(request) } -} \ No newline at end of file +} diff --git a/dms-presentation/src/test/kotlin/team/aliens/dms/DmsBackendApplicationTests.kt b/dms-presentation/src/test/kotlin/team/aliens/dms/DmsBackendApplicationTests.kt index e043ed66a..a9e495353 100644 --- a/dms-presentation/src/test/kotlin/team/aliens/dms/DmsBackendApplicationTests.kt +++ b/dms-presentation/src/test/kotlin/team/aliens/dms/DmsBackendApplicationTests.kt @@ -7,5 +7,4 @@ class DmsBackendApplicationTests { @Test fun contextLoads() { } - -} \ No newline at end of file +}