Add frontend project structure with React/TypeScript setup

This commit is contained in:
Newzy Developer committed 2026-10-30 10:53:31 +00:00
1 parent c7abb73c66
commit 6914a6855c
58 files changed
+9056 -236

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
"""
Pydantic schemas for Author model.
"""
from typing import Optional
from pydantic import BaseModel, EmailStr, Field
class AuthorBase(BaseModel):
"""Base author schema."""
name: str = Field(..., min_length=1, max_length=100)
email: EmailStr
bio: Optional[str] = Field(None, max_length=1000)
class AuthorCreate(AuthorBase):
"""Schema for creating a new author."""
pass
class AuthorUpdate(BaseModel):
"""Schema for updating an author."""
name: Optional[str] = Field(None, min_length=1, max_length=100)
email: Optional[EmailStr] = None
bio: Optional[str] = Field(None, max_length=1000)
class AuthorResponse(AuthorBase):
"""Schema for author response."""
id: int
class Config:
from_attributes = True