#!/bin/sh
# st_run_0001.sh - 정산수수료 실행 러너 (easy)
# 사용법: st_run_0001.sh <YYYYMMDD>
set -eu

BIZDATE="${1:-$(date +%Y%m%d)}"
APP_HOME="${APP_HOME:-/app/acquire-core}"
BIN="${APP_HOME}/bin"
LOG="${APP_HOME}/log/st_run_0001_${BIZDATE}.log"

echo "[st_run_0001] 정산수수료 처리 시작 date=${BIZDATE}"
if [ -x "${BIN}/st_bt_0001" ]; then
    "${BIN}/st_bt_0001" "${BIZDATE}" "acquire@localhost" >> "${LOG}" 2>&1
    RC=$?
else
    echo "[st_run_0001] 실행 파일 없음: ${BIN}/st_bt_0001" >&2
    RC=0
fi
echo "[st_run_0001] 종료 rc=${RC}"
exit ${RC}
