Skip to content

feat: 스케줄 자동 생성 관련 API 추가#68

Merged
juny0955 merged 16 commits intodevfrom
feat/ALT-146
Mar 11, 2026
Merged

feat: 스케줄 자동 생성 관련 API 추가#68
juny0955 merged 16 commits intodevfrom
feat/ALT-146

Conversation

@juny0955
Copy link
Contributor

@juny0955 juny0955 commented Mar 7, 2026

관련 문서

https://www.notion.so/BE-API-31186553162880d28d4cffecb3a78736?source=copy_link

Summary by CodeRabbit

  • 새로운 기능

    • 매니저가 근무자의 고정 스케줄 목록을 조회할 수 있는 API 추가 (스케줄 상세 필드 포함)
    • 매니저가 업장의 다음달 고정 스케줄 생성일을 업데이트할 수 있는 API 추가
    • 업장 상세에 다음달 고정근무 생성일(nextMonthShiftGenDay) 노출
    • 고정 스케줄 응답에 상세 DTO 추가
  • 유효성 검사

    • 고정 스케줄 생성일 입력에 대해 1~31 범위 및 필수 검증 추가

@juny0955 juny0955 requested review from hodoon and ysw789 March 7, 2026 05:17
@juny0955 juny0955 self-assigned this Mar 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

매니저용 고정 근무 스케줄 목록 조회(GET) 및 다음달 고정근무 생성일 업데이트(PATCH) 기능이 추가되고, 관련 DTO/스펙/포트/유스케이스/도메인 및 영속 프로젝션이 확장되었습니다.

Changes

Cohort / File(s) Summary
고정 근무 스케줄 조회 API
src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java, src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleControllerSpec.java, src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/dto/FixedWorkerScheduleResponseDto.java
GET 엔드포인트 getWorkerScheduleList 추가, 스펙(오픈API) 확장, 응답 DTO(FixedWorkerScheduleResponseDto)와 매핑 메서드 추가.
고정 스케줄 조회 Use Case
src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java, src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
포트 인터페이스와 구현체 추가: 매니저 권한 확인 후 워크스페이스의 활성 고정 스케줄 목록 반환.
고정 근무 생성일 업데이트 API
src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java, src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceControllerSpec.java, src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/UpdateFixedScheduleDateRequestDto.java
PATCH 엔드포인트 updateFixedScheduleDate 추가, 요청 DTO(검증 어노테이션 포함) 및 오픈API 스펙 추가.
생성일 업데이트 Use Case
src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java, src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java
포트와 구현체 추가: 워크스페이스 조회, 매니저 권한 검사, Workspace.updateNextMonthShiftGenDay 호출.
도메인·응답 모델 변경
src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java, src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java, src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/readonly/ManagerWorkspaceResponse.java
Workspace에 updateNextMonthShiftGenDay(int) 메서드 추가(1..31 유효성 검사). ManagerWorkspaceResponseDto 및 읽기용 프로젝션에 nextMonthShiftGenDay 필드 추가 및 빌더/프로젝션 반영.
영속 계층 쿼리 변경
src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceQueryRepositoryImpl.java
ManagerWorkspaceResponse 프로젝션 생성자 인자에 qWorkspace.nextMonthShiftGenDay 추가.
서비스 빈 이름 명시화
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java, src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java
기존 서비스 클래스에 명시적 빈 이름(@Service("...")) 지정 변경.

Sequence Diagram(s)

sequenceDiagram
    participant Manager as 매니저
    participant Controller as ManagerFixedWorkerScheduleController
    participant UseCase as ManagerGetFixedWorkerScheduleList
    participant ScheduleRepo as WorkspaceWorkerScheduleQueryRepository
    participant WorkspaceRepo as WorkspaceQueryRepository
    participant DB as Database

    Manager->>Controller: GET /manager/workspaces/{workspaceId}/fixed-schedule
    Controller->>Controller: 현재 ManagerActor 조회
    Controller->>UseCase: execute(actor, workspaceId)
    UseCase->>WorkspaceRepo: 워크스페이스 존재/권한 확인
    WorkspaceRepo->>DB: SELECT workspace...
    DB-->>WorkspaceRepo: row
    WorkspaceRepo-->>UseCase: ManagerWorkspaceResponse
    UseCase->>ScheduleRepo: 활성 고정 스케줄 조회
    ScheduleRepo->>DB: SELECT worker_schedule WHERE workspace_id=?
    DB-->>ScheduleRepo: rows
    ScheduleRepo-->>UseCase: List<WorkspaceWorkerSchedule>
    UseCase-->>Controller: List<WorkspaceWorkerSchedule>
    Controller->>Controller: DTO 매핑 및 200 OK 반환
