parameters: (self, project_id)
docstring: Get all user activity on a project
          ---
          tags:
            - projects
          produces:
            - application/json
          parameters:
              - name: project_id
                in: path
                description: Unique project ID
                required: true
                type: integer
                default: 1
              - in: query
                name: page
                description: Page of results user requested
                type: integer
          responses:
              200:
                  description: Project activity
              404:
                  description: No activity
              500:
                  description: Internal Server Error
docstring_summary: Get all user activity on a project
          ---
          tags:
            - projects
          produces:
            - application/json
          parameters:
              - name: project_id
                in: path
                description: Unique project ID
                required: true
                type: integer
                default: 1
              - in: query
                name: page
                description: Page of results user requested
                type: integer
          responses:
              200:
                  description: Project activity
              404:
                  description: No activity
              500:
                  description: Internal Server Error
docstring_tokens: Get all user activity on a project --- tags : - projects produces : - application / json parameters : - name : project_id in : path description : Unique project ID required : true type : integer default : 1 - in : query name : page description : Page of results user requested type : integer responses : 200 : description : Project activity 404 : description : No activity 500 : description : Internal Server Error
function: def get(self, project_id):
          """
          Get all user activity on a project
          ---
          tags:
            - projects
          produces:
            - application/json
          parameters:
              - name: project_id
                in: path
                description: Unique project ID
                required: true
                type: integer
                default: 1
              - in: query
                name: page
                description: Page of results user requested
                type: integer
          responses:
              200:
                  description: Project activity
              404:
                  description: No activity
              500:
                  description: Internal Server Error
          """
          try:
              ProjectService.exists(project_id)
          except NotFound as e:
              current_app.logger.error(f"Error validating project: {str(e)}")
              return {"Error": "Project not found"}, 404
  
          try:
              page = int(request.args.get("page")) if request.args.get("page") else 1
              activity = StatsService.get_latest_activity(project_id, page)
              return activity.to_primitive(), 200
          except Exception as e:
              error_msg = f"User GET - unhandled error: {str(e)}"
              current_app.logger.critical(error_msg)
              return {"Error": "Unable to fetch user activity"}, 500
function_tokens: def get ( self , project_id ) : try : ProjectService . exists ( project_id ) except NotFound as e : current_app . logger . error ( f"Error validating project: {str(e)}" ) return { "Error" : "Project not found" } , 404 try : page = int ( request . args . get ( "page" ) ) if request . args . get ( "page" ) else 1 activity = StatsService . get_latest_activity ( project_id , page ) return activity . to_primitive ( ) , 200 except Exception as e : error_msg = f"User GET - unhandled error: {str(e)}" current_app . logger . critical ( error_msg ) return { "Error" : "Unable to fetch user activity" } , 500