new telegram bot
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
__all__ = (
|
||||
'UpdateProjectInviteLinkTypeInput',
|
||||
'UpdateProjectPermissionsInput',
|
||||
'GetWorkspaceProjectsInput',
|
||||
'GetWorkspaceProjectsOutput',
|
||||
'GetProjectInput',
|
||||
'DisconnectProjectByTgIdInput',
|
||||
'ConnectProjectInput',
|
||||
'ProjectOutput',
|
||||
@@ -10,8 +12,10 @@ __all__ = (
|
||||
'TelegramLoginInput',
|
||||
'ChannelBotPermissions',
|
||||
'ChannelOutput',
|
||||
'GetChannelInput',
|
||||
'GetChannelsInput',
|
||||
'GetChannelsOutput',
|
||||
'AttachChannelToWorkspaceInput',
|
||||
'PurchasePlanChannelOutput',
|
||||
'GetPurchasePlanChannelsInput',
|
||||
'GetPurchasePlanChannelsOutput',
|
||||
@@ -67,6 +71,8 @@ __all__ = (
|
||||
'GetWorkspaceInvitesOutput',
|
||||
)
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
from .analytics import (
|
||||
ChannelAnalyticsOutput,
|
||||
CreativeAnalyticsOutput,
|
||||
@@ -82,7 +88,13 @@ from .analytics import (
|
||||
PlacementAnalyticsOutput,
|
||||
SpendingDataPoint,
|
||||
)
|
||||
from .channel import ChannelOutput, GetChannelsInput, GetChannelsOutput
|
||||
from .channel import (
|
||||
AttachChannelToWorkspaceInput,
|
||||
ChannelOutput,
|
||||
GetChannelInput,
|
||||
GetChannelsInput,
|
||||
GetChannelsOutput,
|
||||
)
|
||||
from .creative import (
|
||||
CreateCreativeInput,
|
||||
CreativeOutput,
|
||||
@@ -105,9 +117,11 @@ from .project import (
|
||||
ChannelBotPermissions,
|
||||
ConnectProjectInput,
|
||||
DisconnectProjectByTgIdInput,
|
||||
GetProjectInput,
|
||||
GetWorkspaceProjectsInput,
|
||||
GetWorkspaceProjectsOutput,
|
||||
ProjectOutput,
|
||||
UpdateProjectInviteLinkTypeInput,
|
||||
UpdateProjectPermissionsInput,
|
||||
)
|
||||
from .purchase_plan import (
|
||||
@@ -144,3 +158,8 @@ from .workspace import (
|
||||
WorkspacePermissionScopeInput,
|
||||
WorkspacePermissionScopeOutput,
|
||||
)
|
||||
|
||||
|
||||
class CreateLoginTokenRequest(BaseModel):
|
||||
telegram_id: int
|
||||
username: str | None
|
||||
@@ -16,3 +16,13 @@ class GetChannelsInput(pydantic.BaseModel):
|
||||
|
||||
class GetChannelsOutput(pydantic.BaseModel):
|
||||
channels: list[ChannelOutput]
|
||||
|
||||
|
||||
class GetChannelInput(pydantic.BaseModel):
|
||||
channel_id: uuid.UUID
|
||||
|
||||
|
||||
class AttachChannelToWorkspaceInput(pydantic.BaseModel):
|
||||
channel_id: uuid.UUID
|
||||
workspace_id: uuid.UUID
|
||||
user_telegram_id: int
|
||||
|
||||
6
src/dto/internal.py
Normal file
6
src/dto/internal.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class CreateLoginTokenRequest(BaseModel):
|
||||
telegram_id: int
|
||||
username: str | None = None
|
||||
@@ -51,7 +51,6 @@ class CreatePlacementInput(pydantic.BaseModel):
|
||||
placement_date: datetime.datetime
|
||||
cost: float | None = None
|
||||
comment: str | None = None
|
||||
invite_link_type: domain.InviteLinkType = domain.InviteLinkType.PUBLIC
|
||||
|
||||
|
||||
class UpdatePlacementInput(pydantic.BaseModel):
|
||||
|
||||
@@ -2,6 +2,7 @@ import uuid
|
||||
|
||||
import pydantic
|
||||
|
||||
from src import domain
|
||||
from src.domain.project import ProjectStatus
|
||||
|
||||
|
||||
@@ -31,6 +32,11 @@ class ProjectOutput(pydantic.BaseModel):
|
||||
title: str
|
||||
username: str | None
|
||||
status: ProjectStatus
|
||||
invite_link_type: domain.InviteLinkType
|
||||
|
||||
|
||||
class UpdateProjectInviteLinkTypeInput(pydantic.BaseModel):
|
||||
invite_link_type: domain.InviteLinkType
|
||||
|
||||
|
||||
class GetWorkspaceProjectsInput(pydantic.BaseModel):
|
||||
@@ -52,3 +58,8 @@ class UpdateProjectPermissionsInput(pydantic.BaseModel):
|
||||
permissions: ChannelBotPermissions
|
||||
chat_title: str
|
||||
user_telegram_id: int
|
||||
|
||||
|
||||
class GetProjectInput(pydantic.BaseModel):
|
||||
workspace_id: uuid.UUID
|
||||
project_id: uuid.UUID
|
||||
|
||||
Reference in New Issue
Block a user