gamer147
bac10b91ff
test(card): /card/create controller integration
...
Adds CreateBody helper and 15 test runs (7 methods + 8 parametrized
cases) covering happy path, 401 unauthenticated, malformed inner JSON,
empty object, unknown card, not_craftable, would_exceed_max_copies,
and insufficient_vials error paths for POST /card/create.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-28 01:38:42 -04:00
gamer147
39b38e3c80
Battlepass fix
2026-05-28 00:54:46 -04:00
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
68367db214
feat(tool/signup): anonymous viewer creation keyed on UDID
...
POST /tool/signup upserts a Viewer keyed on the resolved request UDID
(via the existing SID->UDID dict). Stashes the viewer on HttpContext so
the translation middleware emits viewer_id/short_udid/udid in
data_headers. Empty data payload -- all signup outputs flow in
data_headers per spec. Idempotent: repeat signups for the same UDID
return the existing viewer.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com >
2026-05-27 14:24:55 -04:00
gamer147
640a77ec6c
feat(achievements): /achievement/receive_reward — RewardGrantService + level advance + cap
...
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 10:41:49 -04:00
gamer147
b65a437102
feat(missions): /mission/info, /mission/retire, /mission/change_receive_setting
...
Three endpoints + 9 integration tests. Captured-data-is-catalog: viewer's
achievement Level starts at MIN(Level) per type from the catalog (not 1),
so the assembler always has a row to render against.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com >
2026-05-27 10:35:40 -04:00
gamer147
2cb8c271a8
feat(bp): /battle_pass/buy — crystal-cost + retroactive premium grants
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-26 23:36:18 -04:00
gamer147
0ceab721e9
feat(bp): /battle_pass/item_list — derives product per active season
...
Adds BattlePassSalesPeriodInfoDto, BattlePassProductDto, BattlePassItemListResponse DTOs,
GetItemListAsync on BattlePassService (one product if not premium + CanPurchase, empty if
already premium or off-season), and the /battle_pass/item_list controller action.
2 new integration tests; all 408 pass.
2026-05-26 23:26:46 -04:00
gamer147
8a35f8c40b
feat(bp): /battle_pass/info — service + controller + 3 tests
...
Also fixes BattlePassRepository.GetActiveSeasonAsync to use client-side
DateTimeOffset filtering (SQLite provider cannot translate DateTimeOffset
comparisons in LINQ WHERE/ORDER BY clauses).
2026-05-26 23:14:26 -04:00
gamer147
9bec1df52f
feat(load-index): populate battle_pass_level_info from IBattlePassService
...
Wire IBattlePassService.GetLevelCurveAsync into LoadController so /load/index
emits the 100-entry battle_pass_level_info dict when levels are seeded.
Also adds BattlePassRepository.ResetLevelCurveCache() to bust the process-level
static cache in tests that seed levels after earlier HTTP calls have primed it
with an empty list, and updates SVSimTestFactory.SeedGlobalsAsync + the stale
Index_surfaces_seeded_globals_after_bootstrap assertion accordingly.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
2026-05-26 22:56:41 -04:00
gamer147
141f34f817
chore(bootstrap): refresh stale GlobalsImporter references in docs/test names
2026-05-26 16:44:54 -04:00
gamer147
a71bf6c62b
refactor(bootstrap): migrate /pack/info to seed file
2026-05-26 15:02:49 -04:00
gamer147
b6966ece6e
Prebuilt deck purchasing and fixes
2026-05-26 09:16:21 -04:00
gamer147
558e8288eb
Puzzles
2026-05-25 12:03:47 -04:00
gamer147
c14408ba06
Seeding reorg
2026-05-24 21:13:15 -04:00
gamer147
34bcc579a5
Additional card content
2026-05-24 17:07:05 -04:00
gamer147
12fb2f4801
Card liquefication
2026-05-24 14:42:44 -04:00
gamer147
79209bd70b
Pack opening
2026-05-24 02:03:13 -04:00
gamer147
bdff142d16
Practice/deck editing mostly there
2026-05-24 00:17:28 -04:00
gamer147
21b97269ff
Practice battles work
2026-05-23 22:46:11 -04:00
gamer147
66184b3685
Things were working, suddenly regressed
2026-05-23 18:14:42 -04:00
gamer147
5f44ee0c7e
Getting ready to seed more data
2026-05-23 15:47:23 -04:00
gamer147
631e42289a
Need to fix index load issues
2026-05-23 14:50:16 -04:00
gamer147
bf6ddf5428
Forgot unversioned xd
2026-05-23 14:18:18 -04:00