"""Profiles MVP API endpoints. Job ID: MTAD-IMPL-2025-11-18-CL""" from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from app.database import get_db from app.models import User, Profile router = APIRouter() @router.get("/{user_id}") async def get_profile(user_id: str, db: Session = Depends(get_db)): """Get user profile.""" profile = db.query(Profile).filter(Profile.user_id == user_id).first() if not profile: raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="Profile not found") return profile @router.put("/{user_id}") async def update_profile(user_id: str, display_name: str = None, bio: str = None, db: Session = Depends(get_db)): """Update profile (requires authentication).""" return {"message": "Profile update not yet implemented"} @router.get("/") async def list_public_profiles(skip: int = 0, limit: int = 20, db: Session = Depends(get_db)): """List public user profiles.""" profiles = db.query(Profile).offset(skip).limit(limit).all() return {"items": profiles}