Files
the-custodian/state-hub/api/schemas/extension_point.py
tegwick ae03a7970c fix(api): add ep_id to EPUpdate schema so extension point IDs can be patched
EPUpdate was missing the ep_id field, making it impossible to assign a
human-readable ID to an existing EP via PATCH. The router already uses
model_dump(exclude_unset=True) + setattr so no router change needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11 01:24:42 +01:00

51 lines
1.3 KiB
Python

import uuid
from datetime import datetime
from pydantic import BaseModel, ConfigDict
from api.models.extension_point import EPStatus
VALID_PRIORITIES = {"low", "medium", "high", "critical"}
class EPCreate(BaseModel):
ep_id: str | None = None
domain: str # slug; router resolves to domain_id FK
title: str
description: str | None = None
location: str | None = None
ep_type: str = "other"
status: EPStatus = EPStatus.open
priority: str = "medium"
topic_id: uuid.UUID | None = None
workstream_id: uuid.UUID | None = None
class EPUpdate(BaseModel):
ep_id: str | None = None
title: str | None = None
description: str | None = None
location: str | None = None
ep_type: str | None = None
status: EPStatus | None = None
priority: str | None = None
workstream_id: uuid.UUID | None = None
class EPRead(BaseModel):
model_config = ConfigDict(from_attributes=True)
id: uuid.UUID
ep_id: str | None = None
domain_slug: str # derived from domain relationship
title: str
description: str | None = None
location: str | None = None
ep_type: str
status: EPStatus
priority: str
topic_id: uuid.UUID | None = None
workstream_id: uuid.UUID | None = None
created_at: datetime
updated_at: datetime