#!/bin/sh
#initialisation
. "`dirname \"$0\"`/init.sh"

echo "#### skrooge-boursorama IRE"
${IN}/../../skgbankmodeler/skrooge-boursorama.py IRE 2025-12-02 1d
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

echo "#### skrooge-boursorama PX1"
${IN}/../../skgbankmodeler/skrooge-boursorama.py PX1 2025-12-02 1d
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

echo "#### skrooge-boursorama FR0003500008"
${IN}/../../skgbankmodeler/skrooge-boursorama.py FR0003500008 2025-12-02 1d
rc=$?
if [ $rc != 0 ] ; then
	exit $rc
fi

echo "#### skrooge-coinmarketcap WAXP-USD"
if [ -z "$KEY_coinmarketcap" ] ; then
	echo "KEY_coinmarketcap is not set, skipping skrooge-coinmarketcap test"
else
	${IN}/../../skgbankmodeler/skrooge-coinmarketcap.py WAXP-USD 2026-04-11 2025-12-02 1d $KEY_coinmarketcap
	rc=$?
	if [ $rc != 0 ] ; then
		exit $rc
	fi
fi

echo "#### skrooge-cryptocompare BTC-USD"
if [ -z "$KEY_cryptocompare" ] ; then
	echo "KEY_cryptocompare is not set, skipping skrooge-cryptocompare test"
else
	${IN}/../../skgbankmodeler/skrooge-cryptocompare.py BTC-USD 2026-04-11 2025-12-02 1d $KEY_cryptocompare
	rc=$?
	if [ $rc != 0 ] ; then
		exit $rc
	fi
fi

echo "#### skrooge-exchangerates_apilayer GBP-EUR"
if [ -z "$KEY_exchangerates_apilayer" ] ; then
	echo "KEY_exchangerates_apilayer is not set, skipping skrooge-exchangerates_apilayer test"
else
	#TODO ${IN}/../../skgbankmodeler/skrooge-exchangerates_apilayer.py "GBP-EUR" $KEY_exchangerates_apilayer
	rc=0
	rc=$?
	if [ $rc != 0 ] ; then
		exit $rc
	fi
fi

echo "#### skrooge-exchangerates GBP-EUR"
if [ -z "$KEY_exchangerates" ] ; then
	echo "KEY_exchangerates is not set, skipping skrooge-KEY_exchangerates test"
else
	${IN}/../../skgbankmodeler/skrooge-exchangerates.py "GBP-EUR" $KEY_exchangerates
	rc=$?
	if [ $rc != 0 ] ; then
		exit $rc
	fi
fi

exit 0
