ifixkart-admin/Backend/app/schemas/User.py
Adithiyan bbd3a3e959 feat: initial commit — full platform snapshot
- Backend: FastAPI app with all models, services, schemas, routes
- Admin Panel: Next.js dashboard with all modules
  (CRM, POS, repairs, warranties, billing, notifications, etc.)
- Ecommerce: storefront (submodule) + product catalog
- AI Agents: .agents/ skill library for Antigravity IDE
- Docs: architecture, billing, notification gateway markdown
- Submodules: Backend/OpenWA, Ecommerce/File 2/storefront
2026-10-13 12:59:47 +05:30

60 lines
2.3 KiB
Python

from pydantic import BaseModel, EmailStr, Field
from typing import Optional
from datetime import date, datetime
class UserCreate(BaseModel):
first_name: str = Field(..., min_length=2, max_length=50)
last_name: str = Field(..., min_length=2, max_length=50)
display_name: Optional[str] = Field(None, max_length=100)
email: EmailStr
phone: str = Field(..., min_length=10, max_length=20)
password: str
gender: Optional[str] = Field(None, max_length=20)
dob: Optional[date] = None
department_id: str = Field(..., min_length=26, max_length=26)
designation_id: str = Field(..., min_length=26, max_length=26)
role_id: str = Field(..., min_length=26, max_length=26)
manager_id: Optional[str] = Field(None, min_length=26, max_length=26)
location_ids: Optional[list[str]] = Field(default_factory=list)
class UserUpdate(BaseModel):
first_name: Optional[str] = Field(None, min_length=2, max_length=50)
last_name: Optional[str] = Field(None, min_length=2, max_length=50)
display_name: Optional[str] = Field(None, max_length=100)
email: Optional[EmailStr] = None
phone: Optional[str] = Field(None, min_length=10, max_length=20)
password: Optional[str] = None
gender: Optional[str] = Field(None, max_length=20)
dob: Optional[date] = None
department_id: Optional[str] = Field(None, min_length=26, max_length=26)
designation_id: Optional[str] = Field(None, min_length=26, max_length=26)
role_id: Optional[str] = Field(None, min_length=26, max_length=26)
manager_id: Optional[str] = Field(None, min_length=26, max_length=26)
profile_image_id: Optional[str] = Field(None, min_length=26, max_length=26)
location_ids: Optional[list[str]] = None
class UserResponse(BaseModel):
user_id: str
employee_code: Optional[str]
first_name: str
last_name: str
display_name: Optional[str]
email: EmailStr
phone: str
profile_image_id: Optional[str]
gender: Optional[str]
dob: Optional[date]
department_id: str
designation_id: str
role_id: str
manager_id: Optional[str]
is_active: bool
email_verified: bool
phone_verified: bool
created_at: datetime
last_login: Optional[datetime] = None
last_activity: Optional[str] = None
location_ids: list[str] = []
class Config:
from_attributes = True