44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
|
|
import uuid
|
||
|
|
from datetime import datetime
|
||
|
|
|
||
|
|
from pydantic import BaseModel, ConfigDict
|
||
|
|
|
||
|
|
from api.models.contribution import ContributionStatus, ContributionType
|
||
|
|
|
||
|
|
|
||
|
|
class ContributionCreate(BaseModel):
|
||
|
|
type: ContributionType
|
||
|
|
target_org: str | None = None
|
||
|
|
target_repo: str | None = None
|
||
|
|
slug: str | None = None
|
||
|
|
title: str
|
||
|
|
body_path: str | None = None
|
||
|
|
related_topic_id: uuid.UUID | None = None
|
||
|
|
related_workstream_id: uuid.UUID | None = None
|
||
|
|
notes: str | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class ContributionStatusPatch(BaseModel):
|
||
|
|
status: ContributionStatus
|
||
|
|
notes: str | None = None
|
||
|
|
|
||
|
|
|
||
|
|
class ContributionRead(BaseModel):
|
||
|
|
model_config = ConfigDict(from_attributes=True)
|
||
|
|
|
||
|
|
id: uuid.UUID
|
||
|
|
type: ContributionType
|
||
|
|
target_org: str | None = None
|
||
|
|
target_repo: str | None = None
|
||
|
|
slug: str | None = None
|
||
|
|
title: str
|
||
|
|
status: ContributionStatus
|
||
|
|
body_path: str | None = None
|
||
|
|
related_topic_id: uuid.UUID | None = None
|
||
|
|
related_workstream_id: uuid.UUID | None = None
|
||
|
|
submitted_at: datetime | None = None
|
||
|
|
resolved_at: datetime | None = None
|
||
|
|
notes: str | None = None
|
||
|
|
created_at: datetime
|
||
|
|
updated_at: datetime
|