teqo/src/components/campaign
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
..
activity B33+: shared list filter navigation hook 2026-07-27 09:05:08 -03:00
advisor Fix /campanha/liderancas 500: RSC-safe phone display 2026-07-26 20:16:01 -03:00
auth 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
dashboard simplify(B14): corrige o mecanismo da fronteira, estado unsupported e duplicatas 2026-07-26 18:03:44 -03:00
demand C13: renomeia "Plano de Acao" para "Atividade" em toda a vertical /campanha 2026-07-25 20:50:38 -03:00
invite B30: convite WhatsApp na lista de lideranças 2026-07-26 20:47:11 -03:00
leadership B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
map B8+: escala das malhas em unidades reais, contrato do map key e degradacao 2026-07-27 01:59:36 -03:00
municipality E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
organization 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
shared B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00
shell B38: sidebar recolhido em tablet no shell /campanha 2026-07-26 18:40:31 -03:00
stateDeputy B33+: close the /simplify rounds on the shared list filter hook 2026-07-27 09:39:15 -03:00
supporter B33+: shared list filter navigation hook 2026-07-27 09:05:08 -03:00
tour E13: visit eligibility checklist and the tour composer. 2026-07-27 21:04:04 -03:00
votePledge B42: Drawer quick-edit and a tappable card on the mobile municipalities list. 2026-07-27 20:49:41 -03:00