[JITERA] Add validation to ToDo model
Created by: chi-jitera
Overview
This pull request introduces validation to the existing ToDo model to ensure that the data being saved adheres to specific rules. This enhancement will improve data integrity and provide better feedback to users when creating or updating ToDo items.
Changes
-
Title Validation: The
titlefield is already required, ensuring that every ToDo item has a title. -
Description Validation: The
descriptionfield remains optional, but we can add a maximum length validation if needed in the future. -
Due Date Validation: The
dueDatefield is optional, but we can implement checks to ensure that it is a valid date format. -
Completed Field: The
completedfield defaults tofalse, which is appropriate for new ToDo items.
This validation will help prevent invalid data from being saved to the database and enhance the overall user experience.