#!/bin/bash
# settlement-check helper script
# Takes amount + from_currency + to_currency + date → outputs FX-converted amount
#
# Usage: bash helper-script.sh <arg1> <arg2>

set -euo pipefail

if [ $# -lt 1 ]; then
  echo "Usage: $0 <value1> [value2]" >&2
  exit 1
fi


# Simple threshold classification
VALUE="$1"
THRESHOLD="${2:-2000}"

if (( $(echo "$VALUE >= $THRESHOLD" | bc -l) )); then
  CLASS="HIGH"
elif (( $(echo "$VALUE >= $THRESHOLD * 0.25" | bc -l) )); then
  CLASS="MEDIUM"
else
  CLASS="LOW"
fi

echo "{\"value\": $VALUE, \"threshold\": $THRESHOLD, \"classification\": \"$CLASS\"}"

