LerianStudio / midaz

Midaz, an open-source, cloud-native, immutable, multi-currency, multi-asset, Core Ledger Application for storing and tracking transactions.
Apache License 2.0
83 stars 4 forks source link

Create Transaction custom validation with Validator to Send From and Distribute To fields #259

Closed qnen closed 1 day ago

qnen commented 1 week ago

Context

POST Transaction from JSON is currently not validating the fields send.source.from and distribute.to. They should be validated to assure only one transaction type is being passed in the input. The fields to take in account:

How to do it?

Create a custom Validator to validate when more than one of the fields listed above were informed, the API should return an error.

Changes