GREEN=$'\e[0;32m'
BOLD=$'\e[1m'
DEFAULT=$'\e[0m'

awsume prod --region us-east-1

echo "\n${GREEN}Running Ownership data health check...${DEFAULT}"

echo "\n${BOLD}Contributions${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/contributions.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

echo "\n${BOLD}Contributors${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/contributors.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

echo "\n${BOLD}Participants${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/participants.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

echo "\n${BOLD}Products${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/products.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

echo "\n${BOLD}Rules${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/rules.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

echo "\n${BOLD}Sound Recordings${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/sound-recordings.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/sound-recording-ids.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'" > output/sound-recordings-without-monetize-rules.json
sed -i '' -e '1d' output/sound-recordings-without-monetize-rules.json

echo "\n${BOLD}Tracks${DEFAULT}"
cypher-shell -a "${NEO4J_URL}" -f 'cypher/tracks.cypher' --format plain -P "today => '$(date '+%Y-%m-%d')'"

