import type { CourseEnrollmentStatus } from "./courses";
export type ParticipantMessageTarget = {
    kind: "event_series";
    seriesId: string;
} | {
    kind: "event_occurrence";
    seriesId: string;
    occurrenceId: string;
} | {
    kind: "course";
    courseId: string;
    includeStatuses: CourseParticipantMessageStatus[];
};
export type CourseParticipantMessageStatus = Extract<CourseEnrollmentStatus, "enrolled" | "completed">;
export type GetParticipantMessageRecipientsRequest = {
    target: ParticipantMessageTarget;
};
export type ParticipantRecipientExclusionReason = "missing_email" | "cancelled" | "waitlist" | "duplicate_email" | "payment_pending" | "context_cancelled" | "not_in_scope";
export type ParticipantMessageRecipientPreview = {
    email: string;
    displayName: string | null;
    sourceIds: string[];
    sourceLabels: string[];
    duplicateSourceCount: number;
};
export type ParticipantMessageExcludedRecipientPreview = {
    reason: ParticipantRecipientExclusionReason;
    sourceId: string;
    sourceLabel: string;
    displayName: string | null;
    email: string | null;
    normalizedEmail: string | null;
};
export type ParticipantMessageRecipientSummary = {
    totalSources: number;
    includedCount: number;
    excludedCount: number;
    excludedByReason: Partial<Record<ParticipantRecipientExclusionReason, number>>;
    duplicateEmailCount: number;
    copyWarning: {
        kind: "large_copy_list";
        threshold: number;
        count: number;
    } | null;
};
export type ParticipantMessageRecipientsResponse = {
    target: ParticipantMessageTarget;
    planVersion: string;
    emailReadiness: ParticipantMessageEmailReadiness;
    included: ParticipantMessageRecipientPreview[];
    excluded: ParticipantMessageExcludedRecipientPreview[];
    summary: ParticipantMessageRecipientSummary;
    copyText: string;
};
export type ParticipantMessageEmailReadiness = {
    status: "ready";
    checkedAt: string;
} | {
    status: "blocked";
    checkedAt: string;
    issues: ParticipantMessageEmailReadinessIssue[];
};
export type ParticipantMessageEmailReadinessIssue = {
    code: "email_transport_unavailable" | "email_identity_unavailable";
    message: string;
};
export type SendParticipantMessageRequest = {
    target: ParticipantMessageTarget;
    planVersion: string;
    subject: string;
    bodyText: string;
    confirmLargeAudience?: boolean;
};
export type TestParticipantMessageRequest = {
    target: ParticipantMessageTarget;
    planVersion: string;
    subject: string;
    bodyText: string;
};
export type TestParticipantMessageResponse = {
    sent: true;
    email: string;
};
export type ParticipantMessageSendResponse = {
    batchId: string;
    target: ParticipantMessageTarget;
    planVersion: string;
    recipientCount: number;
    sentCount: number;
    queuedCount: number;
    failedCount: number;
    duplicateCount: number;
    status: "sent" | "queued" | "partial_failure" | "failed" | "duplicate";
};
export type ListParticipantMessageHistoryRequest = {
    target: ParticipantMessageTarget;
};
export type ParticipantMessageHistoryEntry = {
    batchId: string;
    target: ParticipantMessageTarget;
    subject: string;
    recipientCount: number;
    sentCount: number;
    queuedCount: number;
    failedCount: number;
    duplicateCount: number;
    status: "sent" | "queued" | "partial_failure" | "failed" | "duplicate";
    createdAt: string;
    updatedAt: string;
};
export type ParticipantMessageHistoryResponse = {
    history: ParticipantMessageHistoryEntry[];
};
