Creates a new ContentController instance with initialized content service
Initialized Prisma client for database operations
Creates a new course with comprehensive validation and proper response formatting. Validates request data using Zod schema, handles optional properties correctly, and returns standardized API response with created course data.
Express request object with course data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a single course by its unique identifier with complete course information. Validates course ID parameter and returns standardized API response with course data.
Express request object with course ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a paginated list of courses with advanced filtering, searching, and sorting capabilities. Supports pagination middleware integration, search functionality, and comprehensive response headers for client-side pagination handling.
Express request object with pagination options from middleware or query params
Express response object for sending HTTP response with pagination headers
Express next function for error handling
Promise that resolves when response is sent
Updates an existing course with partial data and comprehensive validation. Validates course ID parameter and update data, then returns updated course information.
Express request object with course ID in params and update data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Deletes a course and all associated content with cascade deletion handling. Validates course ID parameter and performs secure deletion with proper response formatting.
Express request object with course ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a complete packaged course with all hierarchical content and advanced caching support. Implements conditional requests using If-Modified-Since headers and comprehensive caching strategies for optimal content delivery performance.
Express request object with course ID in params and optional If-Modified-Since header
Express response object for sending HTTP response with caching headers
Express next function for error handling
Promise that resolves when response is sent
Creates a new level within a specified course with hierarchical relationship management. Validates course ID parameter, merges it with level data, and creates the level with proper parent-child relationship establishment.
Express request object with course ID in params and level data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a single level by its unique identifier with complete level information. Validates level ID parameter and returns standardized API response with level data.
Express request object with level ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a paginated list of levels within a specific course with hierarchical ordering. Supports pagination middleware integration, search functionality, and proper ordering by level sequence within the course structure.
Express request object with course ID in params and pagination options
Express response object for sending HTTP response with pagination headers
Express next function for error handling
Promise that resolves when response is sent
Updates an existing level with partial data and comprehensive validation. Validates level ID parameter and update data, then returns updated level information.
Express request object with level ID in params and update data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Deletes a level and all associated content with cascade deletion handling. Validates level ID parameter and performs secure deletion with proper response formatting.
Express request object with level ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Creates a new section within a specified level with hierarchical relationship management. Validates level ID parameter, merges it with section data, and creates the section with proper parent-child relationship establishment.
Express request object with level ID in params and section data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a single section by its unique identifier with complete section information. Validates section ID parameter and returns standardized API response with section data.
Express request object with section ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a paginated list of sections within a specific level with hierarchical ordering. Supports pagination middleware integration, search functionality, and proper ordering by section sequence within the level structure.
Express request object with level ID in params and pagination options
Express response object for sending HTTP response with pagination headers
Express next function for error handling
Promise that resolves when response is sent
Updates an existing section with partial data and comprehensive validation. Validates section ID parameter and update data, then returns updated section information.
Express request object with section ID in params and update data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Deletes a section and all associated content with cascade deletion handling. Validates section ID parameter and performs secure deletion with proper response formatting.
Express request object with section ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Creates a new module within a specified section with hierarchical relationship management. Validates section ID parameter, merges it with module data, and creates the module with proper parent-child relationship establishment and module type validation.
Express request object with section ID in params and module data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a single module by its unique identifier with complete module information. Validates module ID parameter and returns standardized API response with module data including module type and hierarchical context.
Express request object with module ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Retrieves a paginated list of modules within a specific section with type filtering support. Supports pagination middleware integration, search functionality, module type filtering, and proper ordering by module sequence within the section structure.
Express request object with section ID in params and pagination options
Express response object for sending HTTP response with pagination headers
Express next function for error handling
Promise that resolves when response is sent
Updates an existing module with partial data and comprehensive validation. Validates module ID parameter and update data, supports module type changes, and returns updated module information with proper type validation.
Express request object with module ID in params and update data in body
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Deletes a module and all associated content with cascade deletion handling. Validates module ID parameter and performs secure deletion with proper response formatting. Handles deletion of associated lessons and exercises through cascade operations.
Express request object with module ID in params
Express response object for sending HTTP response
Express next function for error handling
Promise that resolves when response is sent
Reorders modules within a section by updating their position sequence.
Extracts section ID from URL parameters, validates request body against ReorderModulesSchema, delegates module reordering to the service layer, and returns a standardized API response with HTTP 200 status indicating successful reordering operation.
Express request object containing sectionId in params and module_ids array in body
Express response object for sending HTTP response
Express next function for error handling middleware
Resolves when response is sent or error is passed to middleware
Reorders sections within a level by updating their position sequence.
Extracts level ID from URL parameters, validates request body against ReorderSectionsSchema, delegates section reordering to the service layer, and returns a standardized API response with HTTP 200 status indicating successful reordering operation.
Express request object containing level ID in params and section IDs in body
Express response object for sending the API response
Express next function for error handling middleware
Resolves when response is sent or error is passed to middleware
Reorders levels within a course by updating their position sequence.
Extracts course ID from URL parameters, validates request body against ReorderLevelsSchema, delegates level reordering to the service layer, and returns a standardized API response with HTTP 200 status indicating successful reordering operation.
Express request object containing course ID in params and level IDs in body
Express response object for sending the API response
Express next function for error handling middleware
Resolves when response is sent or error is passed to middleware
Content controller class providing comprehensive REST API endpoints for hierarchical content management. Implements full CRUD operations for courses, levels, sections, and modules with advanced querying, pagination, caching, and security features.