chore: commit previously untracked runtime files (splits, auth, participants, shared)

This commit is contained in:
2026-03-08 18:00:46 +11:00
parent 30a7857d13
commit 5dbeb0cb87
11 changed files with 450 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
import { NextRequest, NextResponse } from "next/server";
import { prisma } from "@/lib/db";
export async function POST(req: NextRequest) {
const body = await req.json();
const { participant_id, split_ids } = body as {
participant_id?: number;
split_ids?: number[];
};
const now = new Date();
if (participant_id) {
const result = await prisma.transaction_splits.updateMany({
where: { participant_id, settled: false },
data: { settled: true, settled_at: now },
});
return NextResponse.json({ settled: result.count });
}
if (split_ids?.length) {
const result = await prisma.transaction_splits.updateMany({
where: { id: { in: split_ids }, settled: false },
data: { settled: true, settled_at: now },
});
return NextResponse.json({ settled: result.count });
}
return NextResponse.json({ error: "participant_id or split_ids required" }, { status: 400 });
}