import { NotificationFallbackPolicy, NotificationTemplateState } from '../../common/constants/notifications.constant'; import { Paginated } from '../content/content.type'; /** Query for `GET /notifications/templates` — every field is a filter. */ export interface NotificationTemplateListQuery { /** Template name — the variant family (audience variant = `.`). */ name?: string; /** Prefix match — `name LIKE '%'` (BE `name_prefix`). */ namePrefix?: string; /** Locale dimension of the variant (e.g. `vi`, `en`). */ locale?: string; /** Lifecycle state filter (draft | enabled | archived). */ state?: NotificationTemplateState | string; /** Category filter (e.g. `workflow`). */ category?: string; /** Standard CMS pagination (`page`/`per_page` — §7.3, updated 2026-09-11). */ page?: number; perPage?: number; /** Sort field — engine whitelist `created_at` · `updated_at` · `name` · * `version` (shared SortSpec; anything else ⇒ 422 — §7.3, updated * 2026-09-15). */ sortBy?: 'created_at' | 'updated_at' | 'name' | 'version'; /** Sort direction (`asc` | `desc`). Engine default is newest-first * (`created_at DESC, id DESC`). */ sortDirection?: 'asc' | 'desc'; } /** One notification-template VERSION (the `{template_id}` addressable row). */ export interface NotificationTemplateVersion { id: string | number; /** Stable family name, e.g. `people.welcome`; audience variant `.`. */ name: string; /** The variant dimension — one row per (name, locale). */ locale: string; /** Mustache — rendered per recipient and COPIED to the notification row at * creation (a later version never changes an in-flight notification). */ subject?: string; body: string; category?: string; fallbackPolicy?: NotificationFallbackPolicy; state: NotificationTemplateState; createdAt?: string; updatedAt?: string; [key: string]: unknown; } /** POST body — create a Mustache draft (`notify:templates:manage`). */ export interface NotificationTemplateCreatePayload { name: string; locale: string; subject: string; body: string; category?: string; fallbackPolicy?: NotificationFallbackPolicy; } /** PUT body — draft ONLY; enabled/archived rows return 409. Create a * same-name/locale draft for the next version instead. */ export type NotificationTemplateUpdatePayload = Partial; /** List envelope. The engine omits `page` / `perPage` for this * endpoint (template list is small and UI-paged client-side) — extend * `Paginated` and drop them. */ export type NotificationTemplateListResponse = Pick, 'items' | 'total'>; /** `POST /notifications/templates/render` — ad-hoc preview, no persistence. */ export interface NotificationRenderPayload { templateStr: string; context: Record; } /** Render result — subject/body with placeholders resolved. */ export interface NotificationRenderResult { subject?: string; body: string; [key: string]: unknown; } /** Report-template row — engine-owned schema; the People seed * (`people.access-review-report`) is pack-managed (read-only for the portal). */ export interface ReportTemplate { id: string | number; name?: string; [key: string]: unknown; } /** `POST /report-templates/{template_id}/preview` body. */ export interface ReportTemplatePreviewPayload { sampleData: unknown[]; } //# sourceMappingURL=notifications.type.d.ts.map