INSERT : Plugin Validation
BasicCRUD Insert Query with Bridge
Last updated
BasicCRUD Insert Query with Bridge
Last updated
Now let us look at another type of validation. That is the plug-in validation.
The plug-in validation happens in the ProcessServices. You see a ProcessCustomerServices, it creates a sequence with the data packet and the data packet contains the data that was passed as parameter from the controller. In the controller, we are passing the parameter that contains the ContextInfo and the InputAPIModel. Now the first validation that we will look at is the validation which are more complex in scenarios. We can have more database interactions or we have something we want to validate something like the aadhar number. So this is one validation that is not started with number, if you see it cause a packets method do not start with number.
Next validation, I am checking if the name that was provided by the model is unique, if any duplicate name is found. We are adding the message in the data packets error.
And refer to the repo instance in the constructor of your data packet as shown below: