teqo-backup/src/components/campaign/municipality
Francisco Ignácio Fontoura Solla c7001b75f0 E14: engagement levels N0-N4 and the first allocationDecision writer.
`municipality.engagementLevel` (staff-only, no default) records what the
campaign decided to invest in a município, next to the E8/E10 metrics that
describe what it knows. Moving it is a reallocation decision, so only
unrestricted staff may, every move carries a rationale plus the signals that
would reverse it, and the write files an `allocationDecision` in the same
transaction under an advisory lock taken before the current level is read —
otherwise the snapshot's `from` is a guess. The enum gains `movimento`: a level
move is neither `aceita` nor `descarta`.

No backfill. Null is "Sem nível", and filtering by it is the triage queue.
That is also why the list sorts `nivel` in memory rather than in the query:
Postgres puts NULLs first on DESC, so a native sort would open "N4 primeiro"
on a page of municípios nobody has decided about yet. The filter stays native.

The hysteresis rules from research §6.8 are pure and client-safe, so the
Popover explains a block before submitting and the server re-runs them anyway;
a blocked move answers 409 with typed violations and the override is recorded
with exactly the rules it contradicted.
2026-07-27 21:19:33 -03:00
..
MunicipalityAdvisorAvatarStack.tsx B23: tooltip de conteudo nas celulas Assessores/Tendencia de /campanha/municipios 2026-07-26 03:21:45 -03:00
MunicipalityAdvisorsForm.tsx Pass 2 W4f: varredura de copy Praca -> Municipio 2026-07-25 15:12:07 -03:00
MunicipalityBaselineCard.tsx simplify(B13): corrige classe agregada, bolhas em pane proprio e registra debitos 2026-07-26 05:12:37 -03:00
MunicipalityCandidateComparisonTable.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityDossier.tsx E10 /simplify: remove superficie morta, unifica o parser de enum repetivel e reusa o ranking A11 2026-07-25 22:33:16 -03:00
MunicipalityEstimateScenarioContext.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityFilters.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityGoalAccountCard.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityHeaderFilter.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityLeadershipsPanel.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityLevelBadge.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityList.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityListAdvisorsControl.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityListExpectedVotesControl.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityListGoalCoverageCell.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityListLevelControl.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityListOverview.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityListSignalControl.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityListTrendControl.tsx B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
MunicipalityPledgesPanel.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalitySignalFields.tsx B26: registrar sinal tipado a partir da célula Último sinal na lista de municípios. 2026-07-25 20:42:01 -03:00
MunicipalitySortableHead.tsx B22: explicacao por coluna no header das listas — description em CampaignTableHead/MunicipalitySortableHead, campaignConceptOneLiner como fonte unica E18, municipalityColumnDescriptions cobrindo as 11 colunas de /campanha/municipios 2026-07-26 02:58:54 -03:00
MunicipalityStrategyCard.tsx E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
MunicipalityStrategyForm.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityTabNav.tsx Pass 2 W4f: varredura de copy Praca -> Municipio 2026-07-25 15:12:07 -03:00
MunicipalityUpdateFeed.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityUpdateForm.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
MunicipalityVisitEligibilityCard.tsx E13: visit eligibility checklist and the tour composer. 2026-07-27 21:04:04 -03:00
MunicipalityZoneNeighborhoodsCard.tsx Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
TerritoryFilters.tsx B33+: close the /simplify rounds on the shared list filter hook 2026-07-27 09:39:15 -03:00
TerritoryHeaderFilter.tsx B21: cria página própria dos territórios 2026-07-25 21:50:24 -03:00
TerritoryLink.tsx B25: link do território na lista de municípios 2026-07-26 18:59:49 -03:00
TerritoryList.tsx B25: link do território na lista de municípios 2026-07-26 18:59:49 -03:00
TerritoryListColumns.tsx E12: camada TI com rollups MAUP e benchmark intra-TI. 2026-07-26 21:26:47 -03:00
TerritorySortableHead.tsx E12: camada TI com rollups MAUP e benchmark intra-TI. 2026-07-26 21:26:47 -03:00
TseZoneBadge.tsx Pass 2 W2: components/campaign em subpastas por dominio 2026-07-25 14:52:17 -03:00