diff --git a/src/app.py b/src/app.py index 4ebb1d9..cab7d58 100644 --- a/src/app.py +++ b/src/app.py @@ -38,20 +38,51 @@ "schedule": "Mondays, Wednesdays, Fridays, 2:00 PM - 3:00 PM", "max_participants": 30, "participants": ["john@mergington.edu", "olivia@mergington.edu"] + }, + "Basketball Team": { + "description": "Competitive basketball training and games", + "schedule": "Mondays and Wednesdays, 4:00 PM - 5:30 PM", + "max_participants": 15, + "participants": ["alex@mergington.edu"] + }, + "Tennis Club": { + "description": "Learn tennis skills and participate in friendly matches", + "schedule": "Tuesdays and Thursdays, 4:00 PM - 5:00 PM", + "max_participants": 10, + "participants": ["jordan@mergington.edu"] + }, + "Drama Club": { + "description": "Perform in theatrical productions and develop acting skills", + "schedule": "Wednesdays and Fridays, 3:30 PM - 5:00 PM", + "max_participants": 25, + "participants": ["maya@mergington.edu"] + }, + "Art Studio": { + "description": "Explore painting, drawing, and sculpture techniques", + "schedule": "Mondays and Thursdays, 3:30 PM - 4:30 PM", + "max_participants": 18, + "participants": ["isabelle@mergington.edu"] + }, + "Debate Team": { + "description": "Develop critical thinking and public speaking through competitive debate", + "schedule": "Tuesdays, 3:30 PM - 5:00 PM", + "max_participants": 16, + "participants": ["nathan@mergington.edu"] + }, + "Science Club": { + "description": "Conduct experiments and explore scientific concepts", + "schedule": "Fridays, 4:00 PM - 5:30 PM", + "max_participants": 20, + "participants": ["lucas@mergington.edu", "avery@mergington.edu"] + }, + "Photography Class": { + "description": "Learn photography techniques and digital image editing", + "schedule": "Mondays and Wednesdays, 4:00 PM - 5:00 PM", + "max_participants": 15, + "participants": [] } } - -@app.get("/") -def root(): - return RedirectResponse(url="/static/index.html") - - -@app.get("/activities") -def get_activities(): - return activities - - @app.post("/activities/{activity_name}/signup") def signup_for_activity(activity_name: str, email: str): """Sign up a student for an activity""" @@ -62,6 +93,10 @@ def signup_for_activity(activity_name: str, email: str): # Get the specific activity activity = activities[activity_name] + # Validate student is not already signed up + if email in activity["participants"]: + raise HTTPException(status_code=400, detail="Student already signed up for this activity") + # Add student activity["participants"].append(email) return {"message": f"Signed up {email} for {activity_name}"}