Skip to content

Move skill profile queries and wheel data into a shared service module #899

Todo

Description

@TinyMarsh

Description and motivation

During review of #866, @AdrianDAlessandro suggested moving skill-profile data access and row-building into a shared service, similar to main/team_services.py. We left that work out of #866 because it also affects personal skill profiles and downloads, beyond the team-page scope.

Three parts of the app currently fetch skill assessments and build rows for visualisations or downloads. Each has its own query and data-shaping code. The personal wheel and downloads also fetch related skill, competency and domain data one row at a time, causing extra database queries.

A shared service would give these existing pages, and future profile views such as #809, one place to get skill-profile data consistently.

Proposed approach

  • Add a service module for skill-profile data. The module name can be chosen during implementation.
  • Move the personal wheel, download and team aggregate data queries and formatting into that module.
  • Use framework order for skill lists in the personal wheel, downloads and team wheel.
  • Load related skills, competencies and domains together to avoid extra queries for each row.
  • Update the views to use the service.

Acceptance criteria

  • The personal wheel, CSV and JSON downloads, and team wheel get their skill-profile data through the shared service.
  • Skill lists use framework order.
  • The existing CSV and JSON field names and data shapes remain unchanged.
  • Tests cover the service data and its use by the relevant views; existing tests continue to pass.

Affected areas

  • main/team_services.py
  • main/views/account_views.py
  • main/views/account_data_views.py
  • A new skill-profile service module under main/
  • Related service and view tests

Additional context

Current code paths:

Code Used for Data keys Current ordering
SkillProfileView.get_context_data in main/views/account_views.py Personal competency wheel skill, category, subcategory, skill_level Unspecified
format_skill_profile_data_for_download in main/views/account_data_views.py CSV and JSON downloads skill, competency_domain, competency, skill_level Unspecified
aggregate_team_skill_profile in main/team_services.py Team competency wheel skill, category, subcategory, skill_level Framework order

Using framework order will change the current order in personal wheels and downloads. This issue does not include adding new aggregate types or building a team dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions