Replace Flask admin with FastAPI app (api/app/) featuring: - Dashboard with stat cards, sync control, and history - Mappings CRUD for ARTICOLE_TERTI with CSV import/export - Article autocomplete from NOM_ARTICOLE - SKU pre-validation before import - Sync orchestration: read JSONs -> validate -> import -> log to SQLite - APScheduler for periodic sync from UI - File logging to logs/sync_comenzi_YYYYMMDD_HHMMSS.log - Oracle pool None guard (503 vs 500 on unavailable) Test suite: - test_app_basic.py: 30 tests (imports + routes) without Oracle - test_integration.py: 9 integration tests with Oracle Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
854 B
Python
36 lines
854 B
Python
from pydantic_settings import BaseSettings
|
|
from pathlib import Path
|
|
import os
|
|
|
|
class Settings(BaseSettings):
|
|
# Oracle
|
|
ORACLE_USER: str = "MARIUSM_AUTO"
|
|
ORACLE_PASSWORD: str = "ROMFASTSOFT"
|
|
ORACLE_DSN: str = "ROA_CENTRAL"
|
|
INSTANTCLIENTPATH: str = ""
|
|
FORCE_THIN_MODE: bool = False
|
|
TNS_ADMIN: str = ""
|
|
|
|
# SQLite
|
|
SQLITE_DB_PATH: str = str(Path(__file__).parent.parent / "data" / "import.db")
|
|
|
|
# App
|
|
APP_PORT: int = 5003
|
|
LOG_LEVEL: str = "INFO"
|
|
JSON_OUTPUT_DIR: str = ""
|
|
|
|
# SMTP (optional)
|
|
SMTP_HOST: str = ""
|
|
SMTP_PORT: int = 587
|
|
SMTP_USER: str = ""
|
|
SMTP_PASSWORD: str = ""
|
|
SMTP_TO: str = ""
|
|
|
|
# Auth (optional)
|
|
API_USERNAME: str = ""
|
|
API_PASSWORD: str = ""
|
|
|
|
model_config = {"env_file": ".env", "env_file_encoding": "utf-8", "extra": "ignore"}
|
|
|
|
settings = Settings()
|