- New demo_requests table (SQLAlchemy model + Alembic-ready) - Public POST /api/demo-requests endpoint for the TapTrack website form - Super-admin GET/PUT/DELETE endpoints to manage leads - DemoRequestsPage.vue with stats row, filterable table, status updates, notes modal - Sidebar nav item and route registered
26 lines
1.1 KiB
Python
26 lines
1.1 KiB
Python
import uuid
|
|
from datetime import datetime, timezone
|
|
from sqlalchemy import String, DateTime, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from app.database import Base
|
|
|
|
|
|
class DemoRequest(Base):
|
|
__tablename__ = "demo_requests"
|
|
|
|
id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4()))
|
|
school_name: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
contact_person: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
phone_or_email: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
notes: Mapped[str | None] = mapped_column(Text, nullable=True)
|
|
status: Mapped[str] = mapped_column(String(50), default="new", nullable=False)
|
|
# "new" | "contacted" | "converted" | "dismissed"
|
|
submitted_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True), default=lambda: datetime.now(timezone.utc)
|
|
)
|
|
updated_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
default=lambda: datetime.now(timezone.utc),
|
|
onupdate=lambda: datetime.now(timezone.utc),
|
|
)
|