import { z } from "zod";
const clock = z.string().regex(/^(?:[01]\d|2[0-3]):[0-5]\d$/, "Use HH:MM time");
export const reminderInput = z.object({ enabled: z.boolean(), time: clock, quietStart: clock, quietEnd: clock }).strict();
export const defaultReminder = { enabled: false, time: "20:00", quietStart: "22:00", quietEnd: "08:00" };
export type ReminderPreferences = z.infer<typeof reminderInput>;
export type ReminderResponse = ReminderPreferences & { available: boolean; lastDelivery: { date: string; status: string } | null };
export function inQuietHours(time: string, start: string, end: string) {
  if (start === end) return false;
  return start < end ? time >= start && time < end : time >= start || time < end;
}
