[PR #397] [MERGED] Add typed request model for today-workflow task status endpoint #702

Closed
opened 2026-03-13 21:04:48 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/AJaySi/ALwrity/pull/397
Author: @AJaySi
Created: 3/6/2026
Status: Merged
Merged: 3/8/2026
Merged by: @AJaySi

Base: mainHead: codex/create-typed-request-model-for-task-status


📝 Commits (1)

  • 62d5cf7 Add typed request model for today workflow task status updates

📊 Changes

1 file changed (+22 additions, -5 deletions)

View changed files

📝 backend/api/today_workflow.py (+22 -5)

📄 Description

Motivation

  • Provide automatic FastAPI/Pydantic validation and clearer OpenAPI docs for the task status update endpoint (POST /api/today-workflow/tasks/{task_id}/status).
  • Constrain accepted status values and limit completion_notes length to match backend expectations and reduce invalid input.

Description

  • Added TaskStatusEnum in backend/api/today_workflow.py to enumerate allowed status values (pending, in_progress, completed, skipped, dismissed).
  • Added TaskStatusUpdateRequest Pydantic model in backend/api/today_workflow.py with status: TaskStatusEnum and completion_notes: Optional[str] validated with max_length=4000.
  • Updated set_task_status to accept body: TaskStatusUpdateRequest and to read status via body.status.value and completion_notes via body.completion_notes so FastAPI will enforce the schema.

Testing

  • Compiled the modified module with python -m py_compile backend/api/today_workflow.py, which completed successfully.

Codex Task


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/AJaySi/ALwrity/pull/397 **Author:** [@AJaySi](https://github.com/AJaySi) **Created:** 3/6/2026 **Status:** ✅ Merged **Merged:** 3/8/2026 **Merged by:** [@AJaySi](https://github.com/AJaySi) **Base:** `main` ← **Head:** `codex/create-typed-request-model-for-task-status` --- ### 📝 Commits (1) - [`62d5cf7`](https://github.com/AJaySi/ALwrity/commit/62d5cf773e254591e01f14b82b325c23658556b1) Add typed request model for today workflow task status updates ### 📊 Changes **1 file changed** (+22 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `backend/api/today_workflow.py` (+22 -5) </details> ### 📄 Description ### Motivation - Provide automatic FastAPI/Pydantic validation and clearer OpenAPI docs for the task status update endpoint (`POST /api/today-workflow/tasks/{task_id}/status`). - Constrain accepted `status` values and limit `completion_notes` length to match backend expectations and reduce invalid input. ### Description - Added `TaskStatusEnum` in `backend/api/today_workflow.py` to enumerate allowed status values (`pending`, `in_progress`, `completed`, `skipped`, `dismissed`). - Added `TaskStatusUpdateRequest` Pydantic model in `backend/api/today_workflow.py` with `status: TaskStatusEnum` and `completion_notes: Optional[str]` validated with `max_length=4000`. - Updated `set_task_status` to accept `body: TaskStatusUpdateRequest` and to read `status` via `body.status.value` and `completion_notes` via `body.completion_notes` so FastAPI will enforce the schema. ### Testing - Compiled the modified module with `python -m py_compile backend/api/today_workflow.py`, which completed successfully. ------ [Codex Task](https://chatgpt.com/codex/tasks/task_e_69aafa6fbe848328859596ed7cd582cd) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 21:04:48 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/ALwrity#702
No description provided.