You can point to Postgres DB (treat as a read db)
curl --location --request POST 'http://localhost:5001/api/v1/openBankAccount' \
--header 'Content-Type: application/json' \
--data-raw '{
"accountHolder": "john Doe",
"accountType": "SAVINGS",
"openingBalance": 50.0
}'
Response:
{
"message": "Bank account creation request completed successfully!",
"id": "0266c886-8267-4e9c-96ed-3dfb66aac4c4"
}
curl --location --request PUT 'http://localhost:5001/api/v1/depositFunds/0266c886-8267-4e9c-96ed-3dfb66aac4c4' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 150.0
}'
Response:
{
"message": "Deposit funds request completed successfully!"
}
curl --location --request PUT 'http://localhost:5001/api/v1/withdrawFunds/0266c886-8267-4e9c-96ed-3dfb66aac4c4' \
--header 'Content-Type: application/json' \
--data-raw '{
"amount": 15.0
}'
DELETE http://localhost:5001/api/v1/closeBankAccount/0266c886-8267-4e9c-96ed-3dfb66aac4c4
GET -> http://localhost:5002/api/v1/bankAccountLookup/
Response:
{
"message": "Successfully returned 2 bank account(s)!",
"accounts": [
{
"id": "9e9e8bf3-65a7-4d6c-9ac1-de79c52017a7",
"accountHolder": "Jane Doe",
"creationDate": "2022-07-30T09:44:06.971+00:00",
"accountType": "CURRENT",
"balance": 200.0
},
{
"id": "fc949c5e-a3ec-4b2a-ad75-eeed3a150998",
"accountHolder": "Mike Doe",
"creationDate": "2022-07-30T09:44:15.761+00:00",
"accountType": "SAVINGS",
"balance": 300.0
}
]
}
GET -> http://localhost:5002/api/v1/bankAccountLookup/byId/9e9e8bf3-65a7-4d6c-9ac1-de79c52017a7
Response:
{
"message": "Successfully returned bank account!",
"accounts": [
{
"id": "9e9e8bf3-65a7-4d6c-9ac1-de79c52017a7",
"accountHolder": "Jane Doe",
"creationDate": "2022-07-30T09:44:06.971+00:00",
"accountType": "CURRENT",
"balance": 200.0
}
]
}
GET -> http://localhost:5002/api/v1/bankAccountLookup/byHolder/Jane Doe
GET -> http://localhost:5002/api/v1/bankAccountLookup/withBalance/GREATER_THAN/50
GET -> http://localhost:5001/api/v1/restoreReadDb