-
Notifications
You must be signed in to change notification settings - Fork 0
feat: 스케줄 자동 생성 관련 API 추가 #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a19f1f2
feat: 고정 근무 스케줄 조회 API 구현
juny0955 cdaf76d
feat: 근무 스케줄 자동 생성 날짜 조회 추가
juny0955 621573e
feat: 근무 스케줄 자동 생성 날짜 변경 API
juny0955 f4cafc9
refactor: primitive 타입 @NotNull 제거
juny0955 546930a
refactor: Bean Resource 이름 추가
juny0955 8a9439b
refactor: 동일 쿼리 통합
juny0955 2906be2
fix: 권한 검증 오류 수정
juny0955 510d247
fix: 근무 스케줄 자동 생성 날짜 변경 검증 추가
juny0955 e5fff41
refactor: 의존방향 수정
juny0955 5652aaa
refactor: 미사용 import 제거
juny0955 03e340f
refactor: 파라미터 수정
juny0955 ced88d0
refactor: Bean 네이밍 수정
juny0955 41664db
refactor: 파라미터 네이밍 수정
juny0955 380ffc9
fix: 권한 검증 로직 수정
juny0955 5b34202
fix: 검증 조건 반전 수정
juny0955 0a03527
fix: record -> class 변경
juny0955 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
.../dreamteam/alter/adapter/inbound/manager/schedule/dto/FixedWorkerScheduleResponseDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| package com.dreamteam.alter.adapter.inbound.manager.schedule.dto; | ||
|
|
||
| import java.time.DayOfWeek; | ||
| import java.time.LocalTime; | ||
|
|
||
| import com.dreamteam.alter.domain.workspace.entity.WorkspaceWorkerSchedule; | ||
| import com.dreamteam.alter.domain.workspace.type.WorkspaceWorkerScheduleStatus; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import lombok.AccessLevel; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
| @AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
| @Schema(description = "고정 근무 스케줄 응답") | ||
| public class FixedWorkerScheduleResponseDto { | ||
| @Schema(description = "고정 스케줄 ID", example = "1") | ||
| private Long id; | ||
|
|
||
| @Schema(description = "업장 근무자 ID", example = "10") | ||
| private Long workspaceWorkerId; | ||
|
|
||
| @Schema(description = "시작 요일", example = "MONDAY") | ||
| private DayOfWeek startDayOfWeek; | ||
|
|
||
| @Schema(description = "시작 시간", example = "09:00:00") | ||
| private LocalTime startTime; | ||
|
|
||
| @Schema(description = "종료 요일", example = "MONDAY") | ||
| private DayOfWeek endDayOfWeek; | ||
|
|
||
| @Schema(description = "종료 시간", example = "18:00:00") | ||
| private LocalTime endTime; | ||
|
|
||
| @Schema(description = "스케줄 상태", example = "ACTIVATED") | ||
| private WorkspaceWorkerScheduleStatus status; | ||
|
|
||
| public static FixedWorkerScheduleResponseDto of(WorkspaceWorkerSchedule s) { | ||
| return new FixedWorkerScheduleResponseDto( | ||
| s.getId(), | ||
| s.getWorkspaceWorker().getId(), | ||
| s.getStartDayOfWeek(), | ||
| s.getStartTime(), | ||
| s.getEndDayOfWeek(), | ||
| s.getEndTime(), | ||
| s.getStatus() | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...amteam/alter/adapter/inbound/manager/workspace/dto/UpdateFixedScheduleDateRequestDto.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.dreamteam.alter.adapter.inbound.manager.workspace.dto; | ||
|
|
||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.Max; | ||
| import jakarta.validation.constraints.Min; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import lombok.AllArgsConstructor; | ||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
|
|
||
| @Getter | ||
| @NoArgsConstructor | ||
| @AllArgsConstructor | ||
| @Schema(description = "매니저 - 고정근무 생성일 변경 DTO") | ||
| public class UpdateFixedScheduleDateRequestDto { | ||
|
|
||
| @NotNull(message = "시작 요일은 필수입니다") | ||
| @Min(value = 1, message = "1 보다 커야합니다.") | ||
| @Max(value = 31, message = "31 보다 작아야합니다") | ||
| @Schema(description = "변경일", example = "15") | ||
| Integer nextMonthShiftGenDay; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
.../com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| package com.dreamteam.alter.application.workspace.usecase; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| import org.springframework.stereotype.Service; | ||
| import org.springframework.transaction.annotation.Transactional; | ||
|
|
||
| import com.dreamteam.alter.adapter.inbound.manager.schedule.dto.FixedWorkerScheduleResponseDto; | ||
| import com.dreamteam.alter.common.exception.CustomException; | ||
| import com.dreamteam.alter.common.exception.ErrorCode; | ||
| import com.dreamteam.alter.domain.user.context.ManagerActor; | ||
| import com.dreamteam.alter.domain.workspace.port.inbound.ManagerGetFixedWorkerScheduleListUseCase; | ||
| import com.dreamteam.alter.domain.workspace.port.outbound.WorkspaceQueryRepository; | ||
| import com.dreamteam.alter.domain.workspace.port.outbound.WorkspaceWorkerScheduleQueryRepository; | ||
|
|
||
| import lombok.RequiredArgsConstructor; | ||
|
|
||
| @Service("managerGetFixedWorkerScheduleList") | ||
| @RequiredArgsConstructor | ||
| @Transactional(readOnly = true) | ||
| public class ManagerGetFixedWorkerScheduleList implements ManagerGetFixedWorkerScheduleListUseCase { | ||
|
|
||
| private final WorkspaceQueryRepository workspaceQueryRepository; | ||
| private final WorkspaceWorkerScheduleQueryRepository workspaceWorkerScheduleQueryRepository; | ||
|
|
||
| @Override | ||
| public List<FixedWorkerScheduleResponseDto> execute(ManagerActor actor, Long workspaceId) { | ||
| if (!workspaceQueryRepository.existsByIdAndManagerUser(workspaceId, actor.getManagerUser())) | ||
| throw new CustomException(ErrorCode.WORKSPACE_NOT_FOUND); | ||
|
|
||
| return workspaceWorkerScheduleQueryRepository.findAllActivatedWithWorkspaceWorkerByWorkspaceIds(List.of(workspaceId)).stream() | ||
| .map(FixedWorkerScheduleResponseDto::of) | ||
| .toList(); | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.