Loading
sequenceDiagram
    participant Manager as 매니저
    participant Controller as ManagerWorkspaceController
    participant UseCase as ManagerUpdateFixedScheduleDate
    participant WorkspaceRepo as WorkspaceQueryRepository
    participant Workspace as Workspace Entity
    participant DB as Database

    Manager->>Controller: PATCH /manager/workspaces/{workspaceId}/fixed-schedule
    Controller->>Controller: 요청 바디 검증(`@Valid`)
    Controller->>Controller: 현재 ManagerActor 조회
    Controller->>UseCase: execute(actor, workspaceId, nextMonthShiftGenDay)
    UseCase->>WorkspaceRepo: findById(workspaceId)
    WorkspaceRepo->>DB: SELECT workspace...
    DB-->>WorkspaceRepo: row
    WorkspaceRepo-->>UseCase: Workspace Entity
    UseCase->>Workspace: 매니저 권한 검증
    alt 권한 있음
        UseCase->>Workspace: updateNextMonthShiftGenDay(day)
        Workspace->>Workspace: nextMonthShiftGenDay = day
        WorkspaceRepo->>DB: UPDATE workspace SET next_month_shift_gen_day=?
        DB-->>WorkspaceRepo: OK
        UseCase-->>Controller: 완료
        Controller-->>Manager: 200 OK
    else 권한 없음/미존재
        UseCase-->>Controller: CustomException (4xx)
        Controller-->>Manager: 4xx Error
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

FEAT

