Skip to content

[JITERA] Enhance ToDo Model with Validation

chi le requested to merge feat/add-todo-validation-1751945140 into main

Created by: chi-jitera

Overview

This pull request enhances the existing ToDo model by adding validation to ensure that the title field is not only required but also adheres to specific constraints. Additionally, we will implement validation for the dueDate field to ensure it is a valid date and not in the past.

Changes Made

  1. Title Validation:

    • The title field is now validated to ensure it is a non-empty string with a maximum length of 100 characters.
    • This prevents users from entering excessively long titles that could affect the database and UI.
  2. Due Date Validation:

    • The dueDate field is validated to ensure it is a valid date and cannot be set to a date in the past.
    • This ensures that users can only set future due dates, making the application more user-friendly and logical.
  3. Error Handling:

    • Added custom error messages for validation failures to provide better feedback to users.

These changes will improve the integrity of the data stored in the ToDo model and enhance the overall user experience.

Merge request reports