feat: handle unsubscribe
This commit is contained in:
@@ -26,6 +26,7 @@ from .placement.get_placement import get_placement
|
||||
from .placement.get_placements import get_placements
|
||||
from .placement.update_placement import update_placement
|
||||
from .subscription.handle_subscription import handle_subscription
|
||||
from .subscription.handle_unsubscription import handle_unsubscription
|
||||
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
|
||||
@@ -131,6 +132,16 @@ class Database(typing.Protocol):
|
||||
self, subscriber_id: UUID, placement_id: UUID
|
||||
) -> domain.Subscription | None: ...
|
||||
|
||||
async def update_subscription(self, subscription: domain.Subscription) -> domain.Subscription: ...
|
||||
|
||||
async def get_active_subscriptions_by_subscriber_and_channel(
|
||||
self, subscriber_id: UUID, channel_telegram_id: int
|
||||
) -> list[domain.Subscription]: ...
|
||||
|
||||
async def get_active_subscription_by_subscriber_and_channel(
|
||||
self, subscriber_id: UUID, channel_telegram_id: int
|
||||
) -> domain.Subscription | None: ...
|
||||
|
||||
async def create_placement_views_history(
|
||||
self, history: domain.PlacementViewsHistory
|
||||
) -> domain.PlacementViewsHistory: ...
|
||||
@@ -195,6 +206,7 @@ class Usecase:
|
||||
update_placement = update_placement
|
||||
delete_placement = delete_placement
|
||||
handle_subscription = handle_subscription
|
||||
handle_unsubscription = handle_unsubscription
|
||||
fetch_views = fetch_views_manually
|
||||
run_views_worker_cycle = run_views_worker_cycle
|
||||
get_views_history = get_views_history
|
||||
|
||||
Reference in New Issue
Block a user