feat: убираем денормализацию (антипреждевременная оптимизация)

This commit is contained in:
Artem Tsyrulnikov
2025-12-16 10:04:20 +03:00
parent 2339471956
commit 18b30eaf7f
26 changed files with 295 additions and 232 deletions

View File

@@ -230,6 +230,17 @@ class Database(typing.Protocol):
self, subscriber_id: UUID, project_id: UUID
) -> domain.Subscription | None: ...
# Count methods
async def count_placements_by_creative(self, creative_id: UUID) -> int: ...
async def count_subscriptions_by_placement(self, placement_id: UUID) -> int: ...
async def count_placements_by_creative_batch(self, creative_ids: list[UUID]) -> dict[UUID, int]: ...
async def count_subscriptions_by_placement_batch(self, placement_ids: list[UUID]) -> dict[UUID, int]: ...
async def has_placements_for_creative(self, creative_id: UUID) -> bool: ...
# Post methods
async def create_post(self, post: domain.Post) -> None: ...