first commit

This commit is contained in:
2026-04-04 21:30:35 +07:00
commit d66041fa31
24 changed files with 503 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
from typing import Protocol
from app.models.user import User
class IUserRepository(Protocol):
async def get_by_telegram_id(self, telegram_id: int) -> User | None: ...
async def create(
self,
*,
telegram_id: int,
username: str | None,
first_name: str | None,
referrer_id: int | None,
) -> User: ...
async def update_profile(
self,
user: User,
*,
username: str | None,
first_name: str | None,
) -> User: ...
async def set_referrer_if_unset(
self,
user: User,
referrer_internal_id: int,
) -> None: ...