feat: доменный нейминг изменен
This commit is contained in:
69
src/dto/placement.py
Normal file
69
src/dto/placement.py
Normal file
@@ -0,0 +1,69 @@
|
||||
import datetime
|
||||
import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src import domain
|
||||
|
||||
|
||||
class PlacementOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
target_channel_id: uuid.UUID
|
||||
target_channel_title: str
|
||||
external_channel_id: uuid.UUID
|
||||
external_channel_title: str
|
||||
creative_id: uuid.UUID
|
||||
creative_name: str
|
||||
placement_date: datetime.datetime
|
||||
cost: float | None
|
||||
comment: str | None
|
||||
ad_post_url: str | None
|
||||
invite_link_type: domain.InviteLinkType
|
||||
invite_link: str
|
||||
status: domain.PlacementStatus
|
||||
subscriptions_count: int
|
||||
views_count: int | None
|
||||
views_availability: domain.PostViewsAvailability
|
||||
last_views_fetch_at: datetime.datetime | None
|
||||
created_at: datetime.datetime
|
||||
|
||||
|
||||
class GetPlacementsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
external_channel_id: uuid.UUID | None = None
|
||||
creative_id: uuid.UUID | None = None
|
||||
include_archived: bool = False
|
||||
|
||||
|
||||
class GetPlacementsOutput(pydantic.BaseModel):
|
||||
placements: list[PlacementOutput]
|
||||
|
||||
|
||||
class GetPlacementInput(pydantic.BaseModel):
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
|
||||
|
||||
class CreatePlacementInput(pydantic.BaseModel):
|
||||
target_channel_id: uuid.UUID
|
||||
external_channel_id: uuid.UUID
|
||||
creative_id: uuid.UUID
|
||||
placement_date: datetime.datetime
|
||||
cost: float | None = None
|
||||
comment: str | None = None
|
||||
ad_post_url: str | None = None
|
||||
invite_link_type: domain.InviteLinkType = domain.InviteLinkType.PUBLIC
|
||||
|
||||
|
||||
class UpdatePlacementInput(pydantic.BaseModel):
|
||||
placement_date: datetime.datetime | None = None
|
||||
cost: float | None = None
|
||||
comment: str | None = None
|
||||
ad_post_url: str | None = None
|
||||
status: domain.PlacementStatus | None = None
|
||||
|
||||
|
||||
class DeletePlacementInput(pydantic.BaseModel):
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
Reference in New Issue
Block a user