- 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
19 lines
729 B
Python
19 lines
729 B
Python
from typing import Optional, List
|
|
from sqlalchemy.orm import Session
|
|
from sqlalchemy import select
|
|
from app.models.SettingModel import Setting
|
|
from app.repositories.base_repository import BaseRepository
|
|
|
|
class SettingRepository(BaseRepository[Setting]):
|
|
def __init__(self):
|
|
super().__init__(Setting)
|
|
|
|
def get_by_key(self, db: Session, key: str) -> Optional[Setting]:
|
|
stmt = select(Setting).where(Setting.setting_key == key)
|
|
return db.execute(stmt).scalar_one_or_none()
|
|
|
|
def get_public_settings(self, db: Session) -> List[Setting]:
|
|
stmt = select(Setting).where(Setting.is_public.is_(True))
|
|
return list(db.execute(stmt).scalars().all())
|
|
|
|
setting_repository = SettingRepository()
|