feat(sub): subscription logic (pre release)
This commit is contained in:
@@ -6,7 +6,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from db.base import Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from db.models.sessions import Session
|
||||
from db.models import Order, Session, Subscription
|
||||
|
||||
|
||||
class User(Base):
|
||||
@@ -22,6 +22,10 @@ class User(Base):
|
||||
|
||||
balance: Mapped[float] = mapped_column(REAL, nullable=False, default=0)
|
||||
|
||||
orders: Mapped[list["Order"]] = relationship("Order", back_populates="user", lazy="selectin")
|
||||
subscription: Mapped["Subscription"] = relationship(
|
||||
"Subscription", back_populates="user", lazy="selectin"
|
||||
)
|
||||
sessions: Mapped[list["Session"]] = relationship(back_populates="user", lazy="selectin")
|
||||
referal: Mapped["User | None"] = relationship(
|
||||
"User",
|
||||
|
||||
Reference in New Issue
Block a user