import type { Context } from "hono";
import { createPeriodicExpense, createPeriodicExpenseSchema } from "../expenses.service";

export async function createPeriodicExpenseHandler(c: Context) {
  const body = await c.req.json();
  const parsed = createPeriodicExpenseSchema.parse(body);
  const result = await createPeriodicExpense(parsed);
  return c.json(result, 201);
}
