- Add 'Add to Theseus (jenin)' button in admin orders expanded view
- POST /admin/orders/:id/theseus creates a letter in the 'scraps' queue on mail.hackclub.com
- Uses item name as rubber stamps, order shipping address for recipient
- Saves letter ID (ltr!xxx) as tracking number with clickable link to Theseus back office
- Idempotency key prevents duplicate letters
- Add THESEUS_API_KEY to config and .env.example
DM @jenin on Slack for env vars
perRollMultiplier (default 0.05) was being applied as a direct multiplier
on the base roll cost, making everything cost 1-3 scraps instead of the
correct amount. It should only be used as an escalation factor per
previous roll: displayRollCost = baseRollCost * (1 + perRollMultiplier * rollCount)
- Restore handler now decrements shop_items.count for purchase/luck_win
orders (reverses the increment from delete), with GREATEST(..., 0) guard
- Delete handler now selects notes, isFulfilled, updatedAt so they're
included in the archived deleted_payload JSONB
- Restore INSERT now includes notes, is_fulfilled, updated_at columns
- Archive order + related rows (refinery, rolls, penalties) into single
deleted_payload JSONB column matching migration 0014 schema
- Add runtime CREATE TABLE fallback for missing admin_deleted_orders
- Full restore handler restores order with original ID (OVERRIDING SYSTEM
VALUE) plus all related rows; remove duplicate simple restore handler
- Delete transaction refunds stock count for purchase/luck_win orders
- Add detailed error logging for diagnostics
- Add batch compute-roll-costs endpoint and per-roll multiplier support