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:
2026-04-27 21:33:25 +07:00
parent 049f31118d
commit 287f8eebda
34 changed files with 3401 additions and 53 deletions

View File

@@ -0,0 +1,36 @@
"""plan specifications added
Revision ID: b2ecec0ef260
Revises: e8da1e4516fa
Create Date: 2026-04-27 20:16:04.252427
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = 'b2ecec0ef260'
down_revision: Union[str, Sequence[str], None] = 'e8da1e4516fa'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('subscriptions', sa.Column('devices', sa.INTEGER(), nullable=False, server_default="3"))
op.add_column('subscriptions', sa.Column('whitelists', sa.BOOLEAN(), nullable=False, server_default="false"))
# ### end Alembic commands ###
op.alter_column("subscriptions", "devices", server_default=None)
op.alter_column("subscriptions", "whitelists", server_default=None)
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('subscriptions', 'whitelists')
op.drop_column('subscriptions', 'devices')
# ### end Alembic commands ###