import { resendPasswordResetHandler } from '@/modules/password-reset/handlers/resend-password-reset.handler';
import { startPasswordResetHandler } from '@/modules/password-reset/handlers/start-password-reset.handler';
import { verifyPasswordResetHandler } from '@/modules/password-reset/handlers/verify-password-reset.handler';
import type { AppEnv } from '@/types/hono';
import { zValidator } from '@hono/zod-validator';
import {
  passwordResetResendSchema,
  passwordResetStartSchema,
  passwordResetVerifySchema,
} from '@repo/api-contract';
import { Hono } from 'hono';

export const passwordResetRoutes = new Hono<AppEnv>();

passwordResetRoutes.post(
  '/start',
  zValidator('json', passwordResetStartSchema),
  startPasswordResetHandler
);

passwordResetRoutes.post(
  '/verify',
  zValidator('json', passwordResetVerifySchema),
  verifyPasswordResetHandler
);

passwordResetRoutes.post(
  '/resend',
  zValidator('json', passwordResetResendSchema),
  resendPasswordResetHandler
);