Suggested reviewers

  • hodoon
  • ysw789
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목은 '스케줄 자동 생성 관련 API 추가'로, 변경사항의 핵심을 명확하게 요약하고 있습니다. 추가된 여러 API 엔드포인트(근무자 고정 스케줄 목록 조회, 고정 스케줄 생성일 업데이트)와 관련 DTO/UseCase들이 모두 자동 스케줄 생성 기능을 중심으로 구성되어 있으며, 제목이 이를 잘 반영하고 있습니다.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/ALT-146

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java`:
- Line 48: The field managerUpdateFixedScheduleDate of type
ManagerUpdateFixedScheduleDateUseCase is missing the consistent `@Resource`(name =
"...") injection annotation; add `@Resource`(name =
"managerUpdateFixedScheduleDateUseCase") (and import javax.annotation.Resource)
above the private final ManagerUpdateFixedScheduleDateUseCase
managerUpdateFixedScheduleDate declaration so it matches the other use case
injections and preserves the existing injection naming convention.

In
`@src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java`:
- Around line 62-64: The `@NotNull` annotation on the primitive field
nextMonthShiftGenDay in ManagerWorkspaceResponseDto is ineffective; remove the
`@NotNull` from the int nextMonthShiftGenDay declaration or, if you need to
represent nullable values, change the field type to Integer and keep `@NotNull`
only if you then enforce non-null at runtime/validation; update
ManagerWorkspaceResponseDto accordingly (adjust any downstream code or
validation expectations when switching types).

In
`@src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceWorkerScheduleQueryRepositoryImpl.java`:
- Around line 89-105: The single-ID method
findAllActivatedWithWorkspaceWorkerByWorkspaceId duplicates the query logic in
findAllActivatedWithWorkspaceWorkerByWorkspaceIds; refactor by delegating:
implement findAllActivatedWithWorkspaceWorkerByWorkspaceId to call
findAllActivatedWithWorkspaceWorkerByWorkspaceIds(Collections.singletonList(workspaceId))
(or List.of(workspaceId)) and return that result, removing the duplicated
QueryDSL code; ensure you keep the same filtering (qWorkspace.id,
qWorkspaceWorkerSchedule.status, qWorkspaceWorker.status) and return type
List<WorkspaceWorkerSchedule>.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java`:
- Around line 27-36: The permission check in
ManagerUpdateFixedScheduleDate.execute (or its method performing the manager
validation) is inverted: it currently throws when
workspace.getManagerUser().equals(actor.getManagerUser()) allowing others to
modify; change the condition to throw when the manager users are NOT equal
(negate the equals) so only the actual workspace manager can proceed, i.e.,
update the authorization check in ManagerUpdateFixedScheduleDate (the block that
throws CustomException with ErrorCode.FORBIDDEN) to use the correct logical
negation.
- Around line 19-22: The service class ManagerGetFixedWorkerScheduleList is
missing an explicit bean name on its `@Service` annotation; update the annotation
to include a descriptive bean name following our convention (for example
"managerGetFixedWorkerScheduleList") so the class
ManagerGetFixedWorkerScheduleList implements
ManagerGetFixedWorkerScheduleListUseCase is registered with that explicit name;
ensure the chosen string matches the naming pattern used for other services in
the codebase.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java`:
- Around line 16-19: The `@Service` on ManagerUpdateFixedScheduleDate lacks an
explicit bean name; to match other use-cases and allow `@Resource`(name="...")
injection, add a named service value (e.g.
`@Service`("managerUpdateFixedScheduleDate")) to the
ManagerUpdateFixedScheduleDate class so its bean name is consistent with the
pattern used by other use-case beans and the controller that expects named
injection of ManagerUpdateFixedScheduleDateUseCase.
- Around line 28-30: The authorization check in ManagerUpdateFixedScheduleDate
is inverted: currently it throws when
workspace.getManagerUser().equals(actor.getManagerUser()), but it should throw
when they do NOT match. Fix the condition in the access control block inside
ManagerUpdateFixedScheduleDate to throw new CustomException(ErrorCode.FORBIDDEN,
"관리 중인 업장이 아닙니다.") when
!workspace.getManagerUser().equals(actor.getManagerUser()) (or replace with the
same existsByIdAndManagerUser-style check used in
ManagerGetFixedWorkerScheduleList) so only the actual manager is allowed to
proceed.

In `@src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java`:
- Around line 113-115: The method Workspace.updateNextMonthShiftGenDay currently
assigns the incoming day directly to nextMonthShiftGenDay; add validation to
enforce the domain invariant (1–31) before assignment, and throw an
IllegalArgumentException with a clear message if the value is out of range;
update the method to check the int parameter (day) against 1 and 31, reject
invalid values, and only then set this.nextMonthShiftGenDay = day so the
Workspace entity preserves its business rules.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java`:
- Around line 5-9: The domain port ManagerGetFixedWorkerScheduleListUseCase
currently depends on the adapter DTO FixedWorkerScheduleResponseDto; change the
interface signature of execute(ManagerActor actor, Long workspaceId) to return a
domain-only type (e.g., List<FixedWorkerSchedule> or a new domain response
interface like FixedWorkerScheduleProjection) instead of
FixedWorkerScheduleResponseDto, remove the import of
FixedWorkerScheduleResponseDto from this file, and ensure any mapping from the
domain type to FixedWorkerScheduleResponseDto happens in the adapter/controller
layer where the DTO lives.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java`:
- Around line 3-7: The interface ManagerUpdateFixedScheduleDateUseCase currently
imports the adapter DTO UpdateFixedScheduleDateRequestDto, violating hexagonal
boundaries; replace that dependency by changing the execute signature on
ManagerUpdateFixedScheduleDateUseCase to accept a domain-safe type (either a
primitive like int nextMonthShiftGenDay or a new domain command class e.g.,
ManagerUpdateFixedScheduleDateCommand defined in the domain package) and remove
the import of UpdateFixedScheduleDateRequestDto; then update all implementations
and inbound adapters to map their adapter DTO
(UpdateFixedScheduleDateRequestDto) into the new primitive or the new domain
command before calling
ManagerUpdateFixedScheduleDateUseCase.execute(ManagerActor, Long, ...).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a49ecb84-ba95-491b-9400-586ae470e65b

📥 Commits

Reviewing files that changed from the base of the PR and between c22975e and 621573e.

📒 Files selected for processing (16)
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/dto/FixedWorkerScheduleResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/UpdateFixedScheduleDateRequestDto.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceQueryRepositoryImpl.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceWorkerScheduleQueryRepositoryImpl.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/readonly/ManagerWorkspaceResponse.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java
  • src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/outbound/WorkspaceWorkerScheduleQueryRepository.java

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java (1)

29-33: ⚠️ Potential issue | 🔴 Critical

대상 스케줄의 업장 소속 검증이 없습니다.

Line 29-33은 “이 매니저가 어떤 업장을 하나 관리하는지”와 “이 스케줄 ID가 존재하는지”만 각각 확인합니다. 그래서 다른 업장에 속한 workerScheduleId도 수정할 수 있습니다. 조회 단계에서 workerScheduleIdworkspaceId에 속하는지 함께 검증해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java`
around lines 29 - 33, Add validation that the fetched WorkspaceWorkerSchedule
actually belongs to the given workspaceId: after calling
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker(workerScheduleId)
(or by using a repository method that fetches by both workerScheduleId and
workspaceId), check the schedule's workspace id (e.g.,
workspaceWorkerSchedule.getWorkspace().getId()) against workspaceId and throw a
CustomException(ErrorCode.WORKSPACE_NOT_FOUND) (or ErrorCode.NOT_FOUND with an
appropriate message) when they don’t match so managers cannot modify schedules
from other workspaces.
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java (1)

