Commit graph

127 commits

Author SHA1 Message Date
JakkrapartXD
af14610442 feat: Add token-based authorization to category deletion and enhance user registration with error handling and audit logging. 2026-02-13 14:54:45 +07:00
JakkrapartXD
45941fbe6c feat: Add error audit logging to instructor course operations and implement status filtering for listing courses. 2026-02-13 14:45:59 +07:00
JakkrapartXD
8edc3770eb feat: Allow instructors to set rejected courses to draft and explicitly set course status to rejected upon administrative rejection.
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 30s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 3s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
Build and Deploy Frontend Management to Dev Server / Build Frontend Management Docker Image (push) Successful in 18s
Build and Deploy Frontend Management to Dev Server / Deploy E-learning Frontend Management to Dev Server (push) Successful in 3s
Build and Deploy Frontend Management to Dev Server / Notify Deployment Status (push) Successful in 1s
2026-02-11 17:01:17 +07:00
JakkrapartXD
840eae4fad refactor: update toggleRecommended endpoint to accept is_recommended as a query parameter and remove the ToggleRecommendedRequest type. 2026-02-11 15:04:10 +07:00
JakkrapartXD
4ca5692e6f fix: update types for quiz attempts in lesson content
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 27s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 4s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
- Add allow_multiple_attempts and latest_attempt to quiz type
- Make quiz fields optional to support conditional return
- Fix AuditAction enum usage in RecommendedCourses service
2026-02-11 15:01:58 +07:00
JakkrapartXD
df750723af feat: add quiz attempt logic to getlessonContent
- Check allow_multiple_attempts setting when returning quiz data
- If allow_multiple_attempts is false AND user has attempted:
  - Return only quiz metadata and latest score
  - Do NOT return questions
- If allow_multiple_attempts is true OR user has not attempted:
  - Return full quiz with questions
  - Include latest_attempt data if exists
- Add latest_attempt field to quiz response with score and attempt info
2026-02-11 15:01:58 +07:00
JakkrapartXD
f7330a7b27 feat: add recommended courses and quiz multiple attempts
- Add is_recommended field to Course model
- Add allow_multiple_attempts field to Quiz model
- Create RecommendedCoursesController for admin management
  - List all approved courses
  - Get course by ID
  - Toggle recommendation status
