Skip to content

[Feat/#55] 사장님 주문 현황 페이지 생성#71

Merged
skyblue1232 merged 3 commits intodevelopfrom
feat/#55/owner-order-page
Mar 27, 2026
Merged

[Feat/#55] 사장님 주문 현황 페이지 생성#71
skyblue1232 merged 3 commits intodevelopfrom
feat/#55/owner-order-page

Conversation

@skyblue1232
Copy link
Copy Markdown
Contributor

@skyblue1232 skyblue1232 commented Mar 27, 2026

✅ 작업 내용

📝 Description

주문 현황 페이지의 예약/주문 탭 UI를 구현하고, 예약 상태에 따른 수락/거절 모달 및 주문 상태 변경 흐름을 반영했습니다.

작업한 내용을 체크해주세요.

  • 주문 현황 페이지 헤더 및 탭 구성
  • 예약/주문 탭별 카드 UI 분리
  • 예약 카드 내 수락/거절 버튼 추가
  • 수락/거절 확인 모달 연동
  • 처리 결과에 따른 거래완료/거래취소 상태 표시 반영

🚀 설계 의도 및 개선점

예약 탭과 주문 탭의 역할이 달라 카드 컴포넌트와 상태 흐름을 분리해 관리했습니다.
수락/거절 액션은 모달을 통해 한 번 더 확인하도록 구성했고, 처리 이후에는 상태 텍스트와 처리 일자가 즉시 반영되도록 설계했습니다.

📸 스크린샷 (선택)

  • 예약 탭 UI
image image

📎 기타 참고사항

  • 목데이터 기반으로 상태 변경 흐름 확인
  • 환경 변수 변경 없음

Fixes #55

Summary by CodeRabbit

  • 새로운 기능
    • 주문 현황 관리 페이지 추가: 예약/주문 탭 네비게이션 및 리스트 제공
    • 예약/주문 카드 UI 추가: 고객정보, 수량/가격, 상태 배지, 처리 시간 표시
    • 대기 중 예약에 대한 수락·거절 모달 및 액션 추가
    • 상태 표시 문자열 및 처리일자 포맷 처리 유틸리티와 초기 샘플 데이터 추가

@skyblue1232 skyblue1232 self-assigned this Mar 27, 2026
@skyblue1232 skyblue1232 added feat 기능 구현 및 생성 style 스타일 관련 적용 labels Mar 27, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

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

Project Deployment Actions Updated (UTC)
compasser-customer Ready Ready Preview, Comment Mar 27, 2026 9:15am
compasser-owner Ready Ready Preview, Comment Mar 27, 2026 9:15am

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 556f7396-a6a5-4289-a1ea-339f8bbe1967

📥 Commits

Reviewing files that changed from the base of the PR and between 7685797 and 7572263.

📒 Files selected for processing (1)
  • apps/owner/src/app/(tabs)/order/page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/owner/src/app/(tabs)/order/page.tsx

📝 Walkthrough

Walkthrough

예약/주문 탭과 관련된 새로운 UI와 로직이 추가되었습니다. 타입 정의, 유틸리티, 모의 데이터, 카드·리스트·모달 컴포넌트, 및 페이지(state 관리·모달 흐름·수락/거절 처리 포함)가 도입되었습니다.

변경 사항

Cohort / File(s) Summary
타입 및 상수
apps/owner/src/app/(tabs)/order/_types/order.ts, apps/owner/src/app/(tabs)/order/_constants/mockOrders.ts
주문 탭의 타입들(OrderTabKey, ReservationStatus, ReservationItem, 모달 상태 타입)과 초기 예약 데이터(INITIAL_RESERVATIONS) 추가
유틸리티
apps/owner/src/app/(tabs)/order/_utils/orderStatus.ts, apps/owner/src/app/(tabs)/order/_utils/formatProcessAt.ts
예약 상태 → 레이블/클래스 매핑 함수와 Date → YY/MM/DD 포맷 유틸 추가
카드 컴포넌트
apps/owner/src/app/(tabs)/order/_components/ReservationCard.tsx, apps/owner/src/app/(tabs)/order/_components/OrderHistoryCard.tsx
예약(수락/거절 버튼 포함) 및 주문 이력 카드 컴포넌트 추가; 상태 기반 표시 및 처리일 표시 처리
리스트 및 모달 컴포넌트
apps/owner/src/app/(tabs)/order/_components/OrderList.tsx, apps/owner/src/app/(tabs)/order/_components/modal/AcceptOrderModal.tsx, apps/owner/src/app/(tabs)/order/_components/modal/RejectOrderModal.tsx
주문 목록 렌더링 및 비어있음 상태 처리, 수락 확인 모달과 거절(사유 입력) 모달 추가
페이지(통합 로직)
apps/owner/src/app/(tabs)/order/page.tsx
탭 UI, 로컬 주문 상태 초기화(INITIAL_RESERVATIONS), 필터링(reservation vs order), 모달 상태 관리, 수락/거절 확인 핸들러(상태 변경 및 processedAt 설정) 구현

시퀀스 다이어그램

sequenceDiagram
    actor User
    participant OrderPage as "OrderStatusPage"
    participant OrderList as "OrderList"
    participant ReservationCard as "ReservationCard"
    participant Modal as "Accept/Reject Modal"
    participant State as "Local Orders State"

    User->>ReservationCard: 수락/거절 버튼 클릭
    ReservationCard->>OrderPage: open accept/reject (orderId)
    OrderPage->>Modal: 모달 열기 (isOpen = true, orderId)
    Modal-->>User: 확인/입력 UI 표시

    alt 수락 흐름
        User->>Modal: "수락하기" 클릭
        Modal->>OrderPage: onConfirm()
        OrderPage->>State: set status = "completed", set processedAt
    else 거절 흐름
        User->>Modal: 사유 입력 후 "거절하기" 클릭
        Modal->>OrderPage: onConfirm(reason)
        OrderPage->>State: set status = "cancelled", set processedAt
    end

    OrderPage->>OrderList: 업데이트된 orders 전달
    OrderList->>ReservationCard: UI 리렌더링 / OrderHistoryCard로 이동 가능
    OrderPage->>Modal: 모달 닫기 (isOpen = false)
Loading

예상 코드 리뷰 노력

🎯 4 (Complex) | ⏱️ ~50 분

🐰
탭을 넘나드는 당근 소식,
수락과 거절, 모달에 담아보내요.
타입과 유틸로 다듬은 길,
주문 카드들 춤추며 정리됐어요. 🥕

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed PR 제목이 주문 현황 페이지 생성이라는 변경사항의 핵심을 명확히 반영하고 있습니다.
Linked Issues check ✅ Passed 모든 연결 이슈 #55의 요구사항이 충족됩니다: 예약/주문 탭 분리, 수락/거절 모달, 상태 변경 흐름, 처리 날짜 기록이 완벽하게 구현되어 있습니다.
Out of Scope Changes check ✅ Passed 모든 변경사항이 #55 이슈 범위 내에 있으며, 주문 현황 페이지 구현과 관련된 컴포넌트와 유틸리티만 포함됩니다.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/#55/owner-order-page

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: 1

🧹 Nitpick comments (3)
apps/owner/src/app/(tabs)/order/_utils/orderStatus.ts (1)

3-27: switch문 대신 객체 맵 패턴 고려

현재 구현도 정상 동작하지만, 두 함수 모두 동일한 상태 값에 대해 매핑하므로 객체 맵 패턴을 사용하면 중복을 줄이고 가독성을 높일 수 있습니다.

♻️ 객체 맵 패턴으로 리팩토링 제안
-export const getStatusLabel = (status: ReservationStatus) => {
-  switch (status) {
-  case "pending":
-    return "확인 대기중";
-  case "completed":
-    return "거래완료";
-  case "cancelled":
-    return "거래취소";
-  default:
-    return "";
-  }
-};
-
-export const getStatusClassName = (status: ReservationStatus) => {
-  switch (status) {
-  case "pending":
-    return "body1-m text-secondary";
-  case "completed":
-    return "body1-m text-primary";
-  case "cancelled":
-    return "body1-m text-gray-500";
-  default:
-    return "";
-  }
-};
+const STATUS_CONFIG: Record<ReservationStatus, { label: string; className: string }> = {
+  pending: { label: "확인 대기중", className: "body1-m text-secondary" },
+  completed: { label: "거래완료", className: "body1-m text-primary" },
+  cancelled: { label: "거래취소", className: "body1-m text-gray-500" },
+};
+
+export const getStatusLabel = (status: ReservationStatus): string =>
+  STATUS_CONFIG[status]?.label ?? "";
+
+export const getStatusClassName = (status: ReservationStatus): string =>
+  STATUS_CONFIG[status]?.className ?? "";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/owner/src/app/`(tabs)/order/_utils/orderStatus.ts around lines 3 - 27,
Replace the repetitive switch statements in getStatusLabel and
getStatusClassName with object maps: create const STATUS_LABEL_MAP and
STATUS_CLASS_MAP keyed by ReservationStatus and return STATUS_LABEL_MAP[status]
?? "" and STATUS_CLASS_MAP[status] ?? "" from the respective functions; keep the
same function names (getStatusLabel, getStatusClassName) and types
(ReservationStatus) so behavior is unchanged while reducing duplication and
improving readability.
apps/owner/src/app/(tabs)/order/_types/order.ts (1)

15-23: 모달 상태 타입은 공통 타입으로 합쳐 중복을 줄여주세요.

동일 구조를 별도 인터페이스로 유지하면 나중에 필드 변경 시 불일치가 생기기 쉽습니다.

♻️ 제안 코드
+ export interface OrderActionModalState {
+   isOpen: boolean;
+   orderId: number | null;
+ }
- export interface AcceptModalState {
-   isOpen: boolean;
-   orderId: number | null;
- }
-
- export interface RejectModalState {
-   isOpen: boolean;
-   orderId: number | null;
- }
+ export type AcceptModalState = OrderActionModalState;
+ export type RejectModalState = OrderActionModalState;
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/owner/src/app/`(tabs)/order/_types/order.ts around lines 15 - 23, The
two identical interfaces AcceptModalState and RejectModalState should be
consolidated into a single shared type (e.g., ModalState or GenericModalState)
to remove duplication; replace both declarations with one interface (with
properties isOpen: boolean and orderId: number | null) and update any usages or
imports that reference AcceptModalState or RejectModalState to use the new
shared type (or create typed aliases if you need semantic names) so future field
changes remain centralized.
apps/owner/src/app/(tabs)/order/page.tsx (1)

44-70: 모달 open/close 핸들러 중복은 공통화해도 좋겠습니다.

accept/reject가 동일한 패턴이라 공통 헬퍼로 묶으면 수정 포인트를 줄일 수 있습니다.

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

In `@apps/owner/src/app/`(tabs)/order/page.tsx around lines 44 - 70, The four
near-identical modal handlers (openAcceptModal, closeAcceptModal,
openRejectModal, closeRejectModal) should be consolidated into a generic modal
helper: replace them with a single openModal(type: "accept" | "reject",
orderId?: number) and closeModal(type: "accept" | "reject") (or a toggleModal
that accepts {type, isOpen, orderId}) and have these call setAcceptModal /
setRejectModal based on the type; update usages to call openModal("accept", id)
/ closeModal("reject") and remove the duplicate functions to reduce maintenance
points.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/owner/src/app/`(tabs)/order/page.tsx:
- Around line 117-124: The current onTabChange handler casts the incoming key to
OrderTabKey unsafely; replace the cast with a type guard that validates the key
before calling setActiveTab. Implement or use a predicate like
isOrderTabKey(key) that checks key against the allowed OrderTabKey values (e.g.,
the items' keys or an OrderTabKey union), then call setActiveTab(key) only when
the predicate returns true and optionally handle invalid keys (ignore or log).
Update the TopTabBar onTabChange handler in page.tsx to perform this check
instead of using "as OrderTabKey", referencing TopTabBar, onTabChange,
OrderTabKey, activeTab, and setActiveTab.

---

Nitpick comments:
In `@apps/owner/src/app/`(tabs)/order/_types/order.ts:
- Around line 15-23: The two identical interfaces AcceptModalState and
RejectModalState should be consolidated into a single shared type (e.g.,
ModalState or GenericModalState) to remove duplication; replace both
declarations with one interface (with properties isOpen: boolean and orderId:
number | null) and update any usages or imports that reference AcceptModalState
or RejectModalState to use the new shared type (or create typed aliases if you
need semantic names) so future field changes remain centralized.

In `@apps/owner/src/app/`(tabs)/order/_utils/orderStatus.ts:
- Around line 3-27: Replace the repetitive switch statements in getStatusLabel
and getStatusClassName with object maps: create const STATUS_LABEL_MAP and
STATUS_CLASS_MAP keyed by ReservationStatus and return STATUS_LABEL_MAP[status]
?? "" and STATUS_CLASS_MAP[status] ?? "" from the respective functions; keep the
same function names (getStatusLabel, getStatusClassName) and types
(ReservationStatus) so behavior is unchanged while reducing duplication and
improving readability.

In `@apps/owner/src/app/`(tabs)/order/page.tsx:
- Around line 44-70: The four near-identical modal handlers (openAcceptModal,
closeAcceptModal, openRejectModal, closeRejectModal) should be consolidated into
a generic modal helper: replace them with a single openModal(type: "accept" |
"reject", orderId?: number) and closeModal(type: "accept" | "reject") (or a
toggleModal that accepts {type, isOpen, orderId}) and have these call
setAcceptModal / setRejectModal based on the type; update usages to call
openModal("accept", id) / closeModal("reject") and remove the duplicate
functions to reduce maintenance points.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 524e33f8-c909-4f4e-b856-d5ebce83f203

📥 Commits

Reviewing files that changed from the base of the PR and between a17e592 and 7685797.

📒 Files selected for processing (10)
  • apps/owner/src/app/(tabs)/order/_components/OrderHistoryCard.tsx
  • apps/owner/src/app/(tabs)/order/_components/OrderList.tsx
  • apps/owner/src/app/(tabs)/order/_components/ReservationCard.tsx
  • apps/owner/src/app/(tabs)/order/_components/modal/AcceptOrderModal.tsx
  • apps/owner/src/app/(tabs)/order/_components/modal/RejectOrderModal.tsx
  • apps/owner/src/app/(tabs)/order/_constants/mockOrders.ts
  • apps/owner/src/app/(tabs)/order/_types/order.ts
  • apps/owner/src/app/(tabs)/order/_utils/formatProcessAt.ts
  • apps/owner/src/app/(tabs)/order/_utils/orderStatus.ts
  • apps/owner/src/app/(tabs)/order/page.tsx

@skyblue1232 skyblue1232 merged commit f26a770 into develop Mar 27, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat 기능 구현 및 생성 style 스타일 관련 적용

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] 사장님 예약/주문 페이지

1 participant