Skip to content

Multi Sector support in Assessment Analytics#5347

Merged
jekuipers merged 5 commits intodevelopfrom
feature/CSET-3261
Feb 5, 2026
Merged

Multi Sector support in Assessment Analytics#5347
jekuipers merged 5 commits intodevelopfrom
feature/CSET-3261

Conversation

@randywoods
Copy link
Collaborator

This pull request introduces significant enhancements to how sector and industry data are managed and reported for assessments. The main change is the migration of sector and subsector (industry) information from the DETAILS_DEMOGRAPHICS table to a new dedicated table, ASSESSMENT_SECTOR_SUBSECTOR. This update includes a database schema change, a data migration script, supporting backend logic, and a new API endpoint to retrieve sector sample sizes for analytics. Additional minor refactoring and copyright headers are also included.

Database migration and schema changes:

  • Added a new table, ASSESSMENT_SECTOR_SUBSECTOR, to store sector and industry information for assessments, with appropriate primary and foreign key constraints.
  • Implemented a database upgrade script and a new upgrader (ConvertDatabase12405) that migrates existing sector and subsector data from DETAILS_DEMOGRAPHICS to the new table, and removes the old records. [1] [2]

Backend business logic and API updates:

  • Added the GetSectorsAndSampleSizes method to AnalyticsBusiness, which aggregates sector sample sizes for a given assessment using the new data structure.
  • Introduced the SectorsAndSamples model to represent sector/sample size pairs for analytics.
  • Added a new API endpoint (/api/analytics/samplesizes) in AnalyticsController to expose sector sample size data, and updated controller dependencies accordingly. [1] [2] [3]

Refactoring and minor changes:

  • Updated using statements and added copyright headers in several files. [1] [2] [3]
  • Minor cleanup and removal of unused code in AnalyticsController. [1] [2] [3] [4]

🗣 Description

💭 Motivation and context

🧪 Testing

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All future TODOs are captured in issues, which are referenced in code comments.
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated to reflect the changes in this PR.
  • Tests have been added and/or modified to cover the changes in this PR.
  • All new and existing tests pass.
  • Bump major, minor, patch, pre-release, and/or build versions as appropriate via the bump_version script if this repository is versioned and the changes in this PR warrant a version bump.
  • Create a pre-release (necessary if and only if the pre-release version was bumped).

✅ Pre-merge checklist

  • Revert dependencies to default branches.
  • Finalize version.

✅ Post-merge checklist

  • Create a release (necessary if and only if the version was bumped).

@jekuipers jekuipers merged commit 1c22db5 into develop Feb 5, 2026
6 checks passed
@jekuipers jekuipers deleted the feature/CSET-3261 branch February 5, 2026 18: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.

4 participants