- Add is_recommended filter to CoursesService.ListCourses
- Add allow_multiple_attempts to quiz update and response types
- Update ChaptersLessonService.updateQuiz to support allow_multiple_attempts
2026-02-11 15:01:58 +07:00
JakkrapartXD
623f797763 feat: add is_recommended to Course and allow_multiple_attempts to Quiz
- Add is_recommended field to Course model (default: false)
- Add allow_multiple_attempts field to Quiz model (default: true)
- Create migration: add_recommended_and_quiz_attempts
2026-02-11 15:01:58 +07:00
JakkrapartXD
d63c986c6f chore: Update Prisma seed script with new data.
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 29s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 4s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
2026-02-10 15:58:53 +07:00
JakkrapartXD
ff91df2bd6 build: add openssl package to Dockerfile dependencies
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 44s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 12s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
2026-02-10 15:33:05 +07:00
JakkrapartXD
c1254520b4 refactor: Optimize Docker build process, switch to @node-rs/bcrypt, and streamline compose.yaml by removing external services.
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 45s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 12s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 1s
2026-02-10 15:27:13 +07:00
JakkrapartXD
d2e78dcfbb feat: Implement local backend development setup with Docker Compose, introduce .dockerignore, and remove dev dependency pruning from the Dockerfile.
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 32s
Build and Deploy Frontend Learner / Build Frontend Learner Docker Image (push) Successful in 34s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 3s
Build and Deploy Frontend Learner / Deploy E-learning Frontend Learner to Dev Server (push) Successful in 2s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 2s
Build and Deploy Frontend Learner / Notify Deployment Status (push) Successful in 2s
2026-02-10 14:26:09 +07:00
JakkrapartXD
8c495f3871 fix: enable build scripts for bcrypt and prisma native modules
All checks were successful
Build and Deploy Backend / Build Backend Docker Image (push) Successful in 45s
Build and Deploy Backend / Deploy E-learning Backend to Dev Server (push) Successful in 2s
Build and Deploy Backend / Notify Deployment Status (push) Successful in 2s
- Add build dependencies (python3, make, g++) to both builder and production stages
- Use --ignore-scripts=false flag to ensure native modules compile
- Fixes MODULE_NOT_FOUND error for bcrypt_lib.node
2026-02-10 13:08:46 +07:00
JakkrapartXD
3cf745cd14 fix Dockerfile prisma client generation
Some checks failed
Build and Deploy Backend / Build Backend Docker Image (push) Failing after 1m4s
Build and Deploy Backend / Deploy Backend to Server (push) Has been skipped
2026-02-10 09:34:14 +07:00
JakkrapartXD
199278d6f5 Add @tsoa/runtime dependency to backend package.json
Some checks failed
Build and Deploy Backend / Build Backend Docker Image (push) Failing after 58s
Build and Deploy Frontend Learner / Build Frontend Learner Docker Image (push) Failing after 1m16s
Build and Deploy Backend / Deploy Backend to Server (push) Has been skipped
Build and Deploy Frontend Learner / Deploy Frontend Learner to Server (push) Has been skipped
2026-02-10 09:28:44 +07:00
JakkrapartXD
4ec1d34297 add workflow
Some checks failed
Build and Deploy Frontend Learner / Build Frontend Learner Docker Image (push) Failing after 9s
Build and Deploy Frontend Learner / Deploy Frontend Learner to Server (push) Has been skipped
Build and Deploy Frontend Management / Build Frontend Management Docker Image (push) Failing after 9s
Build and Deploy Backend / Build Backend Docker Image (push) Failing after 9s
Build and Deploy Frontend Management / Deploy Frontend Management to Server (push) Has been skipped
Build and Deploy Backend / Deploy Backend to Server (push) Has been skipped
2026-02-09 16:56:12 +07:00
JakkrapartXD
3f93dc8ab5 feat: add pagination and random sorting to course listing endpoint with configurable page size and Fisher-Yates shuffle algorithm 2026-02-06 17:41:03 +07:00
JakkrapartXD
eeba244797 a 2026-02-06 15:26:04 +07:00
JakkrapartXD
832a8f5067 feat: add course approval history endpoint for instructors to view rejection reasons and approval timeline 2026-02-06 14:52:10 +07:00
JakkrapartXD
11c747edab fix: separate error messages for approved and pending course edit restrictions 2026-02-06 14:34:22 +07:00
JakkrapartXD
50ff78c594 chore: remove tests from .gitignore and add presigned URLs for course thumbnails in admin approval service 2026-02-06 14:18:00 +07:00
JakkrapartXD
ab9e948fd1 chore: add tests directory to .gitignore 2026-02-06 12:59:48 +07:00
JakkrapartXD
ff63567e86 fix: lower video completion threshold from 99% to 95% 2026-02-06 12:59:48 +07:00
JakkrapartXD
108f1b73f2 feat: integrate audit logging across authentication, course management, and user operations
Add comprehensive audit trail tracking by integrating auditService throughout the application. Track user authentication (LOGIN, REGISTER), course lifecycle (CREATE, APPROVE_COURSE, REJECT_COURSE, ENROLL), content management (CREATE/DELETE Chapter/Lesson), file operations (UPLOAD_FILE, DELETE_FILE for videos and attachments), password management (CHANGE_PASSWORD, RESET_PASSWORD), user role updates (UPDATE
2026-02-05 17:35:37 +07:00
JakkrapartXD
7465af1cb9 feat: add audit log system with comprehensive action tracking and user activity monitoring
Introduce AuditLog model to track system-wide user actions including authentication, course management, file operations, and user account changes. Add AuditAction enum with 17 action types (CREATE, UPDATE, DELETE, LOGIN, LOGOUT, ENROLL, UNENROLL, SUBMIT_QUIZ, APPROVE_COURSE, REJECT_COURSE, UPLOAD_FILE, DELETE_FILE, CHANGE_PASSWORD, RESET_PASSWORD, VERIFY_EMAIL, DEACTIVATE_USER, ACTIVATE_USER). Include fields
2026-02-05 15:07:07 +07:00
JakkrapartXD
a0b93978a7 feat: add presigned URL generation for user avatar URLs in user management service
Convert formatUserResponse to async method to support presigned URL generation for avatar_url field. Add getAvatarPresignedUrl helper method to generate 1-hour expiry presigned URLs for user avatars. Update listUsers and getUserById to await formatUserResponse calls.
2026-02-04 16:54:44 +07:00
JakkrapartXD
2728af9efe feat: increase video auto-completion threshold from 90% to 99% progress 2026-02-04 16:48:05 +07:00
JakkrapartXD
05755992a7 feat: add published_at field support to announcements with scheduled publishing and student visibility filtering
Add published_at field to announcement creation and updates, allowing instructors to schedule announcement publishing. Update student announcement filtering to only show PUBLISHED announcements where published_at <= now. Modify announcement creation to set published_at to provided value or current time for PUBLISHED status. Update announcement updates to handle published_at changes while
2026-02-04 16:15:38 +07:00
JakkrapartXD
7e8c8e2532 feat: fix quiz scoring to use Choice model correctness, add YouTube video support to lesson content, and include show_answers_after_completion in quiz data
Update quiz attempt detail scoring to determine correctness from Choice.is_correct instead of StudentAnswer.is_correct and calculate earned score based on correctness. Add YouTube video support to getLessonContent endpoint by checking LessonAttachment for YouTube videos (mime_type 'video/youtube') and building YouTube URLs from video IDs. Ad
2026-02-04 14:19:17 +07:00
JakkrapartXD
ff841c7638 feat: add search and filter capabilities to student and quiz endpoints, implement YouTube video support for lessons
Add search and status filter parameters to getEnrolledStudents endpoint to filter students by name/email/username and enrollment status. Add search and isPassed filter parameters to getQuizScores endpoint to filter quiz results by student details and pass status. Remove separate searchStudents endpoint as its functionality is now integrated into getEnrolledStudents. Add setYouTubeVideo endpoint to
2026-02-03 17:23:47 +07:00
JakkrapartXD
52d86400b3 feat: add prerequisite_lesson_ids field to UpdateLessonBody interface
Add prerequisite_lesson_ids optional field to UpdateLessonBody interface to support lesson prerequisite management during lesson updates.
2026-02-03 14:52:35 +07:00
JakkrapartXD
7749a39be7 feat: add enrolled student detail endpoint and reorder student endpoints
Add getEnrolledStudentDetail endpoint to retrieve individual student's lesson progress across all course chapters. Move searchStudents endpoint before getEnrolledStudentDetail to prevent route conflicts. Remove correct_choice_id and correct_choice_text from quiz attempt detail answers review. Fix selected_choice_id mapping to use choice_id from student answers.
2026-02-03 14:42:45 +07:00
JakkrapartXD
c07d847955 feat: add sort_order field to quiz attempt detail answers review
Add sort_order field to answers_review in QuizAttemptDetailData interface and include it in getQuizAttemptDetail response to maintain question ordering in quiz attempt reviews.
2026-02-03 11:59:18 +07:00
JakkrapartXD
06db182c46 feat: add email_verified_at field to auth controller mock responses and user management service
Add email_verified_at field to mock user responses in login, registerInstructor, and registerStudent endpoints. Include email_verified_at in UserManagementService user response mapping to ensure consistency across all user-related endpoints.
2026-02-03 10:41:06 +07:00
JakkrapartXD
48e8f56e22 feat: update instructor search to exclude self and existing course instructors, add email_verified_at to user responses
Update searchInstructors endpoint to accept courseId parameter and filter out the requesting instructor and instructors already assigned to the course. Add email_verified_at field to UserResponse type and include it in auth and user service responses.
2026-02-03 10:38:59 +07:00
JakkrapartXD
80d7372dfa feat: add instructor endpoints for student progress tracking and quiz score management
Add four new instructor endpoints: getEnrolledStudents to view all enrolled students with progress, getQuizScores to view quiz scores for all students in a lesson, getQuizAttemptDetail to view detailed quiz attempt for a specific student, and searchStudents to search enrolled students by name/email/username. Add getQuizAttempts endpoint for students to retrieve their own quiz attempt history. All endpoints include
2026-02-02 18:02:19 +07:00
JakkrapartXD
ec67c7c6b6 feat: normalize chapter sort_order to prevent gaps and duplicates in course chapters
Add normalizeChapterSortOrder method to ensure sequential 1-based sort_order values. Update reorderChapter to normalize before reordering and validate new position against chapter count. Call normalization after chapter deletion to fill gaps in remaining chapters.
2026-02-02 16:27:27 +07:00
JakkrapartXD
2b248cad10 feat: normalize lesson sort_order to prevent gaps and duplicates in chapter lessons
Add normalizeLessonSortOrder method to ensure sequential 1-based sort_order values. Update reorderLesson to normalize before reordering and validate new position against lesson count. Call normalization after lesson deletion to fill gaps in remaining lessons.
2026-02-02 16:16:28 +07:00
JakkrapartXD
69e4806831 feat: normalize question sort_order to prevent gaps and duplicates in quiz questions
Add normalizeQuestionSortOrder method to ensure sequential 1-based sort_order values. Update reorderQuestion to normalize before reordering and validate new position against question count. Call normalization after question deletion to fill gaps in remaining questions.
2026-02-02 15:50:23 +07:00
JakkrapartXD
7ac1a5af0a feat: remove published status check when deleting lessons
Remove validation that prevented deletion of published lessons. Lessons can now be deleted regardless of their published status without requiring unpublishing first.
2026-02-02 14:34:17 +07:00
JakkrapartXD
b7e4f45942 feat: add student endpoint for listing course announcements
Add new AnnouncementsStudentController with GET endpoint for students to retrieve course announcements with pagination support. Endpoint requires JWT authentication and validates course enrollment.
2026-02-02 11:49:23 +07:00
JakkrapartXD
18b8f4501f feat: add is_skippable field to Quiz model with default value true
Add is_skippable boolean field to Quiz schema, update quiz creation and update logic to handle the new field, and include it in student course content responses. Update seed data and type definitions accordingly.
2026-02-02 11:17:20 +07:00
JakkrapartXD
d7f824f353 feat: standardize login response format with code, message, and data wrapper
Update login endpoint to return consistent API response structure with code, message, and data fields. Wrap token, refreshToken, and user data inside a data object to match the standardized response format used across other endpoints.
2026-01-30 17:54:43 +07:00
JakkrapartXD
4ff57555a2 feat: conditionally hide correct_answers count based on show_answers_after_completion setting
Update quiz submission response to respect the show_answers_after_completion setting by conditionally including the correct_answers count. When show_answers_after_completion is false, correct_answers is now undefined instead of being exposed.
2026-01-30 17:51:33 +07:00
JakkrapartXD
bf5d939910 feat: add role-based frontend URL routing for password reset and email verification
Add separate frontend URL environment variables for student and instructor portals. Update password reset and email verification services to route users to the appropriate frontend based on their role (INSTRUCTOR vs STUDENT).
2026-01-30 17:29:08 +07:00
JakkrapartXD
16322454b1 feat: change default is_published value to true for chapters and lessons 2026-01-30 17:16:21 +07:00
JakkrapartXD
10a71c9a15 feat: standardize category update response format with code, message, and data wrapper 2026-01-30 15:23:29 +07:00
JakkrapartXD
14c1222a4e a 2026-01-30 08:02:50 +00:00
JakkrapartXD
babccc4869 feat: add email verification endpoints with token-based verification and SMTP integration 2026-01-30 14:53:50 +07:00
JakkrapartXD
9ed2347843 feat: add certificate generation system with PDF template and Thai font support 2026-01-30 14:14:00 +07:00