[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 reachesCOMPLETED),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 (mirrorLibraryService.computeProgress's notion of "done", season 0 excluded). The verifiers already exist inxp-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_ADDEDacross all four domains' entry-creation paths,DOMAIN_STARTEDon first entry per domain per user. - Reviews (
review.service.ts):WORK_RATED/REVIEW_WRITTEN/REVIEW_DETAILEDinsetRating; revoke onsetRating(null),remove,removeMany. - Review votes:
REVIEW_VOTE_RECEIVEDcredited to the review's author, not the voter, onvote/unvote(including the UP→DOWN in-place flip — verifier already checksvalue = UP). - Comments (
comment.service.ts):COMMENT_POSTEDoncreate; revoke on soft-delete (remove/adminRemove). - Comment reactions:
COMMENT_REACTION_RECEIVEDcredited to the comment's author onreact/unreact. - Lists (
list.service.ts):LIST_CREATEDoncreate; revoke onremove. - Imports:
IMPORT_COMPLETEDforfeit, 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!
