Feature Requests
Planned

[G1b] Wire the remaining XP sources (games, books, music, reviews, comments, lists, imports)

Follow-up to [G1] (post_01m1f96j6dexyrvzkm935vajxp, PR #178), which shipped the XP ledger, the barème and the level curve, wired end-to-end for a single witness source (EPISODE_WATCHED) to prove the design.

Scope

Wire every remaining XpReason declared in packages/shared/src/xp-rules.ts to its real call site, following the exact pattern G1 established on library.service.ts's episode paths: award on creation/completion, revokeBySource on the matching cancellation path (loading ids before any $transaction, calling XP methods after it), never inside a transaction.

  • Movies (library.service.ts): MOVIE_WATCHED (entry reaches COMPLETED), MOVIE_REPLAYED (addReplay/deleteReplay).
  • Series/anime completion: SEASON_COMPLETED, SERIES_COMPLETED — detect the transition where marking an episode watched makes a season/series newly complete (mirror LibraryService.computeProgress's notion of "done", season 0 excluded). The verifiers already exist in xp-verifiers.ts; only the award call site is missing.
  • Games (game-library.service.ts): GAME_FINISHED, GAME_REPLAYED.
  • Books (book-library.service.ts): BOOK_FINISHED, BOOK_REPLAYED.
  • Music (music-library.service.ts): ALBUM_LISTENED.
  • Additions: WORK_ADDED across all four domains' entry-creation paths, DOMAIN_STARTED on first entry per domain per user.
  • Reviews (review.service.ts): WORK_RATED/REVIEW_WRITTEN/REVIEW_DETAILED in setRating; revoke on setRating(null), remove, removeMany.
  • Review votes: REVIEW_VOTE_RECEIVED credited to the review's author, not the voter, on vote/unvote (including the UP→DOWN in-place flip — verifier already checks value = UP).
  • Comments (comment.service.ts): COMMENT_POSTED on create; revoke on soft-delete (remove/adminRemove).
  • Comment reactions: COMMENT_REACTION_RECEIVED credited to the comment's author on react/unreact.
  • Lists (list.service.ts): LIST_CREATED on create; revoke on remove.
  • Imports: IMPORT_COMPLETED forfeit, once per (user, domain) — MediaImportSource.commit (media domain), SteamSource.commit (games), BookCsvSource.commit (books). No music import source exists yet.

Explicitly out of scope

Any UI, the leaderboard ([G7]), achievements ([G2]). ADMIN_ADJUSTMENT stays reserved for [B8].

Depends on

[G1] merged (or at least stable — this ticket branches off G1's branch to avoid rebasing once it merges).

0 Comments

Sign in to comment

No comments yet. Be the first to share your thoughts!