feat: доменный нейминг изменен
This commit is contained in:
21
src/domain/subscriber.py
Normal file
21
src/domain/subscriber.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from sqlalchemy import BigInteger
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from src import domain
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .subscription import Subscription
|
||||
|
||||
|
||||
class Subscriber(domain.Base):
|
||||
"""Пользователь Telegram, подписавшийся через invite links."""
|
||||
|
||||
telegram_id: Mapped[int] = mapped_column(BigInteger, unique=True, index=True)
|
||||
username: Mapped[str | None]
|
||||
first_name: Mapped[str | None]
|
||||
last_name: Mapped[str | None]
|
||||
|
||||
# Relationships
|
||||
subscriptions: Mapped[list['Subscription']] = relationship(back_populates='subscriber')
|
||||
Reference in New Issue
Block a user