Skip to content

fix(core): enforce TaskFieldValidatorRegistry validation in CreateTaskUseCase - #1173

Closed
amir-rezaei wants to merge 1 commit into
Kohei-Wada:mainfrom
amir-rezaei:fix/create-task-field-validation
Closed

fix(core): enforce TaskFieldValidatorRegistry validation in CreateTaskUseCase#1173
amir-rezaei wants to merge 1 commit into
Kohei-Wada:mainfrom
amir-rezaei:fix/create-task-field-validation

Conversation

@amir-rezaei

Copy link
Copy Markdown
Contributor

Description

This PR resolves issue #1134 by enforcing field validation via TaskFieldValidatorRegistry in CreateTaskUseCase.

Details

  • Previously, CreateTaskUseCase bypassed the validator registry entirely when creating new tasks, allowing invalid inputs (e.g., past deadlines, non-positive durations, invalid priorities) to enter the system upon creation even though UpdateTaskUseCase rejected them.
  • This PR updates CreateTaskUseCase to instantiate TaskFieldValidatorRegistry and validate input fields (priority, deadline, planned_start, planned_end, estimated_duration) before repository creation.
  • Updates FieldValidator, DateTimeValidator, and TaskFieldValidatorRegistry type annotations and logic to support optional task parameter when validating new task creation.

@Kohei-Wada

Copy link
Copy Markdown
Owner

Thanks for the contribution, but CI is failing on this PR (Type Check, Test (taskdog-core), E2E), and no fix has been pushed.

Closing to keep the review queue actionable. Please feel free to reopen once:

  • all required checks pass on your branch, and
  • the change is covered by tests that pass locally (make check && make test).

A PR that fails its own package's test suite can't be reviewed on its merits, so please verify locally before opening.

@Kohei-Wada Kohei-Wada closed this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants