import type { Context } from "hono";
import { payExpense, payExpenseSchema } from "../expenses.service";

export async function payExpenseHandler(c: Context) {
  const id = Number(c.req.param("id"));
  const body = await c.req.json();
  const parsed = payExpenseSchema.parse(body);
  const result = await payExpense(id, parsed);
  return c.json(result);
}
