feat: add workspace
This commit is contained in:
@@ -14,13 +14,19 @@ log = logging.getLogger(__name__)
|
||||
async def get_creatives_analytics(
|
||||
self: 'Usecase', input: dto.GetCreativesAnalyticsInput
|
||||
) -> dto.GetCreativesAnalyticsOutput:
|
||||
await self.ensure_workspace_access(input.workspace_id, input.user_id)
|
||||
|
||||
if input.target_channel_id:
|
||||
target_channel = await self.database.get_target_channel(input.user_id, input.target_channel_id)
|
||||
target_channel = await self.database.get_target_channel(input.workspace_id, input.target_channel_id)
|
||||
if not target_channel:
|
||||
raise domain.TargetChannelNotFound(input.target_channel_id)
|
||||
|
||||
creatives = await self.database.get_user_creatives(input.user_id, input.target_channel_id, include_archived=False)
|
||||
placements = await self.database.get_user_placements(input.user_id, input.target_channel_id, include_archived=False)
|
||||
creatives = await self.database.get_workspace_creatives(
|
||||
input.workspace_id, input.target_channel_id, include_archived=False
|
||||
)
|
||||
placements = await self.database.get_workspace_placements(
|
||||
input.workspace_id, input.target_channel_id, include_archived=False
|
||||
)
|
||||
|
||||
@dataclass
|
||||
class CreativeStats:
|
||||
|
||||
Reference in New Issue
Block a user