50 lines
1.2 KiB
Python
50 lines
1.2 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
|
||
|
|
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):
|
||
|
|
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: str
|
||
|
|
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
|