From 5b04d372ac23e1fb784bbf34a3e898528f5864f5 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Wed, 26 Mar 2025 12:29:53 +0000 Subject: [PATCH] Add Pastor schema --- schemas/pastor.py | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 schemas/pastor.py diff --git a/schemas/pastor.py b/schemas/pastor.py new file mode 100644 index 0000000..3033c6b --- /dev/null +++ b/schemas/pastor.py @@ -0,0 +1,43 @@ +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 \ No newline at end of file