1cc10d4bbb
- 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>
27 lines
622 B
Python
27 lines
622 B
Python
"""Add rejection_reason to orders table.
|
|
|
|
Revision ID: 053
|
|
Revises: 052
|
|
"""
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.engine.reflection import Inspector
|
|
|
|
revision = "053"
|
|
down_revision = "052"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
bind = op.get_bind()
|
|
inspector = Inspector.from_engine(bind)
|
|
columns = [c["name"] for c in inspector.get_columns("orders")]
|
|
|
|
if "rejection_reason" not in columns:
|
|
op.add_column("orders", sa.Column("rejection_reason", sa.Text(), nullable=True))
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("orders", "rejection_reason")
|