mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 06:43:06 +00:00
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
21 lines
871 B
TypeScript
21 lines
871 B
TypeScript
/**
|
|
* Shared description parts for campaign activities — the iCal feed and the
|
|
* C114 Google mirror render the same facts (municipality, locality, tags,
|
|
* deputy flag) with their own consumers' separators/escapes. No PII: no
|
|
* leadership names, phones or emails.
|
|
*/
|
|
import type { Activity } from '@/payload-types'
|
|
|
|
export type ActivityDescriptionSource = Pick<Activity, 'locality' | 'tags' | 'deputyPresent'>
|
|
|
|
export const buildActivityDescriptionParts = (
|
|
activity: ActivityDescriptionSource,
|
|
municipalityName?: string,
|
|
): string[] => {
|
|
const parts: string[] = []
|
|
if (municipalityName) parts.push(`Município: ${municipalityName}`)
|
|
if (activity.locality) parts.push(`Local: ${activity.locality}`)
|
|
if (activity.tags?.length) parts.push(`Tags: ${activity.tags.join(', ')}`)
|
|
if (activity.deputyPresent) parts.push('Deputado presente')
|
|
return parts
|
|
}
|