39 lines
926 B
Python
39 lines
926 B
Python
|
|
import uuid
|
||
|
|
from datetime import date, datetime
|
||
|
|
|
||
|
|
from pydantic import BaseModel, ConfigDict
|
||
|
|
|
||
|
|
from api.models.workstream import WorkstreamStatus
|
||
|
|
|
||
|
|
|
||
|
|
class WorkstreamCreate(BaseModel):
|
||
|
|
topic_id: uuid.UUID
|
||
|
|
slug: str
|
||
|
|
title: str
|
||
|
|
description: str | None = None
|
||
|
|
status: WorkstreamStatus = WorkstreamStatus.active
|
||
|
|
owner: str | None = None
|
||
|
|
due_date: date | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class WorkstreamUpdate(BaseModel):
|
||
|
|
title: str | None = None
|
||
|
|
description: str | None = None
|
||
|
|
status: WorkstreamStatus | None = None
|
||
|
|
owner: str | None = None
|
||
|
|
due_date: date | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class WorkstreamRead(BaseModel):
|
||
|
|
model_config = ConfigDict(from_attributes=True)
|
||
|
|
id: uuid.UUID
|
||
|
|
topic_id: uuid.UUID
|
||
|
|
slug: str
|
||
|
|
title: str
|
||
|
|
description: str | None = None
|
||
|
|
status: WorkstreamStatus
|
||
|
|
owner: str | None = None
|
||
|
|
due_date: date | None = None
|
||
|
|
created_at: datetime
|
||
|
|
updated_at: datetime
|