feat: v0.8.0 — player-actions API: accept/dispatch/buy/sell/refuel endpoints (tick-first, full-snapshot responses), spawn coverage rule, test create-contract hook

This commit is contained in:
2026-09-17 13:54:13 +00:00
parent 96835e935d
commit aa70eb5286
25 changed files with 1843 additions and 8 deletions
+10
View File
@@ -0,0 +1,10 @@
import { acceptContract, performAction } from '@/lib/game/actions';
// POST /api/contracts/:id/accept (v0.8.0) — claim an open contract: status flips
// open → accepted. 404 unknown id; 409 if the contract is not 'open' (accepted /
// completed / expired). No body. On success returns the full state snapshot.
export async function POST(_req: Request, ctx: { params: Promise<{ id: string }> }) {
const { id } = await ctx.params;
return performAction((inst) => acceptContract(inst, id));
}