-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation for adding a new Job #5
Comments
I have experience with FluentValidation and can take care of this in the next few days |
Just a heads up, in case my changes go before yours. I'll be changing to MongoDB (which shouldn't affect you at all) and I ended up moving the models in the Domain layer outside of the Entities folder (which would give you namespace conflicts, which will most likely be easy to resolve). |
Currently the DateSubmitted and DateUpdated properties of Job are not nullable. My initial thought is to change their type to 'DateTime?', but let me know if you'd prefer that I validate against the default DateTime value. Would you like me to create a pull request to the develop branch or would you prefer to create a new validation-addition branch? I don't seem to have access to create a branch, but I'm new to GitHub so I may be missing something. |
There's a DTO for creating a job. We should be validating the DTO, Having those fields null are valid because after validation and during the mapping process, null dates will be set to today. This is the mapping that does that: Originally, I had added that
This has already been done when using AutoMapper. I forgot to update the issue. There is no |
Add validation for adding a new Job to the database. Validate whether the request object is valid.
A job can be saved in the database if it fulfills the following criteria:
If DateSubmitted is null, the date will be set to Now.
If DateUpdated is null, the date will be set to DateSubmitted.
The text was updated successfully, but these errors were encountered: