feat: переименование доменной области
This commit is contained in:
@@ -1,21 +1,22 @@
|
||||
__all__ = (
|
||||
'UpdateTargetChanPermissionsInput',
|
||||
'GetUserTargetChansInput',
|
||||
'GetUserTargetChansOutput',
|
||||
'DisconnectTargetChanByTgIdInput',
|
||||
'ConnectTargetChanInput',
|
||||
'ConnectTargetChanOutput',
|
||||
'UpdateProjectPermissionsInput',
|
||||
'GetWorkspaceProjectsInput',
|
||||
'GetWorkspaceProjectsOutput',
|
||||
'DisconnectProjectByTgIdInput',
|
||||
'ConnectProjectInput',
|
||||
'ProjectOutput',
|
||||
'ValidateLoginTokenInput',
|
||||
'ValidateLoginTokenOutput',
|
||||
'TelegramLoginInput',
|
||||
'ChannelBotPermissions',
|
||||
'ExternalChannelOutput',
|
||||
'GetExternalChannelsInput',
|
||||
'GetExternalChannelsOutput',
|
||||
'CreateExternalChannelInput',
|
||||
'DeleteExternalChannelInput',
|
||||
'UpdateExternalChannelInput',
|
||||
'UpdateExternalChannelLinksInput',
|
||||
'ChannelOutput',
|
||||
'GetChannelsInput',
|
||||
'GetChannelsOutput',
|
||||
'PurchasePlanChannelOutput',
|
||||
'GetPurchasePlanChannelsInput',
|
||||
'GetPurchasePlanChannelsOutput',
|
||||
'AttachChannelToPurchasePlanInput',
|
||||
'UpdatePurchasePlanChannelInput',
|
||||
'CreativeOutput',
|
||||
'GetCreativesInput',
|
||||
'GetCreativesOutput',
|
||||
@@ -37,14 +38,14 @@ __all__ = (
|
||||
'UserOutput',
|
||||
'DateGrouping',
|
||||
'PlacementAnalyticsOutput',
|
||||
'ChannelAnalyticsOutput',
|
||||
'CreativeAnalyticsOutput',
|
||||
'ExternalChannelAnalyticsOutput',
|
||||
'GetPlacementsAnalyticsInput',
|
||||
'GetPlacementsAnalyticsOutput',
|
||||
'GetCreativesAnalyticsInput',
|
||||
'GetCreativesAnalyticsOutput',
|
||||
'GetExternalChannelsAnalyticsInput',
|
||||
'GetExternalChannelsAnalyticsOutput',
|
||||
'GetChannelAnalyticsInput',
|
||||
'GetChannelAnalyticsOutput',
|
||||
'SpendingDataPoint',
|
||||
'GetSpendingAnalyticsInput',
|
||||
'GetSpendingAnalyticsOutput',
|
||||
@@ -56,13 +57,13 @@ __all__ = (
|
||||
)
|
||||
|
||||
from .analytics import (
|
||||
ChannelAnalyticsOutput,
|
||||
CreativeAnalyticsOutput,
|
||||
DateGrouping,
|
||||
ExternalChannelAnalyticsOutput,
|
||||
GetChannelAnalyticsInput,
|
||||
GetChannelAnalyticsOutput,
|
||||
GetCreativesAnalyticsInput,
|
||||
GetCreativesAnalyticsOutput,
|
||||
GetExternalChannelsAnalyticsInput,
|
||||
GetExternalChannelsAnalyticsOutput,
|
||||
GetPlacementsAnalyticsInput,
|
||||
GetPlacementsAnalyticsOutput,
|
||||
GetSpendingAnalyticsInput,
|
||||
@@ -70,6 +71,7 @@ from .analytics import (
|
||||
PlacementAnalyticsOutput,
|
||||
SpendingDataPoint,
|
||||
)
|
||||
from .channel import ChannelOutput, GetChannelsInput, GetChannelsOutput
|
||||
from .creative import (
|
||||
CreateCreativeInput,
|
||||
CreativeOutput,
|
||||
@@ -79,15 +81,6 @@ from .creative import (
|
||||
GetCreativesOutput,
|
||||
UpdateCreativeInput,
|
||||
)
|
||||
from .external_channel import (
|
||||
CreateExternalChannelInput,
|
||||
DeleteExternalChannelInput,
|
||||
ExternalChannelOutput,
|
||||
GetExternalChannelsInput,
|
||||
GetExternalChannelsOutput,
|
||||
UpdateExternalChannelInput,
|
||||
UpdateExternalChannelLinksInput,
|
||||
)
|
||||
from .placement import (
|
||||
CreatePlacementInput,
|
||||
DeletePlacementInput,
|
||||
@@ -97,14 +90,21 @@ from .placement import (
|
||||
PlacementOutput,
|
||||
UpdatePlacementInput,
|
||||
)
|
||||
from .target_channel import (
|
||||
from .project import (
|
||||
ChannelBotPermissions,
|
||||
ConnectTargetChanInput,
|
||||
ConnectTargetChanOutput,
|
||||
DisconnectTargetChanByTgIdInput,
|
||||
GetUserTargetChansInput,
|
||||
GetUserTargetChansOutput,
|
||||
UpdateTargetChanPermissionsInput,
|
||||
ConnectProjectInput,
|
||||
DisconnectProjectByTgIdInput,
|
||||
GetWorkspaceProjectsInput,
|
||||
GetWorkspaceProjectsOutput,
|
||||
ProjectOutput,
|
||||
UpdateProjectPermissionsInput,
|
||||
)
|
||||
from .purchase_plan import (
|
||||
AttachChannelToPurchasePlanInput,
|
||||
GetPurchasePlanChannelsInput,
|
||||
GetPurchasePlanChannelsOutput,
|
||||
PurchasePlanChannelOutput,
|
||||
UpdatePurchasePlanChannelInput,
|
||||
)
|
||||
from .telegram_login import TelegramLoginInput
|
||||
from .user import UserOutput
|
||||
|
||||
@@ -15,10 +15,10 @@ class DateGrouping(StrEnum):
|
||||
|
||||
class PlacementAnalyticsOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
target_channel_id: uuid.UUID
|
||||
target_channel_title: str
|
||||
external_channel_id: uuid.UUID
|
||||
external_channel_title: str
|
||||
project_id: uuid.UUID
|
||||
project_channel_title: str
|
||||
placement_channel_id: uuid.UUID
|
||||
placement_channel_title: str
|
||||
creative_id: uuid.UUID
|
||||
creative_name: str
|
||||
placement_date: datetime.datetime
|
||||
@@ -40,7 +40,7 @@ class CreativeAnalyticsOutput(pydantic.BaseModel):
|
||||
avg_cpm: float | None
|
||||
|
||||
|
||||
class ExternalChannelAnalyticsOutput(pydantic.BaseModel):
|
||||
class ChannelAnalyticsOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
title: str
|
||||
username: str | None
|
||||
@@ -55,7 +55,7 @@ class ExternalChannelAnalyticsOutput(pydantic.BaseModel):
|
||||
class GetPlacementsAnalyticsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class GetPlacementsAnalyticsOutput(pydantic.BaseModel):
|
||||
@@ -65,21 +65,21 @@ class GetPlacementsAnalyticsOutput(pydantic.BaseModel):
|
||||
class GetCreativesAnalyticsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class GetCreativesAnalyticsOutput(pydantic.BaseModel):
|
||||
creatives: list[CreativeAnalyticsOutput]
|
||||
|
||||
|
||||
class GetExternalChannelsAnalyticsInput(pydantic.BaseModel):
|
||||
class GetChannelAnalyticsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
|
||||
|
||||
class GetExternalChannelsAnalyticsOutput(pydantic.BaseModel):
|
||||
external_channels: list[ExternalChannelAnalyticsOutput]
|
||||
class GetChannelAnalyticsOutput(pydantic.BaseModel):
|
||||
channels: list[ChannelAnalyticsOutput]
|
||||
|
||||
|
||||
class SpendingDataPoint(pydantic.BaseModel):
|
||||
@@ -94,7 +94,7 @@ class SpendingDataPoint(pydantic.BaseModel):
|
||||
class GetSpendingAnalyticsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
date_from: datetime.datetime | None = None
|
||||
date_to: datetime.datetime | None = None
|
||||
grouping: DateGrouping = DateGrouping.DAY
|
||||
|
||||
21
src/dto/channel.py
Normal file
21
src/dto/channel.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src.domain.channel import ChannelVerificationStatus
|
||||
|
||||
|
||||
class ChannelOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
telegram_id: int | None
|
||||
title: str | None
|
||||
username: str | None
|
||||
verification_status: ChannelVerificationStatus
|
||||
|
||||
|
||||
class GetChannelsInput(pydantic.BaseModel):
|
||||
username: str | None = None
|
||||
|
||||
|
||||
class GetChannelsOutput(pydantic.BaseModel):
|
||||
channels: list[ChannelOutput]
|
||||
@@ -10,8 +10,8 @@ class CreativeOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
name: str
|
||||
text: str
|
||||
target_channel_id: uuid.UUID
|
||||
target_channel_title: str
|
||||
project_id: uuid.UUID
|
||||
project_channel_title: str
|
||||
created_at: datetime.datetime
|
||||
status: domain.CreativeStatus
|
||||
placements_count: int
|
||||
@@ -20,7 +20,7 @@ class CreativeOutput(pydantic.BaseModel):
|
||||
class GetCreativesInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
include_archived: bool = False
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class GetCreativeInput(pydantic.BaseModel):
|
||||
class CreateCreativeInput(pydantic.BaseModel):
|
||||
name: str
|
||||
text: str
|
||||
target_channel_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
|
||||
|
||||
class UpdateCreativeInput(pydantic.BaseModel):
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
|
||||
class ExternalChannelOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
telegram_id: int
|
||||
title: str
|
||||
username: str | None
|
||||
description: str | None
|
||||
subscribers_count: int | None
|
||||
|
||||
|
||||
class GetExternalChannelsInput(pydantic.BaseModel):
|
||||
target_channel_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
|
||||
|
||||
class GetExternalChannelsOutput(pydantic.BaseModel):
|
||||
external_channels: list[ExternalChannelOutput]
|
||||
|
||||
|
||||
class CreateExternalChannelInput(pydantic.BaseModel):
|
||||
telegram_id: int
|
||||
title: str
|
||||
username: str | None = None
|
||||
description: str | None = None
|
||||
subscribers_count: int | None = None
|
||||
target_channel_ids: list[uuid.UUID]
|
||||
|
||||
|
||||
class DeleteExternalChannelInput(pydantic.BaseModel):
|
||||
channel_id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
|
||||
|
||||
class UpdateExternalChannelInput(pydantic.BaseModel):
|
||||
title: str | None = None
|
||||
username: str | None = None
|
||||
description: str | None = None
|
||||
subscribers_count: int | None = None
|
||||
|
||||
|
||||
class UpdateExternalChannelLinksInput(pydantic.BaseModel):
|
||||
add_target_channel_ids: list[uuid.UUID] = []
|
||||
remove_target_channel_ids: list[uuid.UUID] = []
|
||||
@@ -8,10 +8,10 @@ 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
|
||||
project_id: uuid.UUID
|
||||
project_channel_title: str
|
||||
placement_channel_id: uuid.UUID
|
||||
placement_channel_title: str
|
||||
creative_id: uuid.UUID
|
||||
creative_name: str
|
||||
placement_date: datetime.datetime
|
||||
@@ -31,8 +31,8 @@ class PlacementOutput(pydantic.BaseModel):
|
||||
class GetPlacementsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
target_channel_id: uuid.UUID | None = None
|
||||
external_channel_id: uuid.UUID | None = None
|
||||
project_id: uuid.UUID | None = None
|
||||
placement_channel_id: uuid.UUID | None = None
|
||||
creative_id: uuid.UUID | None = None
|
||||
include_archived: bool = False
|
||||
|
||||
@@ -48,8 +48,8 @@ class GetPlacementInput(pydantic.BaseModel):
|
||||
|
||||
|
||||
class CreatePlacementInput(pydantic.BaseModel):
|
||||
target_channel_id: uuid.UUID
|
||||
external_channel_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
placement_channel_id: uuid.UUID
|
||||
creative_id: uuid.UUID
|
||||
placement_date: datetime.datetime
|
||||
cost: float | None = None
|
||||
|
||||
@@ -2,7 +2,7 @@ import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src.domain.target_channel import TargetChannelStatus
|
||||
from src.domain.project import ProjectStatus
|
||||
|
||||
|
||||
class ChannelBotPermissions(pydantic.BaseModel):
|
||||
@@ -17,7 +17,7 @@ class ChannelBotPermissions(pydantic.BaseModel):
|
||||
can_pin_messages: bool | None = None
|
||||
|
||||
|
||||
class ConnectTargetChanInput(pydantic.BaseModel):
|
||||
class ConnectProjectInput(pydantic.BaseModel):
|
||||
telegram_id: int
|
||||
title: str
|
||||
username: str | None
|
||||
@@ -25,31 +25,29 @@ class ConnectTargetChanInput(pydantic.BaseModel):
|
||||
bot_permissions: ChannelBotPermissions
|
||||
|
||||
|
||||
class ConnectTargetChanOutput(pydantic.BaseModel):
|
||||
class ProjectOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
telegram_id: int
|
||||
title: str
|
||||
username: str | None
|
||||
status: TargetChannelStatus
|
||||
# Deprecated: используйте status. Оставлено для обратной совместимости с фронтендом
|
||||
is_active: bool
|
||||
status: ProjectStatus
|
||||
|
||||
|
||||
class GetUserTargetChansInput(pydantic.BaseModel):
|
||||
class GetWorkspaceProjectsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
|
||||
|
||||
class GetUserTargetChansOutput(pydantic.BaseModel):
|
||||
target_channels: list[ConnectTargetChanOutput]
|
||||
class GetWorkspaceProjectsOutput(pydantic.BaseModel):
|
||||
projects: list[ProjectOutput]
|
||||
|
||||
|
||||
class DisconnectTargetChanByTgIdInput(pydantic.BaseModel):
|
||||
class DisconnectProjectByTgIdInput(pydantic.BaseModel):
|
||||
telegram_id: int
|
||||
user_telegram_id: int
|
||||
|
||||
|
||||
class UpdateTargetChanPermissionsInput(pydantic.BaseModel):
|
||||
class UpdateProjectPermissionsInput(pydantic.BaseModel):
|
||||
telegram_id: int
|
||||
permissions: ChannelBotPermissions
|
||||
chat_title: str
|
||||
38
src/dto/purchase_plan.py
Normal file
38
src/dto/purchase_plan.py
Normal file
@@ -0,0 +1,38 @@
|
||||
import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src.domain.purchase_plan import PurchasePlanChannelStatus
|
||||
|
||||
from .channel import ChannelOutput
|
||||
|
||||
|
||||
class PurchasePlanChannelOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
status: PurchasePlanChannelStatus
|
||||
planned_cost: float | None = None
|
||||
comment: str | None = None
|
||||
channel: ChannelOutput
|
||||
|
||||
|
||||
class GetPurchasePlanChannelsInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
|
||||
|
||||
class GetPurchasePlanChannelsOutput(pydantic.BaseModel):
|
||||
channels: list[PurchasePlanChannelOutput]
|
||||
|
||||
|
||||
class AttachChannelToPurchasePlanInput(pydantic.BaseModel):
|
||||
username: str
|
||||
status: PurchasePlanChannelStatus | None = None
|
||||
planned_cost: float | None = None
|
||||
comment: str | None = None
|
||||
|
||||
|
||||
class UpdatePurchasePlanChannelInput(pydantic.BaseModel):
|
||||
status: PurchasePlanChannelStatus | None = None
|
||||
planned_cost: float | None = None
|
||||
comment: str | None = None
|
||||
Reference in New Issue
Block a user