Ismail Dogan
Ismail Dogan

Reputation: 325

Can command pattern return a value? [Transaction]

I have been working on a small core banking project. I would like to ask a question.

Suppose that we have a transaction microservice. A transaction request has been sent to our service. After storing and doing this transaction, Is it right to return transaction informations?

Here is an example of process.

     INPUT
   • Account ID
   • Amount
   • Currency
   • Direction of transaction (IN, OUT)
   • Description

     OUTPUT
   • Account ID
   • Transaction ID
   • Amount
   • Currency
   • Direction of transaction
   • Description
   • Balance after transaction

     ERROR
   • Invalid currency
   • Invalid direction
   • Invalid amount (if negative amount for example)
   • Insufficient funds
   • Account missing
   • Description missing

Upvotes: 1

Views: 146

Answers (1)

Levi Ramsey
Levi Ramsey

Reputation: 20551

There's in general no reason that a command couldn't have a response/return value with more than just command succeeded/failed.

Upvotes: 2

Related Questions