diff --git a/endpoints/signup.post.py b/endpoints/signup.post.py index 35aef9c..51ae03d 100644 --- a/endpoints/signup.post.py +++ b/endpoints/signup.post.py @@ -1,32 +1,30 @@ from fastapi import APIRouter, HTTPException -playlists = [ - { - "id": "playlist1", - "songs": [ - {"id": "song1", "title": "Song One", "artist": "Artist A"}, - {"id": "song2", "title": "Song Two", "artist": "Artist B"} - ] - } -] +customers = [] # In-memory storage router = APIRouter() -@router.post("/playlist/songs") -async def get_playlist_songs( - playlist_id: str = "playlist1" +@router.post("/signup") +async def list_customers( + store_id: str = "default_store", + page: int = 1, + limit: int = 10 ): - """Get songs from a playlist""" - playlist = next((p for p in playlists if p["id"] == playlist_id), None) - if not playlist: - raise HTTPException(status_code=400, detail="Playlist not found") + """Get list of store customers""" + if not any(c["store_id"] == store_id for c in customers): + raise HTTPException(status_code=400, detail="Store not found") + + store_customers = [c for c in customers if c["store_id"] == store_id] + start = (page - 1) * limit + end = start + limit return { - "message": "Songs retrieved successfully", - "playlist_id": playlist_id, - "songs": playlist["songs"], - "features": { - "total_songs": len(playlist["songs"]), - "can_shuffle": True + "message": "Customers retrieved successfully", + "store_id": store_id, + "customers": store_customers[start:end], + "pagination": { + "page": page, + "total": len(store_customers), + "pages": (len(store_customers) + limit - 1) // limit } } \ No newline at end of file