Skip to content

[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

  1. Title Validation: The title field is already required, ensuring that every ToDo item has a title.
  2. Description Validation: The description field remains optional, but we can add a maximum length validation if needed in the future.
  3. Due Date Validation: The dueDate field is optional, but we can implement checks to ensure that it is a valid date format.
  4. Completed Field: The completed field defaults to false, 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.

Merge request reports