命令模式可以返回值吗? [交易]
我一直在从事一个小型核心银行项目。我想问一个问题。
假设我们有一个事务微服务。交易请求已发送至我们的服务。存储并完成这笔交易后,返回交易信息是否正确?
这是一个过程示例。
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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一般来说,命令没有理由不能有响应/返回值,而不仅仅是命令成功/失败。
There's in general no reason that a command couldn't have a response/return value with more than just command succeeded/failed.