#!/usr/bin/env bash
# Apply immutable DDS publication evidence and deterministic validation fixtures.
set -Eeuo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ -f /home/opc/apps/vpd-backoffice/.env ]]; then
  set -a
  . /home/opc/apps/vpd-backoffice/.env
  set +a
fi

: "${ADB_USER:?ADB_USER is required}"
: "${ADB_PASSWORD:?ADB_PASSWORD is required}"
: "${ADB_TNS:?ADB_TNS is required}"

sqlplus -S -L "${ADB_USER}/${ADB_PASSWORD}@${ADB_TNS}" "@${ROOT}/sql/adb/40_dds_protection_evidence.sql"
echo "DDS protection evidence schema and fixture manifest applied"
