Skip to content

feat: Enhance skill service and technical task submission handling#134

Merged
TMCreme merged 3 commits intomainfrom
Ransford/backend-upgrade
Apr 3, 2026
Merged

feat: Enhance skill service and technical task submission handling#134
TMCreme merged 3 commits intomainfrom
Ransford/backend-upgrade

Conversation

@RansfordGenesis
Copy link
Copy Markdown
Contributor

  • Updated SkillService to handle role and signup endpoint creation gracefully.
  • Modified search_skills method to include image_url in the response.
  • Improved TechnicalTaskService to validate user profile before submission.
  • Added detailed error messages for task not found and invalid experience.
  • Enhanced user activation upon status change to ACCEPTED.
  • Updated email templates for password reset and task assignment with improved styling.
  • Added tests for project manager validation and skill service response format.
  • Implemented error handling for technical task submissions with context.

Copilot AI review requested due to automatic review settings April 2, 2026 23:59
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances several core services and API schemas around skills, projects, org chart, authentication, and technical task submissions, alongside updating related email templates and tests.

Changes:

  • Expands project and org-chart responses/behavior (member team enrichment, org-chart filtering, updated token payload).
  • Improves technical task submission validation and error messaging, and updates skill search responses to include image_url.
  • Updates email templates styling and adds/updates tests to cover the new/changed behavior.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
utils/utils.py Updates experience-level mapping to use ExperienceLevel enum values.
utils/permissions.py Adds admin bypass for project manager checks; tightens accepted-user gating; introduces additional permission helpers.
utils/oauth2.py Clarifies get_current_user as auth-only and removes inactive redirect logic.
utils/email_templates/task_template.html Refreshes task assignment email styling and content.
utils/email_templates/password-reset.html Refreshes password reset email styling and content.
services/user_service.py Activates users automatically when status changes to ACCEPTED.
services/technical_task_service.py Adds profile validation, improved error messaging, and submission duplicate checks.
services/skill_service.py Makes role/signup endpoint creation in populate_skills best-effort; adds image_url to search results.
services/project_service.py Adds member team enrichment and changes create/update/get flows to return enriched members.
services/org_chart_service.py Adds optional active/accepted filtering for org chart reads and introduces filtered tree builder.
services/auth_service.py Includes role in login token response.
db/repository/users.py Defaults role_id on user creation; adjusts active-directory/applicant filtering logic.
db/repository/projects.py Ensures join-table cleanup when deleting projects (memberships/stacks/skills).
db/repository/org_chart.py Adds optional active/accepted filtering for roots and direct subordinate queries.
api/routes/project.py Enriches paginated project list items with member team.
api/api_models/user.py Adds status and is_active to OrgChartNode; adds role to Token.
api/api_models/technical_task.py Makes submission base fields optional; adds nested minimal user/task/stack models to submission response.
api/api_models/projects.py Adds member-with-team response schema and includes manager in ProjectResponse.
test/test_technical_task_submissions.py Adds service/error-handling and response-shape tests for task submissions.
test/test_skill_service_response.py Adds tests asserting skill search response includes image_url.
test/test_projects.py Updates authorization tests for add/remove member endpoints.
test/test_project_manager_validation.py Adds tests for manager validation and update payload handling.
test/test_profile_page.py Adjusts directory-related test setup to set user status to ACCEPTED.
test/test_org_chart.py Adjusts org chart tests to ensure users are ACCEPTED before querying.
scripts/url_mapping.json Removes large URL mapping JSON file from the repo.
Comments suppressed due to low confidence (1)

utils/utils.py:47

  • get_key_by_value returns None when the years-of-experience value is out of the supported ranges. Downstream code (e.g., TechnicalTaskService.create_submission) now expects invalid experience to raise an error, so this will silently propagate None and typically turn into a misleading “task not found” 404 instead of a 400 validation error. Consider raising ValueError (or returning a sentinel) when the value is not mapped, and include the valid ranges in the message.
def get_key_by_value(value):
    # Map years of experience to ExperienceLevel enum values
    from utils.enums import ExperienceLevel

    experience_level_map = {
        ExperienceLevel.JUNIOR.value: [0, 1, 2],
        ExperienceLevel.MID_LEVEL.value: [3, 4],
        ExperienceLevel.SENIOR.value: [5, 6, 7, 8, 9, 10, 11, 12]
    }
    for key, values in experience_level_map.items():
        if value in values:
            return key
    return None

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TMCreme TMCreme merged commit e7586be into main Apr 3, 2026
1 check passed
@TMCreme TMCreme deleted the Ransford/backend-upgrade branch April 3, 2026 01:00
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