# Daily conversion-rate refresh for Payment Studio's Currency & Tax tab.
#
# Only acts when the merchant enabled "auto-update rates" there — the script
# exits immediately otherwise, so shipping this cron everywhere is harmless.
# Rows the merchant set by hand (Manual) are never overwritten; only rows left
# on Auto take the day's rate from the free feed (open.er-api.com, with the
# jsDelivr-hosted currency-api as fallback).
#
# Runs as www-data because it writes the studio's own store under
# /var/www/alpha-private. Early morning, once — rate feeds update daily.
#
# The guard keeps a partial install harmless: no panel, no run.
17 4 * * * www-data [ -f /var/www/alpha/bin/market-rates.php ] && /usr/bin/php /var/www/alpha/bin/market-rates.php >/dev/null 2>&1
