feat: add subscription and transaction repositories
- Implemented SubscriptionRepository with methods to get, create, and update subscriptions. - Added BalanceTXRepository for creating and retrieving balance transactions. - Introduced a test script for simulating Pally webhook for local testing.
This commit is contained in:
@@ -7,6 +7,8 @@ from db.base import Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from db.models.bills import Bill
|
||||
from db.models.subscriptions import Subscription
|
||||
from db.models.transactions import BalanceTransaction
|
||||
|
||||
|
||||
class User(Base):
|
||||
@@ -22,3 +24,9 @@ class User(Base):
|
||||
back_populates="user",
|
||||
cascade="all, delete",
|
||||
)
|
||||
subscription: Mapped["Subscription"] = relationship(
|
||||
"Subscription", back_populates="user", cascade="all, delete-orphan"
|
||||
)
|
||||
balance_transactions: Mapped[list["BalanceTransaction"]] = relationship(
|
||||
"BalanceTransaction", back_populates="user", cascade="all, delete"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user