feat: v0.12.0 — contracts → packages: load/fly/abandon gameplay (ATR 72-600 capacity 6, manual flight to any airport, time-scaled abandon penalty 15–60%), one-time DB migration preserving wallet/clock; new endpoints /api/packages/:id/load|abandon + /api/planes/:planeId/fly
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { abandonPackage, performAction } from '@/lib/game/actions';
|
||||
|
||||
// POST /api/packages/:id/abandon (v0.12.0) — no body. Drops a LOADED (or already
|
||||
// EXPIRED) package while its plane is GROUNDED: cash -= penalty (15% of the payout
|
||||
// at creation scaling to 60% at the deadline; expired packages cost nothing, cash
|
||||
// floors at €0), the package becomes "abandoned" and frees its slot. 404 unknown
|
||||
// id; 409 wrong status or the plane is in flight. 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) => abandonPackage(inst, id));
|
||||
}
|
||||
Reference in New Issue
Block a user