using System.Security.Claims; using Web.Api.Common; using Web.Api.Extensions; using Application.Abstractions.Messaging; namespace Web.Api.Endpoints.Store; /// 상점 — 내 보관함 (Digital 상품 쿠폰 코드). internal sealed class InventoryList : IEndpoint { public void MapEndpoint(IEndpointRouteBuilder app) { app.MapGet("api/store/inventory", async ( int? page, ushort? perPage, int? productID, ClaimsPrincipal user, ISender sender, CancellationToken ct ) => { var memberID = user.GetRequiredMemberID(); var data = await sender.Send(new Application.Features.Api.Store.Inventory.List.Query( memberID, page is > 0 ? page.Value : 1, perPage is > 0 ? perPage.Value : (ushort)20, productID is > 0 ? productID.Value : null ), ct); return ApiResponse.Ok(data); }) .WithTags("Store") .RequireAuthorization(); } }