"""
Central configuration for the AgriFound Python pipeline.

DB_* values are read from environment variables so the same code works
against your local MySQL install. Defaults match a typical XAMPP/WAMP/
fresh-MySQL setup (root / no password) -- change them for your machine.
"""
import os

DB_CONFIG = {
    "host": os.environ.get("AGRIFOUND_DB_HOST", "127.0.0.1"),
    "port": int(os.environ.get("AGRIFOUND_DB_PORT", "3306")),
    "user": os.environ.get("AGRIFOUND_DB_USER", "root"),
    "password": os.environ.get("AGRIFOUND_DB_PASSWORD", ""),
    "database": os.environ.get("AGRIFOUND_DB_NAME", "agrifound"),
}

# Simulation window: one full apple growing season (bloom -> harvest -> storage)
SEASON_START = "2024-04-01"
SEASON_END = "2024-10-31"
STORAGE_END = "2025-02-28"   # post-harvest storage monitoring window

RANDOM_SEED = 42

# Real agronomic thresholds cited directly from the proposal /
# postharvest-physiology literature -- used by the analytics engine.
THRESHOLDS = {
    "vwc_critical_pct": 16.0,       # theta_critical (loamy soil, apple), proposal Module II
    "ec_critical_ds_m": 2.5,        # salinity tipping point, proposal Module II
    "no3_critical_ppm": 50.0,       # N deficiency tipping point, proposal Module II
    "soil_temp_microbial_c": 28.0,  # microbial die-off threshold, proposal Module IV
    "root_damage_temp_c": 35.0,     # root damage threshold at 10cm, proposal Module II
    "storage_temp_target_c": 1.0,   # standard apple CA/cold-store target (0-4C)
    "storage_humidity_target_pct": 92.0,
    "firmness_harvest_kgf": 7.5,    # typical harvest-ready firmness
    "starch_index_harvest": 4.0,    # Cornell/CTIFL-style 1-10 scale
}
