import type { Context } from "hono";
import { createNonPeriodicExpense, createNonPeriodicExpenseSchema } from "../expenses.service";

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