feat: доменный нейминг изменен
This commit is contained in:
@@ -24,14 +24,14 @@ __all__ = (
|
||||
'CreateCreativeInput',
|
||||
'UpdateCreativeInput',
|
||||
'DeleteCreativeInput',
|
||||
'PurchaseOutput',
|
||||
'GetPurchasesInput',
|
||||
'GetPurchasesOutput',
|
||||
'GetPurchaseInput',
|
||||
'CreatePurchaseInput',
|
||||
'UpdatePurchaseInput',
|
||||
'DeletePurchaseInput',
|
||||
'ViewsSnapshotOutput',
|
||||
'PlacementOutput',
|
||||
'GetPlacementsInput',
|
||||
'GetPlacementsOutput',
|
||||
'GetPlacementInput',
|
||||
'CreatePlacementInput',
|
||||
'UpdatePlacementInput',
|
||||
'DeletePlacementInput',
|
||||
'PlacementViewsHistoryOutput',
|
||||
'GetViewsHistoryInput',
|
||||
'GetViewsHistoryOutput',
|
||||
'FetchViewsInputManually',
|
||||
@@ -57,14 +57,14 @@ from .external_channel import (
|
||||
UpdateExternalChannelInput,
|
||||
UpdateExternalChannelLinksInput,
|
||||
)
|
||||
from .purchase import (
|
||||
CreatePurchaseInput,
|
||||
DeletePurchaseInput,
|
||||
GetPurchaseInput,
|
||||
GetPurchasesInput,
|
||||
GetPurchasesOutput,
|
||||
PurchaseOutput,
|
||||
UpdatePurchaseInput,
|
||||
from .placement import (
|
||||
CreatePlacementInput,
|
||||
DeletePlacementInput,
|
||||
GetPlacementInput,
|
||||
GetPlacementsInput,
|
||||
GetPlacementsOutput,
|
||||
PlacementOutput,
|
||||
UpdatePlacementInput,
|
||||
)
|
||||
from .target_channel import (
|
||||
ChannelBotPermissions,
|
||||
@@ -83,6 +83,6 @@ from .views import (
|
||||
FetchViewsManuallyOutput,
|
||||
GetViewsHistoryInput,
|
||||
GetViewsHistoryOutput,
|
||||
PlacementViewsHistoryOutput,
|
||||
UpdateViewsManuallyInput,
|
||||
ViewsSnapshotOutput,
|
||||
)
|
||||
|
||||
@@ -14,7 +14,7 @@ class CreativeOutput(pydantic.BaseModel):
|
||||
target_channel_title: str
|
||||
created_at: datetime.datetime
|
||||
status: domain.CreativeStatus
|
||||
purchases_count: int
|
||||
placements_count: int
|
||||
|
||||
|
||||
class GetCreativesInput(pydantic.BaseModel):
|
||||
|
||||
@@ -6,7 +6,7 @@ import pydantic
|
||||
from src import domain
|
||||
|
||||
|
||||
class PurchaseOutput(pydantic.BaseModel):
|
||||
class PlacementOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
target_channel_id: uuid.UUID
|
||||
target_channel_title: str
|
||||
@@ -20,7 +20,7 @@ class PurchaseOutput(pydantic.BaseModel):
|
||||
ad_post_url: str | None
|
||||
invite_link_type: domain.InviteLinkType
|
||||
invite_link: str
|
||||
status: domain.PurchaseStatus
|
||||
status: domain.PlacementStatus
|
||||
subscriptions_count: int
|
||||
views_count: int | None
|
||||
views_availability: domain.PostViewsAvailability
|
||||
@@ -28,7 +28,7 @@ class PurchaseOutput(pydantic.BaseModel):
|
||||
created_at: datetime.datetime
|
||||
|
||||
|
||||
class GetPurchasesInput(pydantic.BaseModel):
|
||||
class GetPlacementsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
external_channel_id: uuid.UUID | None = None
|
||||
@@ -36,16 +36,16 @@ class GetPurchasesInput(pydantic.BaseModel):
|
||||
include_archived: bool = False
|
||||
|
||||
|
||||
class GetPurchasesOutput(pydantic.BaseModel):
|
||||
purchases: list[PurchaseOutput]
|
||||
class GetPlacementsOutput(pydantic.BaseModel):
|
||||
placements: list[PlacementOutput]
|
||||
|
||||
|
||||
class GetPurchaseInput(pydantic.BaseModel):
|
||||
purchase_id: uuid.UUID
|
||||
class GetPlacementInput(pydantic.BaseModel):
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
|
||||
|
||||
class CreatePurchaseInput(pydantic.BaseModel):
|
||||
class CreatePlacementInput(pydantic.BaseModel):
|
||||
target_channel_id: uuid.UUID
|
||||
external_channel_id: uuid.UUID
|
||||
creative_id: uuid.UUID
|
||||
@@ -56,14 +56,14 @@ class CreatePurchaseInput(pydantic.BaseModel):
|
||||
invite_link_type: domain.InviteLinkType = domain.InviteLinkType.PUBLIC
|
||||
|
||||
|
||||
class UpdatePurchaseInput(pydantic.BaseModel):
|
||||
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.PurchaseStatus | None = None
|
||||
status: domain.PlacementStatus | None = None
|
||||
|
||||
|
||||
class DeletePurchaseInput(pydantic.BaseModel):
|
||||
purchase_id: uuid.UUID
|
||||
class DeletePlacementInput(pydantic.BaseModel):
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
@@ -6,11 +6,11 @@ import pydantic
|
||||
from src import domain
|
||||
|
||||
|
||||
class ViewsSnapshotOutput(pydantic.BaseModel):
|
||||
"""Снимок просмотров."""
|
||||
class PlacementViewsHistoryOutput(pydantic.BaseModel):
|
||||
"""История просмотров placement."""
|
||||
|
||||
id: uuid.UUID
|
||||
purchase_id: uuid.UUID
|
||||
placement_id: uuid.UUID
|
||||
views_count: int
|
||||
fetched_at: datetime.datetime
|
||||
created_at: datetime.datetime
|
||||
@@ -19,7 +19,7 @@ class ViewsSnapshotOutput(pydantic.BaseModel):
|
||||
class GetViewsHistoryInput(pydantic.BaseModel):
|
||||
"""Получить историю просмотров для закупа."""
|
||||
|
||||
purchase_id: uuid.UUID
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
from_date: datetime.datetime | None = None # Фильтр: с какой даты
|
||||
to_date: datetime.datetime | None = None # Фильтр: по какую дату
|
||||
@@ -28,18 +28,18 @@ class GetViewsHistoryInput(pydantic.BaseModel):
|
||||
class GetViewsHistoryOutput(pydantic.BaseModel):
|
||||
"""История просмотров."""
|
||||
|
||||
snapshots: list[ViewsSnapshotOutput]
|
||||
histories: list[PlacementViewsHistoryOutput]
|
||||
|
||||
|
||||
class FetchViewsInputManually(pydantic.BaseModel):
|
||||
"""Запросить обновление просмотров для закупа."""
|
||||
|
||||
purchase_id: uuid.UUID
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
|
||||
|
||||
class FetchViewsManuallyOutput(pydantic.BaseModel):
|
||||
purchase_id: uuid.UUID
|
||||
placement_id: uuid.UUID
|
||||
views_count: int | None # None если не удалось получить
|
||||
views_availability: domain.PostViewsAvailability
|
||||
fetched_at: datetime.datetime
|
||||
@@ -49,6 +49,6 @@ class FetchViewsManuallyOutput(pydantic.BaseModel):
|
||||
class UpdateViewsManuallyInput(pydantic.BaseModel):
|
||||
"""Ручное обновление просмотров."""
|
||||
|
||||
purchase_id: uuid.UUID
|
||||
placement_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
views_count: int
|
||||
|
||||
Reference in New Issue
Block a user