/**
 * Magic link types for SmartAuth Phase 6B.
 */

import { z } from 'zod';

export interface MagicLinkTokenDoc {
  id: string;
  productId: string;
  email: string;
  tokenHash: string;
  expiresAt: string;
  usedAt: string | null;
  createdAt: string;
}

export const MagicLinkRequestSchema = z.object({
  email: z.string().email(),
  productId: z.string().min(1),
});

export const MagicLinkVerifySchema = z.object({
  token: z.string().min(1),
  email: z.string().email(),
});
