teqo/src/lib/campaignQuickActionContext.ts
Francisco Solla 70070db8dc feat(C114): agenda da campanha espelhada no Google Calendar com notificação (push Teqo → Google)
Espelho oficial da agenda em calendário Google compartilhado via API
(service account, jose + fetch): reconciliação por passada com id
determinístico teqo+base32hex (upsert idempotente, sem estado por evento),
hooks afterChange/afterDelete na activity (só campos espelhados, nunca
lança), auto-resync quando calendarId muda, retry na view da agenda,
pill de estado no header + FAB + diálogo (4 estados). Cancelado no Teqo
deleta o evento no Google. Sem participantes no v1 (decisão de produto).
Sem migration nova de tabela (hand-written). Closes #635
2026-08-11 13:53:51 -03:00

23 lines
803 B
TypeScript

/**
* Client-safe quick-action context — routes and B80+ providers fill this so
* `resolveQuickActionsForPath` can prefill wizard/list hrefs.
*/
export type CampaignQuickActionContext = {
municipalitySlug?: string
municipalityId?: number
leadershipId?: number
organizationSlug?: string
activitySlug?: string
demandSlug?: string
advisorId?: number
/**
* Dialog-style action bridged by the agenda page: opens the calendar-feed
* dialog (C94). A function can live in this client-only context — never
* crossed server→client.
*/
openCalendarFeed?: () => void
/** C114 — opens the Google Calendar mirror dialog (same bridge as above). */
openGoogleCalendarSync?: () => void
}
export const emptyCampaignQuickActionContext = (): CampaignQuickActionContext => ({})