Skip to content

[feat] 고정 스케줄 관리 페이지 API 연동#34

Open
limtjdghks wants to merge 9 commits into
devfrom
feat/ALT-219
Open

[feat] 고정 스케줄 관리 페이지 API 연동#34
limtjdghks wants to merge 9 commits into
devfrom
feat/ALT-219

Conversation

@limtjdghks
Copy link
Copy Markdown
Member

@limtjdghks limtjdghks commented May 16, 2026

ID

  • ALT-219

변경 내용

  • 고정 스케줄 등록, 수정, 삭제 API 로직 구현
  • Query, Mutation 구현

구현 사항

  • 고정 스케줄 관련 API 로직을 구현하였습니다
  • features/worker-schedule/api/에 고정 근무 api를 추가하였습니다
  • features/worker-schedule/hooks/에 고정 근무 query와 mutation 로직을 작성하였습니다

참고 사항 (필요 시)

  • 현재 브랜치에 API 로직만 구현되어있습니다
  • 디자인 수정사항은 반영되어있지 않습니다!!!
  • 사장님 스케줄 관리 페이지에서 디자인 수정 이후에 해당 API 로직을 추가하여야 합니다

Summary by CodeRabbit

  • 새 기능

    • 고정 근무 일정 조회/생성/수정/삭제 API 및 관련 관리 훅/쿼리 추가
    • 근무자 스케줄 관리용 UI 컴포넌트 대거 추가(캘린더, 날짜/시간 입력, 반복/요일 선택, 색상 선택 등)
  • 개선

    • 근무자 목록 페이지당 표시 수 20→50 증가
    • 근무자 색상 코드 필드 추가로 색상 선택 지원
    • 근무 시간 관련 반환 구조를 workTime 객체로 정리
    • 스케줄 페이지 로딩에 중앙 스피너 표시 및 UI 분리로 사용성 향상

Review Change Stack

@limtjdghks limtjdghks requested review from dohy-eon and kim3360 May 16, 2026 13:51
@limtjdghks limtjdghks self-assigned this May 16, 2026
@vercel
Copy link
Copy Markdown

vercel Bot commented May 16, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
alter-client Ready Ready Preview, Comment May 17, 2026 11:33am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 16, 2026

📝 Walkthrough

Walkthrough

고정 작업자 일정 CRUD API·타입을 추가하고 React Query 쿼리/뮤테이션 훅, 워커 DTO 확장, 뷰모델 반환 구조(workTime) 리팩토링 및 페이지·컴포넌트 분리, 그리고 홈 훅들의 API 임포트 경로를 상위로 중앙화했습니다.

Changes

고정 작업자 일정 기능 통합

