Co-authored-by: Michael Chihlas <michael@resolutionflow.com> Co-committed-by: Michael Chihlas <michael@resolutionflow.com>
28 lines
872 B
Python
28 lines
872 B
Python
"""Pydantic schemas for Talk-to-Sales submissions."""
|
|
|
|
from typing import Literal, Optional
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel, ConfigDict, EmailStr, Field
|
|
|
|
SalesLeadSource = Literal["pricing_page", "register_footer", "landing_page"]
|
|
|
|
|
|
class SalesLeadCreate(BaseModel):
|
|
"""Public Talk-to-Sales form submission."""
|
|
|
|
model_config = ConfigDict(str_strip_whitespace=True)
|
|
|
|
email: EmailStr
|
|
name: str = Field(..., min_length=1, max_length=255)
|
|
company: str = Field(..., min_length=1, max_length=255)
|
|
team_size: Optional[str] = Field(default=None, max_length=20)
|
|
message: Optional[str] = Field(default=None, max_length=5000)
|
|
source: SalesLeadSource
|
|
posthog_distinct_id: Optional[str] = Field(default=None, max_length=255)
|
|
|
|
|
|
class SalesLeadCreateResponse(BaseModel):
|
|
id: UUID
|
|
status: Literal["received"] = "received"
|