import type { NotificationChannel } from './notification.types';

export interface TemplateVariable {
  name: string;
  type: 'string' | 'number' | 'boolean' | 'date';
  required: boolean;
  defaultValue?: string;
}

export interface TemplateDefinition {
  id: string;
  name: string;
  channel: NotificationChannel;
  subject?: string;
  body: string;
  htmlBody?: string;
  locale: string;
  variables: TemplateVariable[];
  category: string;
}

export interface ResolvedTemplate {
  id: string;
  subject?: string;
  body: string;
  htmlBody?: string;
  locale: string;
  channel: NotificationChannel;
}

export interface TemplateResolutionOptions {
  templateId: string;
  locale?: string;
  variables?: Record<string, unknown>;
  fallbackLocale?: string;
}

export interface TemplateCacheEntry {
  template: TemplateDefinition;
  resolvedAt: Date;
  ttl: number;
}

export type TemplateStore = Map<string, Map<string, TemplateDefinition>>;