35-39: ⚠️ Potential issue | 🔴 Critical

workspaceWorkerId 소속 업장 검증이 빠져 있습니다.

Line 35-39 조합으로는 매니저가 자신이 관리하는 아무 workspaceId만 통과시키고, 다른 업장의 workspaceWorkerId로도 고정 스케줄을 생성할 수 있습니다. WorkspaceWorker 조회를 workspaceId까지 포함해서 제한하거나, 조회 후 해당 근무자가 요청한 업장 소속인지 명시적으로 검증해야 합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java`
around lines 35 - 39, The code allows creating a schedule for a WorkspaceWorker
that may belong to a different workspace because the WorkspaceWorker lookup
lacks workspace scoping; update the lookup to enforce workspace ownership by
either using a repository method that includes workspaceId (e.g., change
workspaceWorkerQueryRepository.findById(...) to
findByIdAndWorkspaceId(request.getWorkspaceWorkerId(), workspaceId)) or after
fetching the WorkspaceWorker (variable workspaceWorker) explicitly validate
workspaceWorker.getWorkspace().getId() (or workspaceWorker.getWorkspaceId())
equals workspaceId and throw the same CustomException (ErrorCode.NOT_FOUND, "해당
업장에 근무하는 사용자가 아닙니다.") on mismatch. Ensure the check replaces or supplements the
existing existsByIdAndManagerUser check in ManagerCreateFixedWorkerSchedule so
only workers of the manager's workspace can be scheduled.
♻️ Duplicate comments (1)
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java (1)

28-30: ⚠️ Potential issue | 🔴 Critical

권한 검증 조건이 반대로 되어 있습니다.

Line 28-30은 실제 담당 매니저일 때 FORBIDDEN을 던지고, 다른 매니저는 그대로 통과시킵니다. 부정이 빠졌습니다.

🐛 수정 제안
-		if (workspace.getManagerUser().equals(actor.getManagerUser())) {
+		if (!workspace.getManagerUser().equals(actor.getManagerUser())) {
 			throw new CustomException(ErrorCode.FORBIDDEN, "관리 중인 업장이 아닙니다.");
 		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java`
around lines 28 - 30, The permission check in ManagerUpdateFixedScheduleDate is
inverted: currently it throws FORBIDDEN when
workspace.getManagerUser().equals(actor.getManagerUser()), which is backwards.
Change the condition to throw when the actor is NOT the manager (e.g., use
negation of equals or reverse the comparison) so that if
(!workspace.getManagerUser().equals(actor.getManagerUser())) then throw new
CustomException(ErrorCode.FORBIDDEN, "관리 중인 업장이 아닙니다."); ensuring the
Authorization logic in this class/method correctly blocks non-managers.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java`:
- Around line 35-39: The code allows creating a schedule for a WorkspaceWorker
that may belong to a different workspace because the WorkspaceWorker lookup
lacks workspace scoping; update the lookup to enforce workspace ownership by
either using a repository method that includes workspaceId (e.g., change
workspaceWorkerQueryRepository.findById(...) to
findByIdAndWorkspaceId(request.getWorkspaceWorkerId(), workspaceId)) or after
fetching the WorkspaceWorker (variable workspaceWorker) explicitly validate
workspaceWorker.getWorkspace().getId() (or workspaceWorker.getWorkspaceId())
equals workspaceId and throw the same CustomException (ErrorCode.NOT_FOUND, "해당
업장에 근무하는 사용자가 아닙니다.") on mismatch. Ensure the check replaces or supplements the
existing existsByIdAndManagerUser check in ManagerCreateFixedWorkerSchedule so
only workers of the manager's workspace can be scheduled.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java`:
- Around line 29-33: Add validation that the fetched WorkspaceWorkerSchedule
actually belongs to the given workspaceId: after calling
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker(workerScheduleId)
(or by using a repository method that fetches by both workerScheduleId and
workspaceId), check the schedule's workspace id (e.g.,
workspaceWorkerSchedule.getWorkspace().getId()) against workspaceId and throw a
CustomException(ErrorCode.WORKSPACE_NOT_FOUND) (or ErrorCode.NOT_FOUND with an
appropriate message) when they don’t match so managers cannot modify schedules
from other workspaces.

---

