Skip to content

Conversation

@oriNuguri25
Copy link
Collaborator

@oriNuguri25 oriNuguri25 commented Sep 12, 2025

작업 내용

문제점 및 어려움

해결 방안

공유 사항

Summary by CodeRabbit

  • New Features

    • Added order cancellation from the order detail view with a dedicated modal, including reason selection and success handling.
    • Updated payment-type orders to show two actions: “주문 취소” and the existing primary action.
    • Orders can now display a CANCELLED status after successful cancellation.
  • Chores

    • Removed a debug log to reduce console noise.

@oriNuguri25 oriNuguri25 merged commit 75df3f2 into main Sep 12, 2025
2 of 3 checks passed
@coderabbitai
Copy link

coderabbitai bot commented Sep 12, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Implements an order cancellation flow: adds OrderCancelModal and triggers from DetailCard, integrates AdminApi.cancelOrder to delete and set status to CANCELLED, and extends OrderStatus type to include CANCELLED. Also removes a debug log from AdminApi’s interceptor.

Changes

Cohort / File(s) Summary
AdminOrders UI
apps/nowait-admin/src/pages/AdminOrders/DetailCard.tsx, apps/nowait-admin/src/pages/AdminOrders/OrderPageModal.tsx
DetailCard adds cancel button, modal state, and handlers; introduces and exports OrderCancelModal with reason selection, calling cancelOrder and propagating success/close callbacks.
Types
apps/nowait-admin/src/types/order.ts
Extends OrderStatus union to include "CANCELLED".
Admin API
apps/nowait-admin/src/utils/AdminApi.tsx
Adds exported cancelOrder(orderId, reason): DELETE /admin/orders/{id} with reason, then PATCH status to CANCELLED; removes a console debug log.

Sequence Diagram(s)

sequenceDiagram
  actor Admin as Admin User
  participant Detail as DetailCard
  participant Modal as OrderCancelModal
  participant API as AdminApi
  participant BE as Backend

  Admin->>Detail: Click "주문 취소"
  Detail->>Modal: Open with { orderId, onClose, onSuccess }
  Modal->>Admin: Prompt reason selection
  Admin->>Modal: Submit reason
  Modal->>API: cancelOrder(orderId, reason)
  API->>BE: DELETE /admin/orders/{id} { reason }
  BE-->>API: 200 OK
  API->>BE: PATCH /admin/orders/status/{id} { orderStatus: "CANCELLED" }
  BE-->>API: 200 OK
  API-->>Modal: { success: true }
  Modal->>Detail: onSuccess()
  Modal->>Detail: onClose()
  Detail->>Admin: Close detail view
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • refactor: type 수정 #459 — Modifies the same OrderStatus type (adds/removes "CANCELLED"), likely conflicting with this change.
  • refactor: 에러 수정 #443 — Changes in DetailCard.tsx modal-related props; overlaps with this PR’s new cancel modal handling.
  • Develop #454 — Adjusts modal success handling in DetailCard.tsx; intersects with new cancellation flow logic.

Suggested reviewers

  • hwangdae

Poem

I tap my paw to cancel with care,
Two buttons blink in admin air. 🐇
A reason picked, a status turned,
The order’s journey gracefully adjourned.
Logs grow quiet, flows align—
Hop hop hooray, shipping time! ✨

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1465195 and 10495a1.

📒 Files selected for processing (4)
  • apps/nowait-admin/src/pages/AdminOrders/DetailCard.tsx (4 hunks)
  • apps/nowait-admin/src/pages/AdminOrders/OrderPageModal.tsx (2 hunks)
  • apps/nowait-admin/src/types/order.ts (1 hunks)
  • apps/nowait-admin/src/utils/AdminApi.tsx (1 hunks)
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch develop

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.

@github-actions github-actions bot requested a review from hwangdae September 12, 2025 11:06
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