/**
 * Request schemas for the /admin/auth/* endpoints. Phone is validated/normalised
 * in the service (src/lib/phone.ts), not here — the schema only asserts shape.
 */
import { z } from 'zod';

export const loginSchema = z.object({
  phone: z.string().trim().min(3).max(32),
  password: z.string().min(1).max(200),
});

// Email, not phone — the reset link is delivered by email anyway (§8), and
// the admin portal's forgot-password screen asks for the account's email.
export const forgotPasswordSchema = z.object({
  email: z.string().trim().email().max(254),
});

export const resetPasswordSchema = z.object({
  token: z.string().min(10).max(200),
  password: z.string().min(8).max(128),
});

export type LoginInput = z.infer<typeof loginSchema>;
export type ForgotPasswordInput = z.infer<typeof forgotPasswordSchema>;
export type ResetPasswordInput = z.infer<typeof resetPasswordSchema>;
