feat(phase7.4): order rejection + resubmit flow

- Migration 053: rejection_reason TEXT NULL on orders table
- POST /api/orders/{id}/reject (PM+): sets rejected status, cancels
  active renders, stores reason, notifies creator, broadcasts WS event
- POST /api/orders/{id}/resubmit (creator or PM+): resets to draft,
  clears rejection fields, notifies PMs
- OrderDetail: Reject button (PM+) + inline modal with reason textarea
  and notify-client checkbox; Resubmit button; rejection reason amber
  alert box shown below header when order is rejected
- Orders Kanban: rejection_reason shown as red italic note on card
- Order interface: rejected_at, rejection_reason fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 20:37:05 +01:00
parent 596360e507
commit 1cc10d4bbb
7 changed files with 334 additions and 4 deletions
+6
View File
@@ -55,6 +55,11 @@ class OrderItemOut(BaseModel):
model_config = {"from_attributes": True}
class RejectOrderRequest(BaseModel):
reason: str = ""
notify_client: bool = True
class OrderLineCreate(BaseModel):
product_id: uuid.UUID
output_type_id: uuid.UUID | None = None
@@ -111,6 +116,7 @@ class OrderOut(BaseModel):
processing_started_at: datetime | None = None
completed_at: datetime | None = None
rejected_at: datetime | None = None
rejection_reason: str | None = None
estimated_price: float | None = None
item_count: int = 0
line_count: int = 0