[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 help maintain data integrity and provide better error handling 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 additional checks to ensure that the date is not in the past when creating a new ToDo item. -
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 improve the overall reliability of the application.