Skip to content

Implement order cancellation endpoint#92

Closed
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-order-cancellation-screen
Closed

Implement order cancellation endpoint#92
Copilot wants to merge 2 commits intodevelopfrom
copilot/add-order-cancellation-screen

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 6, 2026

Adds order cancellation functionality allowing users to cancel orders in ORDER_RECEIVED status with automatic point refunds.

Changes

API

  • DELETE /api/orders/{orderId} - Cancel order with validation and point refund
  • Returns OrderCancelResponse with cancellation details

Data Model

  • Order.usedPoints - Track points used during purchase for refund calculation
  • Order.cancel() - Encapsulates status transition and timestamp setting
  • User.increasePoints() - Handle point refunds

Business Logic

  • Validates order ownership and status (only ORDER_RECEIVED cancellable)
  • Refunds usedPoints to user balance
  • Sets orderStatus = CANCELED and canceledAt timestamp

Error Codes

  • ORDER_ALREADY_CANCELED - Duplicate cancellation attempt
  • ORDER_CANNOT_BE_CANCELED - Invalid status for cancellation

Example

// Cancel an order
DELETE /api/orders/123

// Response
{
  "orderId": 123,
  "orderNumber": "ORD-20260206-a1b2c3d4",
  "orderStatus": "취소",
  "refundedPoints": 5000,
  "canceledAt": "2026-02-06T10:30:00"
}
Original prompt

This section details on the original issue you should resolve

<issue_title>[Feat] 주문 취소 화면</issue_title>
<issue_description>## 📌 Description

[Feat] 주문 취소 화면

✅ To-do

  • 진행 예정
  • 진행 완료

📒 기타</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: neibler <87866961+neibler@users.noreply.github.com>
Copilot AI changed the title [WIP] Add order cancellation screen feature Implement order cancellation endpoint Feb 6, 2026
Copilot AI requested a review from neibler February 6, 2026 10:46
@neibler neibler closed this Feb 7, 2026
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.

[Feat] 주문 취소 화면

2 participants