import sys import os import json from pydantic import TypeAdapter sys.path.append(os.path.join(os.getcwd(), 'Backend')) from app.core.database.db_session import SessionLocal from app.services.SystemConfigService import SystemConfigService from app.schemas.SystemConfig import CrmLocationResponse db = SessionLocal() svc = SystemConfigService(db=db) locs = svc.list_locations() adapter = TypeAdapter(list[CrmLocationResponse]) print(adapter.dump_json(locs).decode())