change domen
This commit is contained in:
@@ -9,18 +9,19 @@ __all__ = (
|
||||
'ProjectOutput',
|
||||
'ValidateLoginTokenInput',
|
||||
'ValidateLoginTokenOutput',
|
||||
'TelegramLoginInput',
|
||||
'ChannelBotPermissions',
|
||||
'ChannelOutput',
|
||||
'GetChannelInput',
|
||||
'GetChannelsInput',
|
||||
'GetChannelsOutput',
|
||||
'AttachChannelToWorkspaceInput',
|
||||
'PurchasePlanChannelOutput',
|
||||
'GetPurchasePlanChannelsInput',
|
||||
'GetPurchasePlanChannelsOutput',
|
||||
'AttachChannelToPurchasePlanInput',
|
||||
'UpdatePurchasePlanChannelInput',
|
||||
'PurchaseOutput',
|
||||
'PurchaseChannelOutput',
|
||||
'CreatePurchaseInput',
|
||||
'CreatePurchaseChannelInput',
|
||||
'GetPurchasesInput',
|
||||
'GetPurchasesOutput',
|
||||
'GetPurchaseInput',
|
||||
'CreativeOutput',
|
||||
'GetCreativesInput',
|
||||
'GetCreativesOutput',
|
||||
@@ -32,9 +33,6 @@ __all__ = (
|
||||
'GetPlacementsInput',
|
||||
'GetPlacementsOutput',
|
||||
'GetPlacementInput',
|
||||
'CreatePlacementInput',
|
||||
'UpdatePlacementInput',
|
||||
'DeletePlacementInput',
|
||||
'PostViewsHistoryOutput',
|
||||
'GetViewsHistoryInput',
|
||||
'GetViewsHistoryOutput',
|
||||
@@ -104,15 +102,7 @@ from .creative import (
|
||||
GetCreativesOutput,
|
||||
UpdateCreativeInput,
|
||||
)
|
||||
from .placement import (
|
||||
CreatePlacementInput,
|
||||
DeletePlacementInput,
|
||||
GetPlacementInput,
|
||||
GetPlacementsInput,
|
||||
GetPlacementsOutput,
|
||||
PlacementOutput,
|
||||
UpdatePlacementInput,
|
||||
)
|
||||
from .placement import GetPlacementInput, GetPlacementsInput, GetPlacementsOutput, PlacementOutput
|
||||
from .project import (
|
||||
ChannelBotPermissions,
|
||||
ConnectProjectInput,
|
||||
@@ -124,14 +114,15 @@ from .project import (
|
||||
UpdateProjectInviteLinkTypeInput,
|
||||
UpdateProjectPermissionsInput,
|
||||
)
|
||||
from .purchase_plan import (
|
||||
AttachChannelToPurchasePlanInput,
|
||||
GetPurchasePlanChannelsInput,
|
||||
GetPurchasePlanChannelsOutput,
|
||||
PurchasePlanChannelOutput,
|
||||
UpdatePurchasePlanChannelInput,
|
||||
from .purchase import (
|
||||
CreatePurchaseChannelInput,
|
||||
CreatePurchaseInput,
|
||||
GetPurchaseInput,
|
||||
GetPurchasesInput,
|
||||
GetPurchasesOutput,
|
||||
PurchaseChannelOutput,
|
||||
PurchaseOutput,
|
||||
)
|
||||
from .telegram_login import TelegramLoginInput
|
||||
from .user import UserOutput
|
||||
from .validate_login_token import ValidateLoginTokenInput, ValidateLoginTokenOutput
|
||||
from .views import (
|
||||
@@ -162,4 +153,4 @@ from .workspace import (
|
||||
|
||||
class CreateLoginTokenRequest(BaseModel):
|
||||
telegram_id: int
|
||||
username: str | None
|
||||
username: str | None
|
||||
|
||||
@@ -18,10 +18,12 @@ class PlacementOutput(pydantic.BaseModel):
|
||||
cost: float | None
|
||||
comment: str | None
|
||||
ad_post_url: str | None
|
||||
invite_link_type: domain.InviteLinkType
|
||||
invite_link_type: domain.purchase.InviteLinkType
|
||||
invite_link: str
|
||||
status: domain.PlacementStatus
|
||||
subscriptions_count: int
|
||||
purchase_id: uuid.UUID | None = None
|
||||
purchase_channel_id: uuid.UUID | None = None
|
||||
created_at: datetime.datetime
|
||||
|
||||
|
||||
|
||||
@@ -32,11 +32,11 @@ class ProjectOutput(pydantic.BaseModel):
|
||||
title: str
|
||||
username: str | None
|
||||
status: ProjectStatus
|
||||
invite_link_type: domain.InviteLinkType
|
||||
purchase_invite_type_default: domain.purchase.InviteLinkType
|
||||
|
||||
|
||||
class UpdateProjectInviteLinkTypeInput(pydantic.BaseModel):
|
||||
invite_link_type: domain.InviteLinkType
|
||||
purchase_invite_type_default: domain.purchase.InviteLinkType
|
||||
|
||||
|
||||
class GetWorkspaceProjectsInput(pydantic.BaseModel):
|
||||
|
||||
53
src/dto/purchase.py
Normal file
53
src/dto/purchase.py
Normal file
@@ -0,0 +1,53 @@
|
||||
import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src.domain.purchase import InviteLinkType, PurchaseChannelStatus, PurchaseStatus
|
||||
|
||||
from .channel import ChannelOutput
|
||||
|
||||
|
||||
class PurchaseChannelOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
status: PurchaseChannelStatus
|
||||
planned_cost: float | None = None
|
||||
comment: str | None = None
|
||||
invite_link: str
|
||||
invite_link_type: InviteLinkType
|
||||
channel: ChannelOutput
|
||||
|
||||
|
||||
class PurchaseOutput(pydantic.BaseModel):
|
||||
id: uuid.UUID
|
||||
status: PurchaseStatus
|
||||
creative_id: uuid.UUID
|
||||
channels: list[PurchaseChannelOutput]
|
||||
|
||||
|
||||
class CreatePurchaseChannelInput(pydantic.BaseModel):
|
||||
username: str = pydantic.Field(pattern=r'^[^@]')
|
||||
status: PurchaseChannelStatus | None = None
|
||||
planned_cost: float | None = None
|
||||
comment: str | None = None
|
||||
|
||||
|
||||
class CreatePurchaseInput(pydantic.BaseModel):
|
||||
creative_id: uuid.UUID
|
||||
channels: list[CreatePurchaseChannelInput]
|
||||
|
||||
|
||||
class GetPurchasesInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
|
||||
|
||||
class GetPurchasesOutput(pydantic.BaseModel):
|
||||
purchases: list[PurchaseOutput]
|
||||
|
||||
|
||||
class GetPurchaseInput(pydantic.BaseModel):
|
||||
user_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
purchase_id: uuid.UUID
|
||||
@@ -1,38 +0,0 @@
|
||||
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 = pydantic.Field(pattern=r'^[^@]')
|
||||
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
|
||||
@@ -1,7 +0,0 @@
|
||||
import pydantic
|
||||
|
||||
|
||||
class TelegramLoginInput(pydantic.BaseModel):
|
||||
telegram_id: int
|
||||
username: str | None
|
||||
chat_id: int
|
||||
Reference in New Issue
Block a user