from auth.auth_view import RegisteredAuthorizedView from projects.services.project_team_service import ProjectTeamService from flask_apispec import marshal_with, doc from projects.schemas import team_counters_response_schema @doc(tags=['ProjectTeamCounters']) class ProjectTeamCountersView(RegisteredAuthorizedView): service = ProjectTeamService() @doc(description='Project team counters') @marshal_with(team_counters_response_schema, code=200, description='JSON with media plan.') @marshal_with(schema=None, code=401, description='User is not authenticated.') @marshal_with(schema=None, code=403, description='Access to project is forbidden') def get(self, project_id: int): self.permissions.can_access_project(project_id) return self.service.get_project_team_counters(project_id)