Skip to content

feat: add task filtering, search, priority, and statistics#12

Merged
Rashed-alothman merged 1 commit intomainfrom
feat/add-filtering-search-priority
Dec 22, 2025
Merged

feat: add task filtering, search, priority, and statistics#12
Rashed-alothman merged 1 commit intomainfrom
feat/add-filtering-search-priority

Conversation

@Rashed-alothman
Copy link
Owner

Summary

This PR adds advanced querying capabilities to the TMS API, including task filtering, sorting, and a priority system.

Changes Made

New Features

  • Added priority field to Task model (low, medium, high, urgent)
  • Implemented filtering by completion status
  • Implemented filtering by priority level
  • Implemented sorting by creation date, due date, and priority
  • Added validation for priority values
  • Added case-insensitive priority handling

API Enhancements

  • GET /homepage/api/tasks now accepts query parameters:
    • ?completed=true/false - filter by completion status
    • ?priority=low/medium/high/urgent - filter by priority
    • ?sort=created_at/due_date/priority - sort results
  • POST /homepage/api/tasks/add_Tasks now accepts priority field
  • All endpoints now have comprehensive error handling with SQLAlchemy rollback

Technical Improvements

  • Added error message constants for consistency
  • Enhanced logging for debugging
  • Improved error handling across all routes
  • Added database transaction rollback on errors

Testing

  • All 19 tests passing
  • New tests added for filtering and sorting
  • Priority validation tests included
  • Error handling tests comprehensive

Database Changes

  • Added priority column to tasks table (default: 'low')
  • Updated Task model with priority field

Breaking Changes

None - all changes are backwards compatible

Documentation

  • Updated code comments
  • Added route documentation in file header

@Rashed-alothman Rashed-alothman self-assigned this Dec 22, 2025
@Rashed-alothman Rashed-alothman added the enhancement New feature or request label Dec 22, 2025
@Rashed-alothman Rashed-alothman merged commit 0486ec2 into main Dec 22, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments