For future projects, I decided to use dto to transfer data to the domain level. Here I also do most of the data validation.
Where should I put the data formatting?
1) In DTO, when it is ready to be sent to the domain level
OR
2) At the infrastructure level before its preservation?
OR
3) Somewhere else :)
i.e. .: Password that must be encrypted before it is saved, or an image that needs to be converted, changed, etc. before saving it.
I want all the data to be formed in one layer, I do not like it to flow around everywhere.
In other words: should the data be prepared so that the domain processes it, or should the domain receive raw data and modify it after it is processed by the domain?
Tudor source share