teqo-backup/src/utilities/municipality/municipalityCatalogCache.ts
Francisco Ignácio Fontoura Solla 4806c417c8 Engineering Pass 3: consolidate patterns and lock them with guards.
Fold duplicated campanha access, loaders, list/filter/form shells, and scripts into shared modules; reorganize utilities by domain; stabilize e2e; and document prevention-first audit workflow so the same smells cannot creep back in.
2026-07-29 06:11:29 -03:00

14 lines
679 B
TypeScript

import 'server-only'
/**
* Cache tag for `unstable_cache` entries derived from the município catalog's
* system fields (name / slug / region), which are `readOnly` in admin and
* writable only by `canSetCampaignSystemField` — i.e. by a migration or seed.
* The runbook mirrors `election-tse`: after a migration that adds or renames a
* município, `POST /api/revalidate?tag=municipality-catalog` (allowlist in
* revalidateRequest.ts).
*
* The tag lives alone here (the `electionCache.ts` precedent) so importing it
* never drags `next/cache`'s `revalidatePath` into a module that only caches.
*/
export const MUNICIPALITY_CATALOG_CACHE_TAG = 'municipality-catalog'