@ -3,14 +3,14 @@ from controllers.admin.wraps import validate_admin_token_and_extract_info
from fields . end_user_fields import end_users_infinite_scroll_pagination_fields
from fields . end_user_fields import end_users_infinite_scroll_pagination_fields
from flask import Blueprint
from flask import Blueprint
from flask_restful import Api , Resource , marshal_with # type: ignore
from flask_restful import Api , Resource , marshal_with # type: ignore
from models . model import A pp
from models . model import A ccount, A pp
from services . end_user_service import EndUserService
from services . end_user_service import EndUserService
class StudentList ( Resource ) :
class StudentList ( Resource ) :
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
@marshal_with ( end_users_infinite_scroll_pagination_fields )
@marshal_with ( end_users_infinite_scroll_pagination_fields )
def get ( self , app_model : App ):
def get ( self , app_model : App , account : Account ):
""" Get all end_user list related with the app_model with filters with pagination.
""" Get all end_user list related with the app_model with filters with pagination.
- - -
- - -
tags :
tags :
@ -88,6 +88,8 @@ class StudentList(Resource):
type : string
type : string
major :
major :
type : string
type : string
organization_id :
type : string
401 :
401 :
description : Invalid or missing API key
description : Invalid or missing API key
400 :
400 :
@ -133,12 +135,18 @@ class StudentList(Resource):
# Get students with pagination
# Get students with pagination
offset = ( page - 1 ) * limit
offset = ( page - 1 ) * limit
return EndUserService . pagination_by_filters ( app_model = app_model , filters = filters , offset = offset , limit = limit )
# Get the organization ID from the account
organization_id = account . current_organization_id
# Use the organization ID for filtering students by organization
return EndUserService . pagination_by_filters (
app_model = app_model , filters = filters , offset = offset , limit = limit , organization_id = organization_id
)
class StudentAnalysis ( Resource ) :
class StudentAnalysis ( Resource ) :
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
def get ( self , app_model : App ) :
def get ( self , app_model : App , account : Account ):
""" Get AI analysis and intervention suggestions.
""" Get AI analysis and intervention suggestions.
- - -
- - -
tags :
tags :
@ -181,7 +189,7 @@ class StudentAnalysis(Resource):
class StudentStatus ( Resource ) :
class StudentStatus ( Resource ) :
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
def put ( self , app_model : App ):
def put ( self , app_model : App , account : Account ):
""" Update student follow-up status.
""" Update student follow-up status.
- - -
- - -
tags :
tags :
@ -234,7 +242,7 @@ class StudentStatus(Resource):
pass
pass
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
def get ( self , app_model : App ):
def get ( self , app_model : App , account : Account ):
""" Get student follow-up status history.
""" Get student follow-up status history.
- - -
- - -
tags :
tags :
@ -282,7 +290,7 @@ class StudentStatus(Resource):
class StudentNote ( Resource ) :
class StudentNote ( Resource ) :
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
def put ( self , app_model : App ):
def put ( self , app_model : App , account : Account ):
""" Update student follow-up note.
""" Update student follow-up note.
- - -
- - -
tags :
tags :
@ -331,7 +339,7 @@ class StudentNote(Resource):
pass
pass
@validate_admin_token_and_extract_info
@validate_admin_token_and_extract_info
def get ( self , app_model : App ):
def get ( self , app_model : App , account : Account ):
""" Get student follow-up note history.
""" Get student follow-up note history.
- - -
- - -
tags :
tags :