import type { Context } from "hono";
import {
  adjustBalance,
  adjustBalanceSchema,
} from "../wallets.service";

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