Skip to content

Conversation

@MatthewBarghout
Copy link
Collaborator

Changes:

  1. New Model - backend/src/modules/student/student_model.py
  • Added IsRegisteredUpdate model with isRegistered: bool field for the PATCH request
  1. Service Method - backend/src/modules/student/student_service.py
  • Added update_is_registered(account_id, is_registered) method
  • When is_registered is True, sets last_registered to current datetime
  • When is_registered is False, sets last_registered to None
  1. Router Endpoint - backend/src/modules/student/student_router.py
  • Added PATCH /api/students/{student_id}/is-registered route
  • Authenticates as staff or admin (using authenticate_staff_or_admin)
  • Returns the updated Student DTO
  1. Tests - backend/test/modules/student/student_router_test.py
  • 5 new test cases covering:
    • Mark as registered (staff authentication)
    • Unmark as registered (admin authentication)
    • Student not found (404)
    • Unauthenticated access (401/403)
    • Toggle registration status multiple times

Closes: #88

@github-actions
Copy link

github-actions bot commented Nov 18, 2025

Test Results Summary

302 tests  +42   302 ✅ +42   7s ⏱️ -1s
  1 suites ± 0     0 💤 ± 0 
  1 files   ± 0     0 ❌ ± 0 

Results for commit 069f9cd. ± Comparison against base commit bfd9aa9.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@manyuagashe manyuagashe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No test coverage for student service file given the new attendance functionality. everything else looks good.

Update the registration status (attendance) for a student.
Staff can use this to mark students as present/absent.
"""
return await student_service.update_is_registered(student_id, data.isRegistered)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stick to convention for isRegistered, make it snake case instead (is_registered)

@manyuagashe manyuagashe merged commit e493961 into main Nov 25, 2025
2 checks passed
@naasanov naasanov deleted the student-attendance-route branch December 2, 2025 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Student Attendance Route

3 participants