teqo-backup/scripts
Francisco Ignácio Fontoura Solla a32ba3b4f0 Cache the campaign hot path: committed TSE artifact + request-scoped dedup
- committed artifact src/lib/electionAggregates/bahia-federal-baseline.json
  (Solla nominal + federal T1 valid votes per catalog municipality × TSE year,
  Salvador split by zone) generated by pnpm build:election-aggregates from the
  locally seeded TSE data; typed loader src/lib/bahiaElectionAggregates.ts;
  snapshot spec pins artifact ↔ catalog ↔ baseline ticket
- map bundle: historical years now read the artifact (was 6 statewide
  city×zone scans per dashboard visit); compare mode keeps only the OTHER
  candidate on the DB path (Solla side from the artifact)
- loadMunicipalityScope (React cache()): one municipality find + pledge
  aggregate per request shared by dashboard KPIs, map bundle, and the
  municípios list overview (was 2-3 duplicate loads)
- unstable_cache + election-tse tag on the immutable elections-tab loaders
  (baseline, candidate comparison, candidate options); tag added to the
  /api/revalidate allowlist — runbook: re-seed then bust the tag
- municipalityMapContract.ts: client-safe map vocabulary/bundle types so the
  client panel no longer imports the server data module (build had pulled
  @payload-config into the client graph); municipalityMapData is server-only
  and re-exports the contract; PLAZA_MAP_* renamed to MUNICIPALITY_MAP_*
- petition generateStaticParams enumerates bare ids (getPetitionIds)
2026-07-23 23:06:28 -03:00
..
consent-texts Restore full roadmap detail and align project documentation. 2026-07-19 16:19:36 -03:00
assert-local-database.mjs Add TSE 2022 election results model and local seed import. 2026-07-18 18:25:19 -03:00
build-bahia-demographics.mjs Add the tooling gate: knip, CI, zero-warning lint, as-never ban 2026-07-23 23:06:12 -03:00
build-bahia-geometries.mjs Add static Bahia municipality and territory geometries for the campaign map. 2026-07-18 22:07:41 -03:00
build-bahia-tse-city-codes.mjs Deliver A7 Fase 2 cityCode TSE geography filters and absorb simplify debts. 2026-07-19 22:48:08 -03:00
build-election-aggregates.mjs Cache the campaign hot path: committed TSE artifact + request-scoped dedup 2026-07-23 23:06:28 -03:00
db-pull.mjs Isolate local/dev and tests from the production database 2026-07-15 13:52:30 -03:00
generate-remodel-municipalities-migration.mjs Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00
guard-dev-db.mjs Add TSE 2022 election results model and local seed import. 2026-07-18 18:25:19 -03:00
regenerate-municipality-catalog-snapshot.mjs Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00
seed-consent.mjs Add allowlisted global cache revalidation for Onda 0 F1. 2026-07-19 22:21:16 -03:00
seed-loader.mjs Add TSE 2022 election results model and local seed import. 2026-07-18 18:25:19 -03:00
seed-posts.mjs Add TSE 2022 election results model and local seed import. 2026-07-18 18:25:19 -03:00
seed-tse-results.mjs Add E2 TSE 2014/2018 vote series and historical trend insights. 2026-07-19 05:09:43 -03:00