teqo-backup/src/lib/schemas/calendarFeed.ts
Francisco Solla 25773d0296
feat(C16): add calendar feed sync by filter with Google Calendar import link (#419)
- Add calendarFeed collection with secret slug credential
- Add iCal feed endpoint at /campanha/agenda/ical/[secret] (unauthenticated)
- Add server actions for creating and revoking calendar feeds
- Add CalendarFeedButton UI component in agenda filters bar
- Add unit tests for iCal generation
- Fail-closed access: feed re-evaluates creator's municipality scope on each read
- Leader lockdown preserved; no PII in feed output
2026-08-08 14:47:17 +00:00

14 lines
503 B
TypeScript

import { z } from 'zod'
import { positiveRelationshipId } from '@/lib/schemas/primitives'
const MAX_CALENDAR_FEED_LABEL_LENGTH = 120
export const calendarFeedCreateSchema = z.object({
label: z.string().trim().min(1).max(MAX_CALENDAR_FEED_LABEL_LENGTH),
filterMunicipality: positiveRelationshipId.optional(),
filterDeputyPresent: z.boolean().optional(),
filterTag: z.string().trim().min(1).max(80).optional(),
})
export type CalendarFeedCreateInput = z.input<typeof calendarFeedCreateSchema>