Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Migration for Sell > Customers > Addresses create/edit forms #15300
In this PR, there is 3 custom validators used to validate the Symfony form:
About the usage of CQRS in the app layer
I confirmed with @eternoendless that Commands and Queries must be used in order to address user-oriented usecases. This means "user needs to see a dashboard with data A, B and C" => it's a Query. "User needs to modify data X state" => it's a Command.
However here the user does not want to validate the form (when the form is submitted). The system needs to validate the form prior to executing the true intent of the user which is to persist the data provided by the user.
So the answer is: we will not use Queries nor Commands to retrieve the data needed by the validators, but instead some classes, we can label them as data providers in charge of providing this data. These data providers are read-only.
About this PR and the implementation
For this PR, it means:
The data provider must be an interface. See examples
And the interface can be implemented by either
jolelievre left a comment
Quite a lot of feedbacks (sorry ^^) I like many of those modifications though, I'm sure most of them could be useful for manufacturer and supplier addresses (any adresses actually) This would probably be worth it to have a generic