feat: явно указаны зависимости к Protocol для перехода к имплементации
This commit is contained in:
@@ -296,7 +296,7 @@ class FetchChannelResponse(typing.Protocol):
|
||||
title: str
|
||||
|
||||
|
||||
class ParserClient(typing.Protocol):
|
||||
class Parser(typing.Protocol):
|
||||
async def fetch_telegram_channel(self, username: str) -> FetchChannelResponse | None: ...
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ class Usecase:
|
||||
database: Database
|
||||
telegram_bot: TelegramBotWriter
|
||||
jwt_encoder: JWTEncoder
|
||||
parser_client: ParserClient
|
||||
parser: Parser
|
||||
|
||||
async def ensure_workspace_access(self, workspace_id: UUID, user_id: UUID) -> domain.Workspace:
|
||||
workspace = await self.database.get_workspace_for_user(workspace_id, user_id)
|
||||
|
||||
@@ -30,7 +30,7 @@ async def attach_channel_to_purchase_plan(
|
||||
channel = await self.database.get_channel(username=input.username)
|
||||
|
||||
if not channel:
|
||||
parser_response = await self.parser_client.fetch_telegram_channel(input.username)
|
||||
parser_response = await self.parser.fetch_telegram_channel(input.username)
|
||||
if not parser_response:
|
||||
raise domain.TelegramChannelNotFound(input.username)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user