Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Sep 4, 2025

This PR adds support for difficulty levels to activities, allowing students to filter activities by skill level: Iniciante (Beginner), Intermediário (Intermediate), and Avançado (Advanced).

Key Changes

Domain Layer

  • Created DifficultyLevel enum with three levels: BEGINNER, INTERMEDIATE, ADVANCED
  • Updated Activity entity to include an optional difficultyLevel field
  • Added comprehensive unit tests for difficulty level functionality

Application Layer

  • Created DifficultyLevelDTO for data transfer
  • Updated ActivityDTO to include difficulty level information
  • Modified ActivityMapper to handle difficulty level conversions

Infrastructure Layer

  • Updated database migration to seed sample activities with different difficulty levels:
    • Programming Class: Intermediate level
    • Art Club: Beginner level
    • Robotics Workshop: Advanced level
    • Science Olympiad: Advanced level

Frontend Implementation

Added a new "Filtrar por dificuldade" section to the sidebar with 5 filter options:

  1. "Todas as Dificuldades" - Shows all activities (default)
  2. "Todos os Níveis" - Shows only activities without difficulty specified
  3. "Iniciante" - Shows beginner-level activities
  4. "Intermediário" - Shows intermediate-level activities
  5. "Avançado" - Shows advanced-level activities

Technical Implementation

The implementation follows Clean Architecture principles:

  • Domain layer contains pure business logic with no external dependencies
  • Application layer orchestrates between domain and infrastructure
  • Frontend filtering is handled client-side for responsive user experience
  • Backward compatibility maintained - existing activities without difficulty levels continue to work

Screenshots

Default view with new difficulty filter:
Default View

Filtering by "Avançado" (Advanced) level:
Advanced Filter

As requested in the requirements:

  • Difficulty levels are optional parameters
  • Activities without difficulty are accessible to all levels via "Todos os Níveis" filter
  • Difficulty levels are not displayed on activity cards (only used for filtering)
  • The "Todos os Níveis" option specifically shows activities without difficulty information

Fixes #6.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

- Add DifficultyLevel enum (Beginner, Intermediate, Advanced)
- Update Activity entity with optional difficultyLevel field
- Update ActivityDTO and mapper to include difficulty levels
- Add migration data with sample activities at different difficulty levels
- Implement frontend difficulty filter with 5 options:
  * "Todas as Dificuldades" - shows all activities
  * "Todos os Níveis" - shows only activities without difficulty specified
  * "Iniciante", "Intermediário", "Avançado" - shows activities of specific levels
- Add comprehensive tests for difficulty level functionality
- Update CSS styling to match existing filter design patterns

Co-authored-by: juliannaPaz <90342866+juliannaPaz@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Trilhas de Dificuldade Implement difficulty levels for activities with filtering functionality Sep 4, 2025
@Copilot Copilot AI requested a review from juliannaPaz September 4, 2025 13:48
Copilot finished work on behalf of juliannaPaz September 4, 2025 13:48
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.

Trilhas de Dificuldade
2 participants