feat: Add tests for 2023 watch shop tab and room consumables; implement new storefront endpoint and update documentation

This commit is contained in:
Alexa
2026-07-07 23:27:13 +03:00
parent 8e87a9de82
commit 7b7eb651e3
5 changed files with 324 additions and 2 deletions
@@ -32,7 +32,6 @@ public class StorefrontsController(
[HttpGet("api/storefronts/v1/all")]
[HttpGet("api/storefronts/v2/all")]
[HttpGet("api/storefronts/v3/all")]
[HttpGet("api/storefronts/v1/toptoday")]
[AllowAnonymous]
public async Task<IActionResult> All()
{
@@ -40,6 +39,24 @@ public class StorefrontsController(
return Ok(items.Select(i => StoreService.ToItemDto(i, domain.Apex)).ToArray());
}
/// <summary>GET <c>api/storefronts/v1/toptoday</c> — the 2023 Shop
/// tab's "featured today" strip. The client (DCFKEFHJAGC.IDCIMNLBINC)
/// deserialises the body as a bare <c>List&lt;int&gt;</c> of
/// PurchasableItemIds and resolves each against the gift-drop cache
/// it loaded from <c>/v3/giftdropstore/{id}</c> — so these ids MUST
/// be ids that appear on that storefront's rows, or the client logs
/// "Could not find purchasable giftdrop" and drops them. Returning
/// item OBJECTS here (the old /all alias) made the whole featured
/// fetch fail to parse.</summary>
[HttpGet("api/storefronts/v1/toptoday")]
[AllowAnonymous]
public async Task<IActionResult> TopToday()
{
var items = await store.GetRenderableGiftDropItemsAsync();
var max = Math.Max(1, config.GetValue("Store:MaxTopTodayItems", 12));
return Ok(items.Take(max).Select(StoreService.PurchasableItemIdFor).ToArray());
}
/// <summary>GET <c>api/storefronts/v1/adcarouselitems</c> — the rotating
/// promo banner at the top of the Shop, NOT the main catalog. The client
/// (AdCarouselItemListModel) keys these by <c>AdCarouselItemId</c> in a