This commit is contained in:
Artem Tsyrulnikov
2026-01-06 18:50:22 +03:00
parent 61f7ed093c
commit c73798da87
11 changed files with 959 additions and 521 deletions

View File

@@ -290,12 +290,25 @@ class Parser(typing.Protocol):
async def fetch_telegram_channel(self, username: str) -> FetchChannelResponse | None: ...
class S3Storage(typing.Protocol):
async def connect(self) -> None: ...
async def close(self) -> None: ...
async def upload(self, key: str, data: bytes, content_type: str) -> None: ...
async def get(self, key: str) -> bytes: ...
async def delete(self, key: str) -> None: ...
@dataclass
class Usecase:
database: Database
telegram_bot: TelegramBotWriter
jwt_encoder: JWTEncoder
parser: Parser
s3: S3Storage
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)