teqo-backup/src/lib/campaignConsentKeys.ts
Cursor Agent de67acf41b D2 — Push + sino in-app para /campanha
- Collections Notification e PushSubscription com migration
- Sino no header (mobile + desktop) com drawer de avisos lidos/não lidos
- Hooks em municipalityUpdate, supporter, activity e convite aceito
- Push Web via web-push + handlers no service worker /campanha/sw.js
- Opt-in LGPD em /campanha/perfil (chave campanha-notificacoes-push)
- Testes unit/int de contrato e access

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-07-31 01:51:41 +00:00

30 lines
1.4 KiB
TypeScript

/**
* Stable LGPD consent keys the app resolves at runtime (fail-closed: the flows
* refuse to run while the admin has not created the Consent row with the exact
* key). Client-safe constants — the resolution logic lives in
* `src/utilities/campaignConsent.ts` (server-only).
*/
export const CAMPAIGN_INVITE_CONSENT_KEY = 'lideranca-autopreenchimento'
export const SUPPORTER_REGISTRATION_CONSENT_KEY = 'apoiador-cadastro'
export const SUPPORTER_VOTE_INTENTION_CONSENT_KEY = 'apoiador-intencao-voto'
/**
* Fail-closed refusals shown while the keyed Consent row is missing — matched
* verbatim by the routes' `safeMessages`, so they live next to their keys.
*/
export const SUPPORTER_REGISTRATION_CONSENT_MISSING_MESSAGE =
'Consentimento de cadastro de apoiador ainda não configurado.'
export const SUPPORTER_VOTE_INTENTION_CONSENT_MISSING_MESSAGE =
'Consentimento de intenção de voto ainda não configurado.'
/**
* Public-site WhatsApp subscription consent. Historically the flow hardcoded
* `consent: 2`; migration `20260725_170000_whatsapp_subscription_consent_key`
* tags that live document with this stable key (Pass 2 D3).
*/
export const WHATSAPP_SUBSCRIPTION_CONSENT_KEY = 'whatsapp-inscricao'
export const CAMPAIGN_PUSH_CONSENT_KEY = 'campanha-notificacoes-push'
export const CAMPAIGN_PUSH_CONSENT_MISSING_MESSAGE =
'Consentimento de notificações push ainda não configurado.'