Duplicate comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java`:
- Around line 28-30: The permission check in ManagerUpdateFixedScheduleDate is
inverted: currently it throws FORBIDDEN when
workspace.getManagerUser().equals(actor.getManagerUser()), which is backwards.
Change the condition to throw when the actor is NOT the manager (e.g., use
negation of equals or reverse the comparison) so that if
(!workspace.getManagerUser().equals(actor.getManagerUser())) then throw new
CustomException(ErrorCode.FORBIDDEN, "관리 중인 업장이 아닙니다."); ensuring the
Authorization logic in this class/method correctly blocks non-managers.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: d5b3cf1b-28c1-4c6a-8671-62bba009c6e4

📥 Commits

Reviewing files that changed from the base of the PR and between 621573e and 546930a.

📒 Files selected for processing (7)
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java (1)

3-11: 🧹 Nitpick | 🔵 Trivial

도메인 레이어 인프라 의존성 존재 (기존 이슈)

코딩 가이드라인에 따르면 도메인 레이어는 "ZERO infrastructure dependencies (no Spring, no JPA annotations, no external libs)"를 준수해야 합니다. 현재 파일에는 JPA(jakarta.persistence.*), Spring Data(org.springframework.data.*), Lombok 등의 인프라 의존성이 존재합니다.

이 PR에서 추가된 CustomException/ErrorCode 임포트는 애플리케이션 레벨의 공통 예외 처리로서 외부 프레임워크 의존성은 아니지만, 순수 도메인 관점에서는 도메인 전용 예외 타입이 더 적합할 수 있습니다.

단, 기존 JPA 어노테이션 사용은 이 PR에서 도입된 것이 아니므로, 아키텍처 리팩토링 시 별도로 검토하시기 바랍니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java`
around lines 3 - 11, The Workspace domain class currently depends on
infrastructure libraries (jakarta.persistence.*, org.springframework.data.*,
lombok) which violates the zero-infrastructure rule; remove all JPA/Spring Data
and Lombok annotations/imports from the Workspace domain class (references:
class Workspace, ManagerUser, WorkspaceStatus) and make it a plain POJO
(explicit fields, constructors, getters/setters) in the domain module; instead
create a separate persistence mapping (e.g., WorkspaceEntity) in the
infrastructure/persistence layer that contains
`@Entity/`@Table/@Id/@GeneratedValue/@CreatedDate/@LastModifiedDate/@EntityListeners
and maps to/from the domain Workspace; also replace or wrap application-level
CustomException/ErrorCode usage with a domain-specific exception type if needed
(or keep but move handling to application layer) so the domain package no longer
imports JPA/Spring Data/Lombok.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java`:
- Around line 3-11: The Workspace domain class currently depends on
infrastructure libraries (jakarta.persistence.*, org.springframework.data.*,
lombok) which violates the zero-infrastructure rule; remove all JPA/Spring Data
and Lombok annotations/imports from the Workspace domain class (references:
class Workspace, ManagerUser, WorkspaceStatus) and make it a plain POJO
(explicit fields, constructors, getters/setters) in the domain module; instead
create a separate persistence mapping (e.g., WorkspaceEntity) in the
infrastructure/persistence layer that contains
`@Entity/`@Table/@Id/@GeneratedValue/@CreatedDate/@LastModifiedDate/@EntityListeners
and maps to/from the domain Workspace; also replace or wrap application-level
CustomException/ErrorCode usage with a domain-specific exception type if needed
(or keep but move handling to application layer) so the domain package no longer
imports JPA/Spring Data/Lombok.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 7b0b1aeb-7f88-4bca-a675-f4129e98e376

📥 Commits

Reviewing files that changed from the base of the PR and between 2906be2 and 510d247.

📒 Files selected for processing (1)
  • src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java

@juny0955
Copy link
Contributor Author

juny0955 commented Mar 7, 2026

@coderabbitai 재리뷰해봐

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

@juny0955 네, PR #68에 대해 다시 리뷰하겠습니다!

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java`:
- Line 8: The import of adapter DTO FixedWorkerScheduleResponseDto in
ManagerGetFixedWorkerScheduleList.java is unused and creates an infrastructure
dependency; remove the import and any references to adapter-layer DTOs from this
use case class, and instead use an application-layer DTO or domain model (create
or reference a ManagerFixedWorkerScheduleResponse or domain object) and perform
mapping inside the adapter layer (or a mapper like FixedWorkerScheduleMapper) so
the application use case does not depend on
com.dreamteam.alter.adapter.inbound.*.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java`:
- Line 5: Remove the unused adapter DTO import FixedWorkerScheduleResponseDto
from the ManagerGetFixedWorkerScheduleListUseCase interface and any lingering
references to adapter-layer types in that file; ensure the interface only
exposes domain types (e.g., List<WorkspaceWorkerSchedule>) and does not import
or depend on adapter DTOs so the domain layer has zero infrastructure/adapter
dependencies.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 91dd1a7b-b6d5-4624-936c-afcd0b4abe60

📥 Commits

Reviewing files that changed from the base of the PR and between 510d247 and e5fff41.

📒 Files selected for processing (3)
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (3)
src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java (1)

1-8: ⚠️ Potential issue | 🟠 Major

도메인 레이어에서 어댑터 DTO를 import하고 있습니다 (아키텍처 위반)

이전 리뷰에서도 지적된 문제입니다. domain.workspace.port.inbound 패키지의 인터페이스가 adapter.inbound 패키지의 UpdateFixedScheduleDateRequestDto를 import하고 있어 헥사고날 아키텍처의 의존성 방향이 역전되었습니다.

도메인 레이어는 어댑터 레이어에 대한 의존성이 없어야 합니다.

🛠️ 수정 제안: 원시 타입 사용
 package com.dreamteam.alter.domain.workspace.port.inbound;
 
-import com.dreamteam.alter.adapter.inbound.manager.workspace.dto.UpdateFixedScheduleDateRequestDto;
 import com.dreamteam.alter.domain.user.context.ManagerActor;
 
 public interface ManagerUpdateFixedScheduleDateUseCase {
-	void execute(ManagerActor actor, Long workspaceId, UpdateFixedScheduleDateRequestDto request);
+	void execute(ManagerActor actor, Long workspaceId, int nextMonthShiftGenDay);
 }

컨트롤러에서 DTO의 값을 추출하여 use case에 전달하면 됩니다:

useCase.execute(actor, workspaceId, request.nextMonthShiftGenDay());

As per coding guidelines: "domain/** - ZERO infrastructure dependencies", "Port interfaces are clean contracts with no implementation details."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java`
around lines 1 - 8, The interface ManagerUpdateFixedScheduleDateUseCase in
domain.workspace.port.inbound incorrectly imports the adapter DTO
UpdateFixedScheduleDateRequestDto; remove that dependency so the domain port
takes primitive/POJO params instead (e.g., replace the DTO parameter in execute
with the raw value(s) like the nextMonthShiftGenDay) and update callers
(controller/adapters) to extract values from UpdateFixedScheduleDateRequestDto
and pass them into ManagerUpdateFixedScheduleDateUseCase.execute(ManagerActor
actor, Long workspaceId, /*raw params*/); keep ManagerActor and the execute
method signature in the domain layer free of adapter types.
src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java (1)

