feat: subs and views
This commit is contained in:
@@ -62,22 +62,25 @@ async def create_purchase(self: 'Usecase', input: dto.CreatePurchaseInput, user_
|
||||
creative.purchases_count += 1
|
||||
await self.database.update_creative(creative)
|
||||
|
||||
return dto.PurchaseOutput(
|
||||
id=created.id,
|
||||
target_channel_id=created.target_channel_id,
|
||||
target_channel_title=created.target_channel.title,
|
||||
external_channel_id=created.external_channel_id,
|
||||
external_channel_title=created.external_channel.title,
|
||||
creative_id=created.creative_id,
|
||||
creative_name=created.creative.name,
|
||||
placement_date=created.placement_date,
|
||||
cost=created.cost,
|
||||
comment=created.comment,
|
||||
ad_post_url=created.ad_post_url,
|
||||
invite_link_type=created.invite_link_type,
|
||||
invite_link=created.invite_link,
|
||||
status=created.status,
|
||||
subscriptions_count=created.subscriptions_count,
|
||||
views_count=created.views_count,
|
||||
created_at=created.created_at,
|
||||
)
|
||||
# Формируем ответ внутри транзакции, пока объекты в сессии
|
||||
return dto.PurchaseOutput(
|
||||
id=created.id,
|
||||
target_channel_id=created.target_channel_id,
|
||||
target_channel_title=target_channel.title,
|
||||
external_channel_id=created.external_channel_id,
|
||||
external_channel_title=external_channel.title,
|
||||
creative_id=created.creative_id,
|
||||
creative_name=creative.name,
|
||||
placement_date=created.placement_date,
|
||||
cost=created.cost,
|
||||
comment=created.comment,
|
||||
ad_post_url=created.ad_post_url,
|
||||
invite_link_type=created.invite_link_type,
|
||||
invite_link=created.invite_link,
|
||||
status=created.status,
|
||||
subscriptions_count=created.subscriptions_count,
|
||||
views_count=created.views_count,
|
||||
views_availability=created.views_availability,
|
||||
last_views_fetch_at=created.last_views_fetch_at,
|
||||
created_at=created.created_at,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user