- Updated requirements to include asyncpg, pyyaml, aiofiles, and httpx. - Modified schema.sql to add 'tipo_pasto' column in 'pasti' table. - Created .gitignore file to exclude unnecessary files and directories. - Added README.md for API implementation details and directory structure. - Introduced config.yaml for centralized configuration management. - Implemented core modules for database management, authentication, and exception handling. - Developed models for 'pietanze', 'pasti', and 'prenotazioni' with validation. - Created routes for CRUD operations on 'pietanze' with pagination and filtering. - Established logging and error handling mechanisms throughout the application. - Set up FastAPI application with CORS and health check endpoint.
15 lines
298 B
Python
15 lines
298 B
Python
from pydantic import BaseModel
|
|
from typing import List, Optional, Any
|
|
|
|
class ErrorResponse(BaseModel):
|
|
error: str
|
|
detail: Optional[str] = None
|
|
code: Optional[str] = None
|
|
|
|
class PaginatedResponse(BaseModel):
|
|
items: List[Any]
|
|
total: int
|
|
page: int
|
|
size: int
|
|
pages: int
|