feat: purchases added
This commit is contained in:
@@ -16,6 +16,12 @@ from .external_channel.delete_external_channel import delete_external_channel
|
||||
from .external_channel.get_external_channels import get_external_channels
|
||||
from .external_channel.import_external_channels_from_excel import import_external_channels_from_excel
|
||||
from .external_channel.update_external_channel_links import update_external_channel_links
|
||||
from .purchase.archive_purchase import archive_purchase
|
||||
from .purchase.create_purchase import create_purchase
|
||||
from .purchase.delete_purchase import delete_purchase
|
||||
from .purchase.get_purchase import get_purchase
|
||||
from .purchase.get_purchases import get_purchases
|
||||
from .purchase.update_purchase import update_purchase
|
||||
from .target_channel.connect_target_chan import connect_target_chan
|
||||
from .target_channel.disconnect_target_chan import disconnect_target_chan
|
||||
from .target_channel.disconnect_target_chan_by_tg_id import disconnect_target_chan_by_tg_id
|
||||
@@ -84,6 +90,26 @@ class Database(typing.Protocol):
|
||||
|
||||
async def delete_creative(self, creative_id: UUID) -> None: ...
|
||||
|
||||
async def get_purchase(self, user_id: UUID, purchase_id: UUID) -> domain.Purchase | None: ...
|
||||
|
||||
async def create_purchase(self, purchase: domain.Purchase) -> domain.Purchase: ...
|
||||
|
||||
async def update_purchase(self, purchase: domain.Purchase) -> domain.Purchase: ...
|
||||
|
||||
async def get_user_purchases(
|
||||
self,
|
||||
user_id: UUID,
|
||||
*,
|
||||
target_channel_id: UUID | None = None,
|
||||
external_channel_id: UUID | None = None,
|
||||
creative_id: UUID | None = None,
|
||||
include_archived: bool = False,
|
||||
) -> list[domain.Purchase]: ...
|
||||
|
||||
async def delete_purchase(self, purchase_id: UUID) -> None: ...
|
||||
|
||||
async def check_creative_in_use(self, creative_id: UUID) -> bool: ...
|
||||
|
||||
|
||||
class TelegramWriter(typing.Protocol):
|
||||
async def send_message(self, text: str, chat_id: int) -> None: ...
|
||||
@@ -92,6 +118,8 @@ class TelegramWriter(typing.Protocol):
|
||||
|
||||
async def get_chat_member(self, chat_id: int, user_id: int) -> dict[str, typing.Any]: ...
|
||||
|
||||
async def create_chat_invite_link(self, chat_id: int, requires_approval: bool = False) -> str: ...
|
||||
|
||||
|
||||
class JWTEncoder(typing.Protocol):
|
||||
def encode_access_token(self, user_id: UUID, telegram_id: int, username: str | None = None) -> str: ...
|
||||
@@ -121,3 +149,9 @@ class Usecase:
|
||||
update_creative = update_creative
|
||||
archive_creative = archive_creative
|
||||
delete_creative = delete_creative
|
||||
get_purchases = get_purchases
|
||||
get_purchase = get_purchase
|
||||
create_purchase = create_purchase
|
||||
update_purchase = update_purchase
|
||||
archive_purchase = archive_purchase
|
||||
delete_purchase = delete_purchase
|
||||
|
||||
Reference in New Issue
Block a user