90% сеньоров плачат на таких коммитах

This commit is contained in:
Artem Tsyrulnikov
2025-12-15 19:10:41 +03:00
parent fda91cb6d8
commit 71e5a38efc
42 changed files with 403 additions and 302 deletions

View File

@@ -21,17 +21,20 @@ async def get_views_history(self: 'Usecase', input: dto.GetViewsHistoryInput) ->
context.ensure_project_permission(domain.PermissionKey.PLACEMENTS_READ, placement.project_id)
if not placement.post:
return dto.GetViewsHistoryOutput(histories=[])
histories = await self.database.get_views_history(
input.placement_id,
placement.post.id,
from_date=input.from_date,
to_date=input.to_date,
)
return dto.GetViewsHistoryOutput(
histories=[
dto.PlacementViewsHistoryOutput(
dto.PostViewsHistoryOutput(
id=history.id,
placement_id=history.placement_id,
post_id=history.post_id,
views_count=history.views_count,
fetched_at=history.fetched_at,
created_at=history.created_at,