35 lines
874 B
Python
35 lines
874 B
Python
from fastapi import APIRouter, HTTPException
|
|
import uuid
|
|
|
|
contacts = [] # In-memory storage
|
|
|
|
router = APIRouter()
|
|
|
|
@router.post("/signup")
|
|
async def signup_ngo(
|
|
name: str = "Organization Name",
|
|
email: str = "org@example.com",
|
|
phone: str = "123-456-7890"
|
|
):
|
|
"""NGO signup endpoint"""
|
|
if any(c["email"] == email for c in contacts):
|
|
raise HTTPException(status_code=400, detail="Email already registered")
|
|
|
|
contact_id = str(uuid.uuid4())
|
|
contacts.append({
|
|
"id": contact_id,
|
|
"name": name,
|
|
"email": email,
|
|
"phone": phone,
|
|
"status": "pending"
|
|
})
|
|
|
|
return {
|
|
"message": "Contact request submitted successfully",
|
|
"contact_id": contact_id,
|
|
"name": name,
|
|
"next_steps": [
|
|
"Check email for confirmation",
|
|
"Schedule orientation call"
|
|
]
|
|
} |