feat: Phase 5 — events system complete
CI / Build, lint & test (push) Successful in 2m5s

Adds a data-driven event system (#47 schema, #48 activation, #49 TOTW):

- EventDefinition JSON schema (event_type, effects, date range, is_manual)
- data/events/totw_week1.json — TOTW event active by date range (2024–2030),
  injects 5 TOTW cards into the market as [EVENT] listings
- data/events/seasonal_events.json — Spring Festival and Icon Weekend,
  manual-activation-only example events
- migrations/0004_events.sql — events override table (NULL/1/0 per event)
- services/event — load_event_definitions, compute_is_active (date range +
  manual override), get_active_events, get_all_with_status, activate/deactivate
- routes/events — GET /events, GET /events/:id, POST .../activate, .../deactivate
- services/market::refresh_npc_listings now accepts event_defs, injects bonus
  market cards from active events at 2× premium price
- 5 new integration tests (events list, single, activate/deactivate cycle,
  404 on unknown, market injection verification); 19/19 passing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
funman300
2026-06-25 16:02:45 -07:00
parent f6dd41fd41
commit 1ef2c436ab
13 changed files with 522 additions and 21 deletions
+25
View File
@@ -0,0 +1,25 @@
[
{
"id": "totw_week1",
"name": "Team of the Week 1",
"description": "This week's TOTW is live! TOTW players appear in the transfer market at a premium and pack weights are boosted.",
"event_type": "totw",
"starts_at": "2024-01-01T00:00:00Z",
"expires_at": "2030-12-31T23:59:59Z",
"is_manual": false,
"effects": {
"pack_weight_boosts": [
{ "rarity": "totw", "multiplier": 3.0 }
],
"bonus_market_cards": [
"card_totw_001",
"card_totw_002",
"card_totw_003",
"card_totw_004",
"card_totw_005"
],
"unlocks_sbc_ids": [],
"unlocks_objective_ids": []
}
}
]