feat: Enhance Hackathon Timeline Management and Admin Features
- Updated HackathonTimelineCreateRequestDto to accept optional title and name fields. - Added custom validators for HackathonPhase and date checks in hackathon_dto.rs. - Implemented admin-sensitive data management DTOs for handling user scores and personal info. - Introduced new admin routes for managing users, roles, and permissions in IAM module. - Added timeline enforcement middleware to restrict access based on hackathon phases. - Created tests for timeline enforcement and admin permissions to ensure proper access control. - Implemented payment middleware as a placeholder for future payment processing logic. - Enhanced audit logging middleware for improved error handling and logging.
This commit is contained in:
@@ -9,20 +9,28 @@ pub use hackathon::hackathon_router;
|
||||
pub fn hackathon_protected_routes() -> Router {
|
||||
// Protected routes include the main hackathon router (create/update/delete) and
|
||||
// a protected route for updating submission status.
|
||||
use hackathon::hackathon_controller::update_submission_status;
|
||||
use hackathon::hackathon_controller::{update_submission_status, get_admin_hackathon_results};
|
||||
Router::new()
|
||||
.nest("/hackathons", hackathon_router())
|
||||
.route("/hackathons/submissions/{id}/status", axum::routing::patch(update_submission_status))
|
||||
.route("/hackathons/{hackathon_id}/admin/results", axum::routing::get(get_admin_hackathon_results))
|
||||
}
|
||||
|
||||
// Public routes for hackathons (only listing and retrieving)
|
||||
pub fn hackathon_public_routes() -> Router {
|
||||
use hackathon::hackathon_controller::{list_hackathons, get_hackathon};
|
||||
use hackathon::hackathon_controller::{search_hackathons, get_user_hackathon_submissions};
|
||||
use hackathon::hackathon_controller::{
|
||||
list_hackathons,
|
||||
get_hackathon,
|
||||
search_hackathons,
|
||||
get_user_hackathon_submissions,
|
||||
get_public_hackathon_results,
|
||||
};
|
||||
|
||||
Router::new()
|
||||
.nest("/hackathons", Router::new()
|
||||
.route("/", axum::routing::get(list_hackathons))
|
||||
.route("/{id}", axum::routing::get(get_hackathon))
|
||||
.route("/{id}/results", axum::routing::get(get_public_hackathon_results))
|
||||
.route("/search", axum::routing::post(search_hackathons))
|
||||
)
|
||||
.route("/users/{user_id}/hackathon-submissions", axum::routing::get(get_user_hackathon_submissions))
|
||||
|
||||
Reference in New Issue
Block a user