HG-63: Fill proper account ids in the base fixture (#6)

This commit is contained in:
Andrew Mayorov 2016-10-24 12:57:53 +03:00 committed by GitHub
parent 860ff226a5
commit c3840a0e68
4 changed files with 39 additions and 3 deletions

View File

@ -4,7 +4,16 @@
"data": {
"party_prototype": {"id": 42},
"providers": {"value": [{"id": 1}]},
"system_accounts": {"predicates": []}
"system_accounts": {"value": [{"id": 1}]}
}
}}}},
{"insert": {"object": {"system_account_set": {
"ref": {"id": 1},
"data": {
"name": "Primary",
"description": "Primary",
"currency": {"symbolic_code": "RUB"},
"compensation": $(${CURDIR}/create-account.sh RUB $*)
}
}}}},
{"insert": {"object": {"party_prototype": {
@ -127,7 +136,11 @@
"volume": {"share": {"parts": {"p": 18, "q": 1000}, "of": "payment_amount"}}
}
],
"accounts": {"currency": {"symbolic_code": "RUB"}, "receipt": 10, "compensation": 11},
"accounts": {
"currency": {"symbolic_code": "RUB"},
"receipt": $(${CURDIR}/create-account.sh RUB $*),
"compensation": $(${CURDIR}/create-account.sh RUB $*)
},
"options": {"override": "Brominal 1"}
}
}}}},

View File

@ -1,6 +1,13 @@
#!/bin/sh
set -e
export CURDIR="$(dirname ${0})"
export LIBDIR="${CURDIR}/../lib"
FIXTURE="$(${LIBDIR}/template.sh ${CURDIR}/base-fixture.commit.json.tpl $*)"
woorl $* \
-s damsel/proto/domain_config.thrift \
http://dominant:8022/v1/domain/repository \
Repository Commit 0 "$(cat $(dirname $0)/base-fixture.commit.json)"
Repository Commit 0 "${FIXTURE}"

View File

@ -0,0 +1,11 @@
#!/bin/sh
CURRENCY=${1}
shift 1
[ -z "${CURRENCY}" ] && { echo "No currency code specified"; exit -1; }
woorl $* \
-s damsel/proto/accounter.thrift \
http://shumway:8022/accounter \
Accounter CreateAccount "{\"currency_sym_code\":\"${CURRENCY}\"}"

5
scripts/lib/template.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
eval "shift 1 && cat <<EOF
$(<$1)
EOF"