5-5: ⚠️ Potential issue | 🟡 Minor

도메인 포트에 어댑터 DTO import가 아직 남아 있습니다.

현재 시그니처에서는 전혀 쓰이지 않는데도 domain -> adapter 컴파일 의존성이 생깁니다. 이 import는 제거하는 편이 맞습니다.

🔧 정리 제안
-import com.dreamteam.alter.adapter.inbound.manager.schedule.dto.FixedWorkerScheduleResponseDto;

As per coding guidelines, "ZERO infrastructure dependencies (no Spring, no JPA annotations, no external libs)." and "Port interfaces (inbound/outbound) are clean contracts with no implementation details."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java`
at line 5, Remove the adapter DTO import FixedWorkerScheduleResponseDto from the
domain port ManagerGetFixedWorkerScheduleListUseCase and ensure the port
interface does not reference any adapter-level types; delete the unused import
line and, if a return/type is needed, replace any occurrences with a
domain-level type or a clean contract type declared in the domain port (i.e.,
use domain DTO/class or an interface defined in the domain package rather than
FixedWorkerScheduleResponseDto).
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java (1)

8-8: ⚠️ Potential issue | 🟡 Minor

애플리케이션 레이어에 어댑터 DTO import가 남아 있습니다.

이 클래스는 도메인 엔티티를 반환하므로 FixedWorkerScheduleResponseDto import는 불필요하고, 그대로 두면 application 계층이 adapter 패키지에 의존하게 됩니다.

🔧 정리 제안
-import com.dreamteam.alter.adapter.inbound.manager.schedule.dto.FixedWorkerScheduleResponseDto;

As per coding guidelines, "No direct infrastructure dependencies (no Spring Data, no HTTP clients)."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java`
at line 8, The import of adapter DTO FixedWorkerScheduleResponseDto in
ManagerGetFixedWorkerScheduleList creates an infrastructure dependency in the
application layer; remove the FixedWorkerScheduleResponseDto import and any
references to that DTO inside ManagerGetFixedWorkerScheduleList, and make the
method(s) return and work with the appropriate domain entity or
application-level DTO instead (update method signatures/return types and mapping
logic within ManagerGetFixedWorkerScheduleList to use the domain model rather
than FixedWorkerScheduleResponseDto).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java`:
- Around line 6-12: The ManagerUpdateFixedScheduleDate application use case
currently depends on the adapter DTO UpdateFixedScheduleDateRequestDto; change
the boundary so the use case (class ManagerUpdateFixedScheduleDate and its
execute/update method) accepts a primitive/int or a dedicated command object
(e.g., Integer nextMonthShiftGenDay or UpdateFixedScheduleDateCommand) instead
of the DTO, and update callers (controller/inbound adapter) to extract
request.nextMonthShiftGenDay() and pass that value; remove direct imports/usages
of UpdateFixedScheduleDateRequestDto from this class (and related lines 24-32)
so the application layer no longer depends on inbound adapter types.

---

Duplicate comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java`:
- Line 8: The import of adapter DTO FixedWorkerScheduleResponseDto in
ManagerGetFixedWorkerScheduleList creates an infrastructure dependency in the
application layer; remove the FixedWorkerScheduleResponseDto import and any
references to that DTO inside ManagerGetFixedWorkerScheduleList, and make the
method(s) return and work with the appropriate domain entity or
application-level DTO instead (update method signatures/return types and mapping
logic within ManagerGetFixedWorkerScheduleList to use the domain model rather
than FixedWorkerScheduleResponseDto).

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java`:
- Line 5: Remove the adapter DTO import FixedWorkerScheduleResponseDto from the
domain port ManagerGetFixedWorkerScheduleListUseCase and ensure the port
interface does not reference any adapter-level types; delete the unused import
line and, if a return/type is needed, replace any occurrences with a
domain-level type or a clean contract type declared in the domain port (i.e.,
use domain DTO/class or an interface defined in the domain package rather than
FixedWorkerScheduleResponseDto).

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java`:
- Around line 1-8: The interface ManagerUpdateFixedScheduleDateUseCase in
domain.workspace.port.inbound incorrectly imports the adapter DTO
UpdateFixedScheduleDateRequestDto; remove that dependency so the domain port
takes primitive/POJO params instead (e.g., replace the DTO parameter in execute
with the raw value(s) like the nextMonthShiftGenDay) and update callers
(controller/adapters) to extract values from UpdateFixedScheduleDateRequestDto
and pass them into ManagerUpdateFixedScheduleDateUseCase.execute(ManagerActor
actor, Long workspaceId, /*raw params*/); keep ManagerActor and the execute
method signature in the domain layer free of adapter types.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b4844547-502f-4f35-92ba-8b1e93bb58dd

📥 Commits

Reviewing files that changed from the base of the PR and between c22975e and e5fff41.

📒 Files selected for processing (16)
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/dto/FixedWorkerScheduleResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/UpdateFixedScheduleDateRequestDto.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceQueryRepositoryImpl.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/readonly/ManagerWorkspaceResponse.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java
  • src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java

@juny0955
Copy link
Contributor Author

juny0955 commented Mar 7, 2026

@coderabbitai 재리뷰 해봐

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

@juny0955 네, PR #68에 대해 다시 전체 리뷰를 진행하겠습니다! 잠시만 기다려 주세요.

✅ Actions performed

Full review triggered.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java (1)

29-33: ⚠️ Potential issue | 🔴 Critical

스케줄 조회를 workspaceId 범위로 제한해야 합니다.

여기서는 actor가 관리하는 아무 workspaceId만 통과하면, 실제 수정 대상 workerScheduleId는 전역 조회로 가져와 바로 업데이트합니다. 그래서 다른 업장의 workerScheduleId를 알고 있으면 이 경로로 수정할 수 있습니다. workerScheduleId + workspaceId로 함께 조회하거나, 조회 후 해당 스케줄이 정말 workspaceId에 속하는지 검증이 필요합니다.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java`
around lines 29 - 33, The code currently checks workspace ownership via
workspaceQueryRepository.existsByIdAndManagerUser(workspaceId,
actor.getManagerUser()) but then fetches the schedule by workerScheduleId
globally using
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker(workerScheduleId),
allowing cross-workspace edits; change the lookup to restrict by both
workerScheduleId and workspaceId (e.g. add or use a repository method like
getByIdAndWorkspaceIdWithWorkspaceWorker(workerScheduleId, workspaceId)) or
after getByIdWithWorkspaceWorker validate that the returned
WorkspaceWorkerSchedule.workspace.id equals workspaceId and throw
CustomException(ErrorCode.NOT_FOUND) if it does not; update references to
workerScheduleId, workspaceId,
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker, and
workspaceQueryRepository.existsByIdAndManagerUser accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java`:
- Around line 24-29: Replace the two-step lookup+ownership check in
ManagerUpdateFixedScheduleDate with a single ownership-aware query: call a
repository method that finds by workspaceId and manager (e.g.,
workspaceQueryRepository.findByIdAndManagerUser(...) or
findByIdAndManagerUserId(...)) and .orElseThrow(() -> new
CustomException(ErrorCode.WORKSPACE_NOT_FOUND)); remove the subsequent manager
equals check and the FORBIDDEN branch so missing/unauthorized lookups both
return 404, and update ManagerWorkspaceControllerSpec's 409
documentation/assertion to reflect the new 404 behavior.

