using System.Security.Claims; using Web.Api.Common; using Web.Api.Extensions; using Application.Abstractions.Messaging; namespace Web.Api.Endpoints.Store; /// 상점 — 보관함 항목 소프트 삭제. internal sealed class InventoryDelete : IEndpoint { public void MapEndpoint(IEndpointRouteBuilder app) { app.MapDelete("api/store/inventory/{id:int}", async ( int id, ClaimsPrincipal user, ISender sender, CancellationToken ct ) => { var memberID = user.GetRequiredMemberID(); var result = await sender.Send(new Application.Features.Api.Store.Inventory.Delete.Command(memberID, id), ct); return result.Match( () => ApiResponse.Ok(), CustomResults.Problem ); }) .WithTags("Store") .RequireAuthorization(); } }