Skip to content

Canonicalize sector/age field naming; drop dead agency_type mapping - #2278

Merged
maebeale merged 6 commits into
mainfrom
maebeale/remove-primary-sector-single
Aug 30, 2026
Merged

Canonicalize sector/age field naming; drop dead agency_type mapping#2278
maebeale merged 6 commits into
mainfrom
maebeale/remove-primary-sector-single

Conversation

@maebeale

@maebeale maebeale commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

🤖 suggested review level: 3 Read 📖 mostly mechanical renames, but touches dashboard aggregate methods + a live label map — worth a read

Finishes the sector/age identifier cleanup so the codebase uses only canonical values, and removes a now-dead legacy mapping.

⚠️ The original goal — removing the primary_sector_single legacy identifier — already shipped in main via #2419. After rebasing, this PR is the leftover naming cleanup + a canonical-value sweep.

Naming: match the canonical identifiers

The multi-select fields are plural (additional_sectors, additional_age_groups); the single-select ones stay singular (primary_sector, primary_age_group). Internal names now follow suit.

  • Spec labels: additional_sectoradditional_sectors (professional-fields spec); additional_age_group_fieldadditional_age_groups_field (dashboard spec).
  • EventDashboard aggregates: additional_sector_count / _ids / _registrant_idsadditional_sectors_* (and their call sites in dashboard/roster views + the adjacent registration local). primary_sector_* stays singular.
  • form_field.rb: reworded the PRIMARY_SECTOR_FIELD_IDENTIFIERS comment to singular — it holds one identifier now.

Remove dead legacy mapping

  • Dropped the agency_type → "Type" entry (and its test) from FormSubmissionChanges. It existed only for old Ahoy events written before the agency_typeorganization_type column rename; those events have been removed, so nothing stamps that property anymore.

Sweep result

Swept for lingering legacy identifiers from the recent renames — all data-coupled conversions are complete. No legacy identifier strings remain in live code, specs, or seeds (payer_* form fields, agency_*, primary_service_area, singular additional_age_group — all gone; remaining payer_* is the Payment model's own domain).

Base automatically changed from maebeale/consolidate-sector-fields to main August 21, 2026 10:41
maebeale and others added 2 commits August 30, 2026 07:42
Drop the legacy alias now that primary_sector is the canonical primary
sector identifier. Merge only after prod form data is migrated from
primary_sector_single → primary_sector (see the connected issue). With no
legacy identifiers left, the legacy_form_identifiers dev seed and its rake
task go too.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The canonical identifier is additional_sectors (plural, multi-select), so
the spec-local hash key, let, and ids[] references should read plural too —
a singular "additional_sector" label reads as one sector for a many-sector
field. Names now match the value's number.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale force-pushed the maebeale/remove-primary-sector-single branch from cc537df to 8451ed5 Compare August 30, 2026 11:46
@maebeale maebeale changed the title Remove the primary_sector_single legacy field identifier Pluralize additional_sectors labels in the professional-fields spec Aug 30, 2026
@maebeale
maebeale marked this pull request as ready for review August 30, 2026 11:47
Matches the plural canonical identifier (additional_age_groups) the let
already creates — same tidy as the professional-fields spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale maebeale changed the title Pluralize additional_sectors labels in the professional-fields spec Pluralize additional_sectors / additional_age_groups spec labels Aug 30, 2026
maebeale and others added 2 commits August 30, 2026 08:19
The old Ahoy events written with the pre-rename agency_type property have
been removed, so nothing stamps that column name anymore — the dual mapping
and its test are dead. organization_type is now the only source.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The additional-sectors field is multi-select, so its dashboard aggregates
(count / ids / registrant_ids) and the adjacent registration local now read
plural, matching the canonical additional_sectors identifier. primary_sector_*
stays singular — that field is single-select.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale maebeale changed the title Pluralize additional_sectors / additional_age_groups spec labels Canonicalize sector/age field naming; drop dead agency_type mapping Aug 30, 2026
organization_name is the only identifier read for the org-name answer now
(the agency_name alias is long gone), so "canonical or legacy" misleads.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@maebeale
maebeale merged commit 4744076 into main Aug 30, 2026
3 checks passed
@maebeale
maebeale deleted the maebeale/remove-primary-sector-single branch August 30, 2026 12:36
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.

1 participant