gamer147
7ef5f03eb3
feat(spot-card-exchange): /spot_card_exchange/{top,exchange} + SpotPoints currency
...
Final shop family. Schema additions:
- ViewerCurrency.SpotPoints (ulong) — new currency column on Viewers.
- SpotCardExchangeEntry — catalog (distinct from the pre-existing
SpotCardEntry, which is the /load/index rental-cost concept).
- ViewerSpotCardExchange — standalone composite-PK table tracking
(viewer, card, exchanged_at, is_pre_release_snapshot). Standalone
avoids cartesian-explode on viewer-graph reads.
RewardGrantService gains a SpotCardPoint=12 currency case mirroring
the RedEther/Crystal pattern. Doc comment refreshed; SpotCard=11 and
SpotCardOnlyLatestCardPack=13 remain unimplemented with explanatory
NotSupportedException — captures show emitters always use Card=5 with
the spot-card-specific id.
Controller:
- /top: emits exactly 9 clan buckets [{"1": [cards]}, ...] matching
prod's arbitrary single-key shape. exchange_status per-card (0=
available, 1=already-exchanged, 2=LimitOver after pre-release cap).
pre_relase_info WIRE TYPO PRESERVED ("relase" not "release").
- /exchange: server-authoritative price (client-supplied
exchange_point ignored); debits SpotPoints with post-state-total
reward_list entry; grants card via RewardGrantService.ApplyAsync
(cosmetic cascade included); persists ViewerSpotCardExchange row.
Insufficient points / already-exchanged / pre-release-limit all
return 400 without partial state.
LoadController now populates /load/index spot_point from
viewer.Currency.SpotPoints (was always 0).
PreReleaseLimit hardcoded to 2 matching capture; promote to GameConfig
when captures show variance.
504 tests pass (was 496; +8 spot-card-exchange tests).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 23:23:07 -04:00
gamer147
a5999a3e9c
feat(leader-skin): shop catalog + 5 endpoints (/products, /buy, /buy_set, /buy_set_item, /ids)
...
Schema: LeaderSkinShopSeries -> Products (owned rewards) + owned
SetCompletionRewards on the series; ViewerLeaderSkinSetClaim composite
PK (ViewerId, SeriesId) backs the /buy_set_item idempotent-claim check.
Importer mirrors SleeveShopImporter: idempotent find-or-create, owned
collections rewritten wholesale on rerun. 16 series, 104 products.
Controller (extends existing /set with 5 new endpoints):
- /products: dict-keyed-by-series_id-string wire shape. is_completed
per-viewer, rewards.status from ViewerLeaderSkinSetClaim (0=no set
sale, 1=available, 2=claimed) matching client RewardStatus enum.
- /buy: single skin, sales_type 1/2 dispatch, 3=>501.
- /buy_set: whole series at SetPrice; requires set_sales_status != 0;
grants every product's rewards (RewardGrantService idempotent on
already-owned cosmetics, so partial-set buys don't double-add).
- /buy_set_item: requires viewer owns every skin in series; idempotent
on re-claim (returns 200 + empty reward_list, not 400) so client
retries don't error.
- /ids: flat owned-skin-id list for badge refresh.
496 tests pass (was 486; +10 leader-skin-shop tests).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 22:55:09 -04:00
gamer147
559a170957
feat(item-purchase): /item_purchase/{info,purchase} + catalog
...
Schema: ItemPurchaseCatalogEntry (single table). Per-viewer quota tracked
via existing ViewerEventCounter keyed by "item_purchase:<id>" with period
JstPeriod.MonthKey when IsMonthlyReset else AllTime.
Controller:
- /info returns catalog + per-period rest (server-computed
max(0, PurchaseLimit - counter)) + user_card_pack_ticket_list (every
Items.Type==2 row joined to viewer count, zeros included — client
unconditionally UpdateItemNum's each entry).
- /purchase: sold_out check before currency check (no counter increment
on currency failure), inline TryDebit covers RedEther/Crystal/Rupy/Item
with post-state-total reward_list entry, grant via RewardGrantService.
Request `rest` accepted but ignored (server counter is canonical).
Importer mirrors PaymentItemImporter shape — idempotent find-or-create,
seed-missing rows preserved. 3 entries from the prod capture.
486 tests pass (was 476; +10 item_purchase tests).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 22:41:02 -04:00
gamer147
f237851e42
feat(sleeve): shop catalog + /sleeve/{info,buy} endpoints
...
Schema: SleeveShopSeries -> SleeveShopProducts -> Rewards (owned).
Migration AddSleeveShop creates 3 tables with FK cascade.
Importer mirrors BuildDeck pattern: find-or-create per series/product,
rewards replaced wholesale on rerun (owned collection). 10 series,
270 products imported from seeds/sleeve-shop.json.
Controller:
- /sleeve/info returns wire-faithful dict-keyed shape
({sleeve_list: {<series_id>: {product_info: {<product_id>: ...}}}}).
is_purchased_product derived from viewer.Sleeves.Contains(sleeve_id).
- /sleeve/buy: sales_type 0=free / 1=crystal / 2=rupy / 3=ticket(501).
Validates series_product mismatch, currency, already-purchased.
Currency debited with post-state-total reward_list entry; cosmetic
grants dispatched through RewardGrantService.ApplyAsync (covers
sleeve + emblem bundled grants per product).
476 tests pass (was 466; +10 sleeve tests).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 22:09:45 -04:00
gamer147
6a03ff1bf6
feat(items): catalog import with Type + ThumbnailPath columns
...
ItemEntry gains Type (client item_type enum, 1=challenge, 2=card-pack
ticket, 3=premium orb, 4=colosseum, 5=orb piece, 6=skin/event ticket,
7=other) and ThumbnailPath. ItemImporter mirrors PaymentItemImporter
shape: find-or-create per item_id, save once, idempotent. Wired into
Bootstrap.Program and SVSimTestFactory.SeedGlobalsAsync. Unblocks
/item_purchase/info (filters card-pack tickets by Type==2) and any
reward grant of UserGoodsType.Item, which previously threw because
the catalog was empty.
466 tests pass (was 461).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 21:44:24 -04:00
gamer147
f486c15d32
seed(bp-monthly): bp-monthly-missions.json — May 2026 (5 rows)
...
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 10:13:51 -04:00
gamer147
8da91783b1
seed(achievements): achievement-catalog.json — 53 tiers / 52 types
...
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 10:13:12 -04:00
gamer147
6a66170677
seed(missions): mission-catalog.json — 5 missions
...
Captured from /mission/info responses across all traffic dumps.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 10:12:15 -04:00
gamer147
d661b6f44c
seed(bp): regenerate from extract-battle-pass.py — season 23 + 143 rewards
2026-05-26 22:16:37 -04:00
gamer147
95b8f39ea5
refactor(bp): flatten BattlePassLevelEntry — drop misnamed RewardData jsonb
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-26 21:57:47 -04:00
gamer147
8dbd52da54
data(load-index): generated load-index seed files
...
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-26 15:21:50 -04:00
gamer147
34ed8788a4
refactor(bootstrap): migrate build-deck catalog to seed file
2026-05-26 15:16:36 -04:00
gamer147
a71bf6c62b
refactor(bootstrap): migrate /pack/info to seed file
2026-05-26 15:02:49 -04:00
gamer147
83298a2d47
refactor(bootstrap): migrate default decks to seed file
...
Extracts /deck/info's default_deck_list into seeds/default-decks.json
via the new extract-default-decks.ps1 PowerShell script and imports
through DefaultDeckImporter. The importer carries the same orphan-
card-id warning the old GlobalsImporter path emitted; production cards
yield 0 orphans. WarnOrphans stays inside GlobalsImporter for now —
SpotCards/ReprintedCards/UnlimitedRestrictions/LoadingExclusionCards
still use it until Task 9.
Part of the bootstrap seed refactor (Task 6).
2026-05-26 14:44:21 -04:00
gamer147
a5e4f35c32
refactor(bootstrap): migrate mypage-index globals to seed files
2026-05-26 14:31:25 -04:00
gamer147
0da8ebe1c1
refactor(bootstrap): migrate basic puzzles to seed files
...
Replaces GlobalsImporter's ImportPuzzleGroups/Puzzles/Missions methods (plus the
DeriveTargetPuzzleGroupId regex helper) with a dedicated PuzzleImporter that
reads three flat seed JSONs (puzzle-groups, puzzles, puzzle-missions) produced
by the Python extractor. Groups run before puzzles to satisfy the FK; missions
upsert by sequential id. Wired into Program.cs and SVSimTestFactory after
PaymentItemImporter so existing GlobalsImporterPuzzleTests continue to pass
unchanged via SeedGlobalsAsync. The original prod-capture JSONs are deleted now
that the seeds are authoritative.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-26 14:16:32 -04:00
gamer147
c23c56d46c
refactor(bootstrap): migrate payment items to seed file
...
Lifts ImportPaymentItems out of GlobalsImporter into a dedicated
PaymentItemImporter driven by Data/seeds/payment-items.json. Wired
into Program.cs and SVSimTestFactory.SeedGlobalsAsync after
PracticeOpponentImporter. Drops the prod-capture file in favor of
the extractor pipeline.
Canonical 4-test suite (basic, idempotent, leave-untouched, skip-zero)
keeps the dict-in-sync upsert pattern Task 2 established.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-26 13:59:50 -04:00
gamer147
40b0de1d51
refactor(bootstrap): migrate practice opponents to seed file
...
Move /practice/info handling out of GlobalsImporter into a dedicated
PracticeOpponentImporter that reads a normalized JSON seed file
generated by data_dumps/extract/extract-practice-opponents.ps1.
2026-05-26 13:42:59 -04:00
gamer147
f2a1263198
refactor(bootstrap): add seed loader + extractor scaffolding
2026-05-26 13:24:49 -04:00