first commit

This commit is contained in:
mdares
2026-04-07 08:54:41 -06:00
commit 3d1a8ba07e
92 changed files with 15392 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
import { z } from "zod";
import { fail, ok } from "@/lib/http";
import { closeShift } from "@/server/services/shiftService";
import { ensureSystemBootstrapped } from "@/server/system/bootstrap";
const schema = z.object({
shiftId: z.string(),
actualCashCents: z.number().int().min(0),
notes: z.string().max(300).optional()
});
export async function POST(request: Request) {
await ensureSystemBootstrapped();
try {
const payload = schema.parse(await request.json());
const shift = await closeShift(payload);
return ok({ shift });
} catch (error) {
return fail("No fue posible cerrar turno", 400, String(error));
}
}