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>
20 lines
670 B
C#
20 lines
670 B
C#
using System.Text.Json.Serialization;
|
|
using MessagePack;
|
|
using SVSim.EmulatedEntrypoint.Models.Dtos;
|
|
|
|
namespace SVSim.EmulatedEntrypoint.Models.Dtos.Responses.Sleeve;
|
|
|
|
/// <summary>
|
|
/// /sleeve/buy response. <c>reward_list</c> items use reward_id/reward_num
|
|
/// (POST-STATE-TOTAL for currencies, grant id+count for cosmetics) — driven by
|
|
/// <c>PlayerStaticData.UpdateHaveUserGoodsNumByJsonData</c>. Mirrors the /pack/open +
|
|
/// /build_deck/buy reward_list semantics.
|
|
/// </summary>
|
|
[MessagePackObject]
|
|
public class SleeveBuyResponse
|
|
{
|
|
[JsonPropertyName("reward_list")]
|
|
[Key("reward_list")]
|
|
public List<RewardListEntry> RewardList { get; set; } = new();
|
|
}
|