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:
@@ -32,6 +32,7 @@ class Order(Base):
|
||||
processing_started_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
||||
completed_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
||||
rejected_at: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
|
||||
rejection_reason: Mapped[str | None] = mapped_column(Text, nullable=True)
|
||||
estimated_price: Mapped[Decimal | None] = mapped_column(Numeric(12, 2), nullable=True)
|
||||
tenant_id: Mapped[uuid.UUID | None] = mapped_column(
|
||||
UUID(as_uuid=True), ForeignKey("tenants.id"), nullable=True, index=True
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user