Added a validation option to the model initialisation that gets run on save. It's designed to work with Joi, because it's way easier than writing our own logic (which I started doing and then gave up).
If validation fails, the error gets thrown. If the validation passes, then default values get applied and these are included in the save.
Added a validation option to the model initialisation that gets run on save. It's designed to work with Joi, because it's way easier than writing our own logic (which I started doing and then gave up).
If validation fails, the error gets thrown. If the validation passes, then default values get applied and these are included in the save.