Layer / File(s) Summary
기존 API 임포트 경로 중앙화
src/features/manager/home/hooks/*
여러 홈 훅의 API import 경로를 @/features/manager/home/api/*@/features/manager/api/*로 변경했습니다 (훅 로직 불변).
고정 일정 API 및 타입
src/features/manager/worker-schedule/api/fixedWorkerSchdules.ts, src/features/manager/worker-schedule/types/fixedWorkerSchdules.ts, src/features/manager/index.ts
fixed-worker-schedules CRUD 엔드포인트를 axios로 구현하고 관련 요청/응답 타입을 정의한 뒤 관리자 barrel에 재내보냈습니다.
쿼리 키 추가
src/shared/lib/queryKeys.ts
queryKeys.fixedWorkerSchedule.list(workspaceId) 키 네임스페이스를 추가했습니다.
조회 훅
src/features/manager/worker-schedule/hooks/query/*
useFixedWorkerSchedulesuseWorkspaceWorkers 훅을 추가/재내보내며 workspaceId 기반 enabled 제어와 PAGE_SIZE(50)를 적용했습니다.
뮤테이션 훅
src/features/manager/worker-schedule/hooks/mutation/*
create/update/delete 뮤테이션 훅을 추가하고, 성공 시 queryKeys.fixedWorkerSchedule.list(workspaceId)를 invalidate하도록 구성했습니다.
워커 DTO·페이지 크기
src/features/manager/home/types/worker.ts, src/features/manager/home/hooks/useWorkspaceWorkersViewModel.ts
WorkerDtocolorCode: string 추가 및 워커 조회 PAGE_SIZE를 20→50으로 변경했습니다.
뷰모델 리팩토링
src/features/manager/worker-schedule/hooks/useWorkerScheduleManageViewModel.ts
근무 시간 관련 반환을 workTime 중첩 객체로 묶어 반환하도록 변경했습니다(외부 시그니처 유지).
페이지·컴포넌트 분리
src/pages/manager/worker-schedule/*, src/shared/ui/schedule/ManagerMonthCalendar.tsx
ManagerWorkerSchedule 페이지에서 시간/날짜/색상/워커 선택 UI를 여러 하위 컴포넌트로 분리하고 캘린더, 시간 포맷·입력 유틸을 구현했습니다.

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목이 주요 변경 사항을 명확히 반영하고 있습니다. 고정 스케줄 관리 페이지의 API 연동이라는 핵심 목표가 간결하게 표현되었습니다.
Description check ✅ Passed PR 설명이 필수 섹션(ID, 변경 내용, 구현 사항)을 포함하고 있으며, 핵심 구현 내용과 중요한 참고 사항이 명시되어 있습니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/ALT-219

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown

@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: 4

🧹 Nitpick comments (2)
src/features/manager/worker-schedule/api/fixedWorkerSchdule.ts (1)

2-8: ⚡ Quick win

내부 구현에서 feature 배럴(@/features/manager) 의존을 제거해주세요.

Line 2-8은 feature 내부 모듈이 상위 feature 배럴에 의존하고 있어 계층 경계를 깨고 결합도를 높입니다. 이 파일은 로컬 타입 모듈(worker-schedule/types/...)을 직접 import하도록 바꾸는 게 안전합니다.

As per coding guidelines src/features/**: "entities, shared 레이어만 import하는지".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/manager/worker-schedule/api/fixedWorkerSchdule.ts` around lines
2 - 8, The import block at the top pulls several types from the feature barrel
'`@/features/manager`' (ResponseGetFixedWorkerSchdules,
RequestPostFixedWorkerSchdules, ResponsePostFixedWorkerSchdules,
ResponseDeleteFixedWorkerSchdules, RequestPatchFixedWorkerSchdules); replace
that barrel import by importing each type directly from the local
worker-schedule type modules (e.g. the module(s) under worker-schedule/types or
equivalent local path within this feature) so the file no longer depends on the
upper-level feature barrel and instead references the concrete type files used
by fixedWorkerSchdule.ts.
src/features/manager/worker-schedule/hooks/query/useWorkspaceWorkers.ts (1)

2-4: ⚡ Quick win

worker-schedule 훅이 다른 feature(home) 타입에 직접 의존하고 있습니다.

Line 2-4는 worker-schedulehome 타입까지 참조해 feature 경계가 섞입니다. 공통 DTO를 entities/shared(또는 worker-schedule 로컬 타입)로 이동하고, 해당 경로만 참조하도록 정리하는 걸 권장합니다.

As per coding guidelines src/features/**: "entities, shared 레이어만 import하는지".

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/features/manager/worker-schedule/hooks/query/useWorkspaceWorkers.ts`
around lines 2 - 4, The useWorkspaceWorkers hook imports the WorkersApiResponse
type from the home feature which violates feature boundaries; update imports so
worker-schedule no longer depends on home by moving the shared DTO
(WorkersApiResponse) into a common layer (entities or shared) or by creating a
local equivalent type in the worker-schedule feature, then change the import
used in useWorkspaceWorkers (alongside existing imports like
fetchWorkspaceWorkers and queryKeys) to reference the new shared/entities
location (or local type) and remove the direct import from the home feature.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/features/manager/worker-schedule/hooks/useWorkerScheduleManageViewModel.ts`:
- Line 4: The hook useWorkerScheduleManageViewModel imports StoreWorkerRole
directly from the home feature causing a feature-layer coupling; instead move or
re-export the type to a shared/public API and update the import: either (a)
relocate StoreWorkerRole into a common place (entities or shared) and import
from there, or (b) re-export StoreWorkerRole from the home feature's index.ts
(Public API) and change the import in useWorkerScheduleManageViewModel to
reference that public API; update any import paths to the new module and run
type checks to ensure no other direct cross-feature imports remain.
- Around line 47-58: The effect reading selectedWorkerColorCode currently only
sets selectedColor when a mapping is found, leaving previous color when
selectedWorker has no colorCode or map fails; update the useEffect for
selectedWorkerColorCode so it explicitly clears selectedColor (e.g. call
setSelectedColor(undefined or null)) when selectedWorkerColorCode is falsy or
when Object.entries(ScheduleColor).find(...) returns no match, ensuring
selectedColor does not persist across workers; modify the useEffect that
references selectedWorkerColorCode, ScheduleColor, and setSelectedColor
accordingly.

In `@src/pages/manager/worker-schedule/index.tsx`:
- Line 3: The page imports the hook useWorkerScheduleManageViewModel directly
from a feature internal path; update the import to use the feature's public API
instead (re-exported from src/features/manager or the feature's index.ts) so the
page references the public entrypoint (e.g., import {
useWorkerScheduleManageViewModel } from '`@/features/manager`')—modify the import
statement in src/pages/manager/worker-schedule/index.tsx to point at the
feature's public API export rather than the internal path.
- Around line 147-150: 현재 workers.map((w, index) => (...) 내부 button에
key={index}를 사용하고 있어 재사용 버그가 발생할 수 있습니다; workers 배열의 각 항목에 있는 고유 식별자(id)를 사용하도록
key를 변경하세요 (참조: workers, w, index, button, key prop) — 즉 map 콜백에서 w.id를 key로
사용하도록 수정하여 순서 변경/필터링 시 React가 안정적으로 요소를 식별하게 만드세요.

---

Nitpick comments:
In `@src/features/manager/worker-schedule/api/fixedWorkerSchdule.ts`:
- Around line 2-8: The import block at the top pulls several types from the
feature barrel '`@/features/manager`' (ResponseGetFixedWorkerSchdules,
RequestPostFixedWorkerSchdules, ResponsePostFixedWorkerSchdules,
ResponseDeleteFixedWorkerSchdules, RequestPatchFixedWorkerSchdules); replace
that barrel import by importing each type directly from the local
worker-schedule type modules (e.g. the module(s) under worker-schedule/types or
equivalent local path within this feature) so the file no longer depends on the
upper-level feature barrel and instead references the concrete type files used
by fixedWorkerSchdule.ts.

In `@src/features/manager/worker-schedule/hooks/query/useWorkspaceWorkers.ts`:
- Around line 2-4: The useWorkspaceWorkers hook imports the WorkersApiResponse
type from the home feature which violates feature boundaries; update imports so
worker-schedule no longer depends on home by moving the shared DTO
(WorkersApiResponse) into a common layer (entities or shared) or by creating a
local equivalent type in the worker-schedule feature, then change the import
used in useWorkspaceWorkers (alongside existing imports like
fetchWorkspaceWorkers and queryKeys) to reference the new shared/entities
location (or local type) and remove the direct import from the home feature.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0ac4805b-c8bd-4bcf-a25a-ff06e9c24cc7

📥 Commits

Reviewing files that changed from the base of the PR and between 4f7367e and 3cf141d.

📒 Files selected for processing (27)
  • src/features/manager/api/posting.ts
  • src/features/manager/api/schedule.ts
  • src/features/manager/api/substitute.ts
  • src/features/manager/api/worker.ts
  • src/features/manager/api/workspace.ts
  • src/features/manager/home/hooks/useManagedPostingsViewModel.ts
  • src/features/manager/home/hooks/useManagedWorkspacesQuery.ts
  • src/features/manager/home/hooks/useMonthlySchedulesViewModel.ts
  • src/features/manager/home/hooks/useSubstituteRequestsViewModel.ts
  • src/features/manager/home/hooks/useTodaySchedulesViewModel.ts
  • src/features/manager/home/hooks/useWorkerScheduleManageViewModel.ts
  • src/features/manager/home/hooks/useWorkspaceDetailQuery.ts
  • src/features/manager/home/hooks/useWorkspaceWorkersViewModel.ts
  • src/features/manager/home/types/worker.ts
  • src/features/manager/index.ts
  • src/features/manager/worker-schedule/api/fixedWorkerSchdule.ts
  • src/features/manager/worker-schedule/hooks/mutation/index.ts
  • src/features/manager/worker-schedule/hooks/mutation/useCreateFixedWorkerSchedule.ts
  • src/features/manager/worker-schedule/hooks/mutation/useDeleteFixedWorkerSchedule.ts
  • src/features/manager/worker-schedule/hooks/mutation/useUpdateFixedWorkerSchedule.ts
  • src/features/manager/worker-schedule/hooks/query/index.ts
  • src/features/manager/worker-schedule/hooks/query/useFixedWorkerSchedules.ts
  • src/features/manager/worker-schedule/hooks/query/useWorkspaceWorkers.ts
  • src/features/manager/worker-schedule/hooks/useWorkerScheduleManageViewModel.ts
  • src/features/manager/worker-schedule/types/fixedWorkerSchdules.ts
  • src/pages/manager/worker-schedule/index.tsx
  • src/shared/lib/queryKeys.ts
💤 Files with no reviewable changes (1)
  • src/features/manager/home/hooks/useWorkerScheduleManageViewModel.ts

Comment thread src/features/manager/worker-schedule/hooks/useWorkerScheduleManageViewModel.ts Outdated
Comment thread src/features/manager/worker-schedule/hooks/useWorkerScheduleManageViewModel.ts Outdated
Comment thread src/pages/manager/worker-schedule/index.tsx Outdated
Comment thread src/pages/manager/worker-schedule/index.tsx Outdated
Copy link
Copy Markdown

@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

🧹 Nitpick comments (1)
src/pages/manager/worker-schedule/components/ScheduleSaveButton.tsx (1)

15-15: ⚡ Quick win

배경색 하드코딩 대신 디자인 토큰 클래스로 교체해주세요.

bg-[#07c079]처럼 TSX에 직접 색상 리터럴을 두면 테마/디자인 일관성 관리가 어려워집니다. Tailwind 설정의 토큰 클래스로 치환하는 편이 안전합니다.

Based on learnings: In the alter-client repository, avoid hardcoding colors in TSX files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/manager/worker-schedule/components/ScheduleSaveButton.tsx` at line
15, The component currently hardcodes a hex background color in
ScheduleSaveButton.tsx via the className "bg-[`#07c079`]"; replace that literal
with the project's Tailwind design-token class (e.g., the established
success/primary token such as bg-success-500 or the project's equivalent token
class used elsewhere) so theming is consistent. Update the className on the
ScheduleSaveButton component (where "className='h-12 w-full rounded-2xl
bg-[`#07c079`] typography-body01-semibold text-white disabled:opacity-50'"
appears) to use the token class and run a quick grep in the repo for similar
buttons to ensure you pick the canonical token name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/pages/manager/worker-schedule/components/ScheduleDateRow.tsx`:
- Around line 1-4: The TypeScript error occurs because the code uses
React.ChangeEvent<HTMLInputElement> without importing React's type definitions;
fix by importing the event type and updating the annotation: add "import type {
ChangeEvent } from 'react'" at the top of ScheduleDateRow.tsx and replace
occurrences of "React.ChangeEvent<HTMLInputElement>" with
"ChangeEvent<HTMLInputElement>" (or alternatively import the React namespace
with "import React from 'react'" if you prefer keeping the React.ChangeEvent
form).

In `@src/pages/manager/worker-schedule/index.tsx`:
- Around line 78-87: Currently the conditional combines workersLoading and
!worker causing a permanent Spinner when loading finishes but worker is absent;
change the branching so that if (workersLoading) returns the Spinner UI (using
Spinner and Navbar as now), and add a separate branch for when (!worker) to
render a “not found” / error state or redirect (e.g. show a message or navigate
away) instead of the spinner; update the component around the existing
workersLoading, worker checks to implement these two distinct paths.

---

Nitpick comments:
In `@src/pages/manager/worker-schedule/components/ScheduleSaveButton.tsx`:
- Line 15: The component currently hardcodes a hex background color in
ScheduleSaveButton.tsx via the className "bg-[`#07c079`]"; replace that literal
with the project's Tailwind design-token class (e.g., the established
success/primary token such as bg-success-500 or the project's equivalent token
class used elsewhere) so theming is consistent. Update the className on the
ScheduleSaveButton component (where "className='h-12 w-full rounded-2xl
bg-[`#07c079`] typography-body01-semibold text-white disabled:opacity-50'"
appears) to use the token class and run a quick grep in the repo for similar
buttons to ensure you pick the canonical token name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 99f124b6-e4b4-4527-9fa3-02381273b588

📥 Commits

Reviewing files that changed from the base of the PR and between c2e4208 and 02e6524.

📒 Files selected for processing (16)
  • src/pages/manager/worker-schedule/components/CollapsibleScheduleSection.tsx
  • src/pages/manager/worker-schedule/components/ColorSelectSection.tsx
  • src/pages/manager/worker-schedule/components/FixedScheduleDateSection.tsx
  • src/pages/manager/worker-schedule/components/GeneralScheduleDateSection.tsx
  • src/pages/manager/worker-schedule/components/RecurrenceSelect.tsx
  • src/pages/manager/worker-schedule/components/ScheduleDateRow.tsx
  • src/pages/manager/worker-schedule/components/ScheduleSaveButton.tsx
  • src/pages/manager/worker-schedule/components/ScheduleTabBar.tsx
  • src/pages/manager/worker-schedule/components/WeekdayPicker.tsx
  • src/pages/manager/worker-schedule/components/WorkTimeRangeField.tsx
  • src/pages/manager/worker-schedule/components/WorkerSelectSection.tsx
  • src/pages/manager/worker-schedule/index.tsx
  • src/pages/manager/worker-schedule/lib/formatKoreanWorkTime.ts
  • src/pages/manager/worker-schedule/lib/scheduleDateParts.ts
  • src/pages/manager/worker-schedule/types/workTime.ts
  • src/shared/ui/schedule/ManagerMonthCalendar.tsx
✅ Files skipped from review due to trivial changes (1)
  • src/pages/manager/worker-schedule/types/workTime.ts

Comment on lines +1 to +4
import {
buildDateFromParts,
dateToPartStrings,
} from '@/pages/manager/worker-schedule/lib/scheduleDateParts'
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 목적: React namespace 타입 사용 파일 중 react import 누락 가능성 확인 (read-only)
python - <<'PY'
from pathlib import Path
import re

for p in Path(".").rglob("*.tsx"):
    text = p.read_text(encoding="utf-8")
    if "React." not in text:
        continue
    has_react_import = re.search(r"from\s+['\"]react['\"]", text) is not None
    if not has_react_import:
        print(p)
PY

Repository: alter-app/alter-client

Length of output: 154


🏁 Script executed:

cat -n src/pages/manager/worker-schedule/components/ScheduleDateRow.tsx

Repository: alter-app/alter-client

Length of output: 3521


🏁 Script executed:

# Check TypeScript/React configuration
find . -maxdepth 2 -name "tsconfig*.json" -o -name "next.config.*" | head -5 | xargs -I {} cat {}

Repository: alter-app/alter-client

Length of output: 1682


🏁 Script executed:

# Also check for any JSX pragma or React imports at the top of the file more carefully
head -30 src/pages/manager/worker-schedule/components/ScheduleDateRow.tsx

Repository: alter-app/alter-client

Length of output: 648


React.ChangeEvent 네임스페이스 참조가 없어 TypeScript 컴파일 에러가 발생합니다.

Line 23에서 React.ChangeEvent<HTMLInputElement>를 사용하지만 React 네임스페이스를 import하지 않아 Cannot find namespace 'React' 컴파일 에러가 발생합니다. jsx: "react-jsx"strict: true 설정에서는 JSX 문법만 React import 없이 작동하며, 타입 참조는 별도로 import가 필요합니다.

수정
+import type { ChangeEvent } from 'react'
 import {
   buildDateFromParts,
   dateToPartStrings,
 } from '`@/pages/manager/worker-schedule/lib/scheduleDateParts`'
-  const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+  const handleChange = (e: ChangeEvent<HTMLInputElement>) => {
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/manager/worker-schedule/components/ScheduleDateRow.tsx` around
lines 1 - 4, The TypeScript error occurs because the code uses
React.ChangeEvent<HTMLInputElement> without importing React's type definitions;
fix by importing the event type and updating the annotation: add "import type {
ChangeEvent } from 'react'" at the top of ScheduleDateRow.tsx and replace
occurrences of "React.ChangeEvent<HTMLInputElement>" with
"ChangeEvent<HTMLInputElement>" (or alternatively import the React namespace
with "import React from 'react'" if you prefer keeping the React.ChangeEvent
form).

Comment on lines 78 to 87
if (workersLoading || !worker) {
return (
<div className="flex min-h-[100dvh] flex-col bg-bg-light">
<Navbar variant="detail" title="근무자 스케줄 관리" />
<p className="px-4 pt-8 typography-body01-regular text-text-70">
불러오는 중…
</p>
<div className="flex flex-1 items-center justify-center px-4 pt-8">
<Spinner />
</div>
</div>
)
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

!worker를 로딩으로 함께 처리하면 영구 스피너가 될 수 있습니다.

Line 78에서 workersLoading || !worker를 한 분기로 처리하면, 로딩 종료 후 worker가 비어 있는 케이스(잘못된 ID/조회 실패)에서 계속 Spinner만 노출될 수 있습니다. 로딩 상태와 미존재 상태를 분리해주세요.

🔧 제안 수정안
-  if (workersLoading || !worker) {
+  if (workersLoading) {
     return (
       <div className="flex min-h-[100dvh] flex-col bg-bg-light">
         <Navbar variant="detail" title="근무자 스케줄 관리" />
         <div className="flex flex-1 items-center justify-center px-4 pt-8">
           <Spinner />
         </div>
       </div>
     )
   }
+
+  if (!worker) {
+    return <Navigate to={ROUTES.MANAGER.HOME} replace />
+  }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/pages/manager/worker-schedule/index.tsx` around lines 78 - 87, Currently
the conditional combines workersLoading and !worker causing a permanent Spinner
when loading finishes but worker is absent; change the branching so that if
(workersLoading) returns the Spinner UI (using Spinner and Navbar as now), and
add a separate branch for when (!worker) to render a “not found” / error state
or redirect (e.g. show a message or navigate away) instead of the spinner;
update the component around the existing workersLoading, worker checks to
implement these two distinct paths.

Comment on lines +141 to +145
<ScheduleSaveButton
onClick={() => {
//Todo: 저장 기능 추가
// Todo: 저장 기능 추가
}}
>
저장
</button>
</div>
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

저장 버튼 클릭이 현재 no-op이라 기능이 동작하지 않습니다.

Line 142-144는 TODO만 있고 실제 저장 로직이 없어 사용자의 저장 액션이 유실됩니다. 머지 전 최소한 생성/수정 mutation 연결 또는 임시 비활성화 처리가 필요합니다.

원하시면 현재 상태(activeTab, workTime, 날짜/반복 정보) 기준으로 저장 핸들러 골격과 mutation 연결 코드까지 바로 제안드릴게요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants