ifixkart-admin/Backend/app/schemas/SystemConfig.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

75 lines
2 KiB
Python

from pydantic import BaseModel, EmailStr
from typing import List, Optional
from datetime import datetime
# --- LOCATION SCHEMAS ---
class CrmLocationCreate(BaseModel):
name: str
code: str
address: Optional[str] = None
city: Optional[str] = None
state: Optional[str] = None
pincode: Optional[str] = None
phone: Optional[str] = None
email: Optional[EmailStr] = None
is_central_warehouse: Optional[bool] = False
is_primary: Optional[bool] = False
is_active: Optional[bool] = True
class CrmLocationResponse(BaseModel):
location_id: str
tenant_id: str
name: str
code: str
address: Optional[str] = None
city: Optional[str] = None
state: Optional[str] = None
pincode: Optional[str] = None
phone: Optional[str] = None
email: Optional[str] = None
is_active: bool
is_primary: bool = False
is_central_warehouse: bool = False
created_at: Optional[datetime] = None
class Config:
from_attributes = True
# --- DYNAMIC DEVICE TYPE SCHEMAS ---
class DeviceTypeCreate(BaseModel):
# Simple mode: just name + code
name: Optional[str] = None
code: str
# Extended mode: category/brand/device_name (used by store-config page)
category: Optional[str] = None
brand: Optional[str] = None
device_name: Optional[str] = None
icon_name: Optional[str] = "Smartphone"
display_order: Optional[int] = 0
is_active: Optional[bool] = True
class DeviceTypeResponse(BaseModel):
device_type_id: str
tenant_id: str
name: str
code: str
# Extended fields
category: Optional[str] = None
brand: Optional[str] = None
device_name: Optional[str] = None
icon_name: Optional[str] = None
display_order: int = 0
is_active: bool
created_at: Optional[datetime] = None
class Config:
from_attributes = True
# --- USER LOCATION ASSIGNMENT SCHEMAS ---
class UserLocationAssign(BaseModel):
user_id: str
location_ids: List[str]
primary_location_id: Optional[str] = None
is_all_locations: Optional[bool] = False