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
+11
View File
@@ -0,0 +1,11 @@
import { performAction, refuelPlane } from '@/lib/game/actions';
// POST /api/planes/:planeId/refuel (v0.8.0) — no body. Fills a grounded plane to
// maxFuel at the fuel price per missing liter; deducts the cost from cash. 404
// unknown id; 409 if the plane is flying or cash is insufficient. On success
// returns the full state snapshot (fuel back to max, cash reduced by the cost).
export async function POST(_req: Request, ctx: { params: Promise<{ planeId: string }> }) {
const { planeId } = await ctx.params;
return performAction((inst) => refuelPlane(inst, planeId));
}