lila/packages/db
lila f53ac618bb feat(api): assemble full GameSession with shuffled answer options
Extend the game flow from raw term rows to a complete GameSession
matching the shared schema:

- Add getDistractors model query: fetches N same-POS, same-difficulty,
  same-target-language terms excluding a given termId. Returns bare
  strings since distractors only need their display text.
- Fix getGameTerms select clause to use the neutral field names
  (sourceText, targetText, sourceGloss) that the type already declared.
- Rename gameService entry point to createGameSession; signature now
  takes a GameRequest and returns a GameSession.
- Per question: fetch 3 distractors, combine with the correct answer,
  shuffle (Fisher-Yates), assign optionIds 0-3 by post-shuffle index,
  and assemble into a GameQuestion with a fresh UUID.
- Wrap the questions in a GameSession with its own UUID.
- Run per-question distractor fetches in parallel via Promise.all.

Known gap: the correct option is not yet remembered server-side, so
/game/answer cannot evaluate submissions. SessionStore lands next.
2026-04-10 21:44:36 +02:00
..
drizzle formatting 2026-04-10 20:09:46 +02:00
src feat(api): assemble full GameSession with shuffled answer options 2026-04-10 21:44:36 +02:00
drizzle.config.ts chore(db): add drizzle migration pipeline with empty schema 2026-03-24 11:04:40 +01:00
package.json extraction datafiles with cefr annotations 2026-04-08 13:09:47 +02:00
tsconfig.json formatting 2026-03-31 10:06:06 +02:00
vitest.config.ts chore: configure vitest with project-based setup and coverage 2026-03-20 19:25:00 +01:00