Slide 6
Slide 6 text
Bank account API server
● Bank Account API server that can deposit
and withdraw money
○ Deposit to a bank account
○ Withdraw from a bank account
○ Refer to transaction(deposit or
withdraw) histories
● Source
○ https://git.io/reactive-ddd-example
銀行口座APIサーバの例
// Deposit to a bank account
$ curl -X PUT \
http://localhost:8080/bank-accounts/XEe/events \
-H 'content-type: application/json' \
-d '{
"type": "deposit",
"amount": 1000,
"currencyCode": "JPY"
}'
{"id":"XEe","errorMessage":null}%
// Refer to transaction histories on a bank account
$ curl -X GET \
http://localhost:8080/bank-accounts/XEe \
-H 'content-type: application/json'
{
"id": "XEe",
"values": [
{
"type": "deposit",
"amount": 1000,
"currencyCode": "JPY",
"createAt": 1520219459
}
],
"errorMessage": null
}