import { z } from 'zod';

/**
 * Payload column for `macsync.mail_send_queue` rows. Currently used for
 * outbound sends only (`send_mail` action). Mirrors the contract shape
 * documented in the Wave plan.
 */
export const mailSendPayloadSchema = z.object({
  to: z.string().email(),
  cc: z.array(z.string().email()).optional(),
  bcc: z.array(z.string().email()).optional(),
  subject: z.string(),
  body: z.string(),
  isHtml: z.boolean().optional(),
});

export type MailSendPayload = z.infer<typeof mailSendPayloadSchema>;

export const MAIL_SEND_ACTIONS = ['send_mail'] as const;
export type MailSendAction = (typeof MAIL_SEND_ACTIONS)[number];
