2025-03-26 12:29:53 +00:00

43 lines
1.9 KiB
Python

from pydantic import BaseModel, Field
from typing import Optional
from datetime import datetime
from uuid import UUID
class PastorBase(BaseModel):
name: str = Field(..., min_length=2, max_length=100, description="Pastor's full name")
church_name: str = Field(..., min_length=2, max_length=200, description="Name of the church")
location: str = Field(..., min_length=2, max_length=200, description="Church location")
age: int = Field(..., gt=18, lt=120, description="Pastor's age")
bio: Optional[str] = Field(None, description="Pastor's biography")
website: Optional[str] = Field(None, max_length=200, description="Church website")
social_media: Optional[str] = Field(None, max_length=200, description="Social media handles")
specialty: Optional[str] = Field(None, max_length=100, description="Pastor's specialty or focus area")
years_in_ministry: Optional[int] = Field(None, ge=0, description="Years of ministry experience")
followers_count: int = Field(default=0, ge=0, description="Number of followers")
is_active: bool = Field(default=True, description="Whether the pastor is currently active")
class PastorCreate(PastorBase):
class Config:
schema_extra = {
"example": {
"name": "John Smith",
"church_name": "Grace Community Church",
"location": "Los Angeles, CA",
"age": 45,
"bio": "Serving the community for over 15 years",
"website": "www.gracecommunitychurch.org",
"social_media": "@pastorjohnsmith",
"specialty": "Youth Ministry",
"years_in_ministry": 15,
"followers_count": 1000,
"is_active": True
}
}
class Pastor(PastorBase):
id: UUID
created_at: datetime
updated_at: datetime
class Config:
orm_mode = True