In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java`:
- Line 19: The `@Service` bean name "managerUpdateWorkerSchedule" is inconsistent
with the fixed-worker schedule usecase naming and risks miswiring; rename the
bean on the ManagerUpdateFixedWorkerSchedule class to follow the existing
pattern (e.g., "managerUpdateFixedWorkerSchedule") so it matches
ManagerCreateFixedWorkerSchedule and ManagerGetFixedWorkerScheduleList and any
name-based injection or map binding; update the `@Service`(...) value on the
ManagerUpdateFixedWorkerSchedule class accordingly.

In
`@src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java`:
- Around line 5-7: The parameter name int request in the
ManagerUpdateFixedScheduleDateUseCase.execute signature is unclear; rename it to
a meaningful name like nextMonthShiftGenDay or day in the interface
(ManagerUpdateFixedScheduleDateUseCase) and update all implementing classes and
call sites (methods that implement execute(ManagerActor, Long, ...), any usages)
to use the new parameter name so the intent is clear and compilation remains
correct.

---

Outside diff comments:
In
`@src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java`:
- Around line 29-33: The code currently checks workspace ownership via
workspaceQueryRepository.existsByIdAndManagerUser(workspaceId,
actor.getManagerUser()) but then fetches the schedule by workerScheduleId
globally using
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker(workerScheduleId),
allowing cross-workspace edits; change the lookup to restrict by both
workerScheduleId and workspaceId (e.g. add or use a repository method like
getByIdAndWorkspaceIdWithWorkspaceWorker(workerScheduleId, workspaceId)) or
after getByIdWithWorkspaceWorker validate that the returned
WorkspaceWorkerSchedule.workspace.id equals workspaceId and throw
CustomException(ErrorCode.NOT_FOUND) if it does not; update references to
workerScheduleId, workspaceId,
workspaceWorkerScheduleQueryRepository.getByIdWithWorkspaceWorker, and
workspaceQueryRepository.existsByIdAndManagerUser accordingly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4ecbba4b-43b9-4851-85d7-878bc63c9526

📥 Commits

Reviewing files that changed from the base of the PR and between c22975e and 03e340f.

📒 Files selected for processing (16)
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/controller/ManagerFixedWorkerScheduleControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/schedule/dto/FixedWorkerScheduleResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceController.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/controller/ManagerWorkspaceControllerSpec.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/ManagerWorkspaceResponseDto.java
  • src/main/java/com/dreamteam/alter/adapter/inbound/manager/workspace/dto/UpdateFixedScheduleDateRequestDto.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/WorkspaceQueryRepositoryImpl.java
  • src/main/java/com/dreamteam/alter/adapter/outbound/workspace/persistence/readonly/ManagerWorkspaceResponse.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerCreateFixedWorkerSchedule.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerGetFixedWorkerScheduleList.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedScheduleDate.java
  • src/main/java/com/dreamteam/alter/application/workspace/usecase/ManagerUpdateFixedWorkerSchedule.java
  • src/main/java/com/dreamteam/alter/domain/workspace/entity/Workspace.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerGetFixedWorkerScheduleListUseCase.java
  • src/main/java/com/dreamteam/alter/domain/workspace/port/inbound/ManagerUpdateFixedScheduleDateUseCase.java

@juny0955
Copy link
Contributor Author

juny0955 commented Mar 7, 2026

@coderabbitai 재리뷰

@alter-app alter-app deleted a comment from coderabbitai bot Mar 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

@juny0955 네, PR #68에 대해 다시 전체 리뷰를 진행하겠습니다! 잠시만 기다려 주세요.

✅ Actions performed

Full review triggered.

@juny0955 juny0955 added the FEAT label Mar 9, 2026
기타 컨벤션 포함
swagger 설명 추가
@juny0955 juny0955 merged commit b7d561a into dev Mar 11, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants