refactor: switch to free-trial/private-deploy/buyout pricing, fix feature gaps, add SEO landing + deploy config
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from pydantic import BaseModel, EmailStr
|
||||
from app.database import get_db
|
||||
from app.models.enterprise_lead import EnterpriseLead
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
class LeadCreate(BaseModel):
|
||||
type: str # private | buyout
|
||||
name: str
|
||||
company: str = ""
|
||||
phone: str = ""
|
||||
email: str = ""
|
||||
message: str = ""
|
||||
|
||||
|
||||
@router.post("")
|
||||
async def create_lead(payload: LeadCreate, db: AsyncSession = Depends(get_db)):
|
||||
if payload.type not in ("private", "buyout"):
|
||||
raise HTTPException(status_code=400, detail="Invalid lead type")
|
||||
lead = EnterpriseLead(
|
||||
type=payload.type,
|
||||
name=payload.name,
|
||||
company=payload.company,
|
||||
phone=payload.phone,
|
||||
email=payload.email,
|
||||
message=payload.message,
|
||||
)
|
||||
db.add(lead)
|
||||
await db.flush()
|
||||
await db.refresh(lead)
|
||||
return {"id": lead.id, "type": lead.type, "status": lead.status}
|
||||
Reference in New Issue
Block a user