Files
armonia-api/app/schemas/service.py
T
kiskaadee effa1ee86c feat: scaffold FastAPI backend with Turso and anti-ghosting booking state machine
- Initialize project with uv, FastAPI, and libsql-client for Turso persistence
- Implement local SQLite fallback (`file:local.db`) for zero-friction development and testing
- Create schema and seeder with 9 therapy services from Armonía del Ser flyer
- Implement POST /bookings with automatic WhatsApp deep-link generation and SPEI instructions
- Implement POST /payments/verify 1-tap admin acknowledgment flow
- Add automated test suite with 5 passing tests and verification gates (ruff, pyright, pytest)
2026-10-18 09:01:34 -05:00

40 lines
1.1 KiB
Python

from __future__ import annotations
from typing import Literal
from pydantic import BaseModel, Field
class ServiceBase(BaseModel):
name: str = Field(..., min_length=2, max_length=150)
description: str | None = None
service_type: Literal["GROUP", "ONE_ON_ONE"]
modality: Literal["PRESENCIAL", "ONLINE"]
default_schedule: str | None = None
price_mxn: int = Field(..., ge=0)
max_capacity: int = Field(default=1, ge=1)
duration_minutes: int = Field(default=60, ge=15)
is_active: bool = True
class ServiceCreate(ServiceBase):
slug: str = Field(..., min_length=2, max_length=100)
class ServiceUpdate(BaseModel):
name: str | None = None
description: str | None = None
service_type: Literal["GROUP", "ONE_ON_ONE"] | None = None
modality: Literal["PRESENCIAL", "ONLINE"] | None = None
default_schedule: str | None = None
price_mxn: int | None = Field(default=None, ge=0)
max_capacity: int | None = Field(default=None, ge=1)
duration_minutes: int | None = Field(default=None, ge=15)
is_active: bool | None = None
class ServiceRead(ServiceBase):
id: str
slug: str
created_at: str