using EnablementBLL.ShowSpace; using EnablementDAL.DTO; using EnablementSL.Parameters.ShowSpace; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.ShowSpace; public class SaveShowSpace : BaseEndpoint> { private readonly IShowSpaceBLL _bll; public SaveShowSpace(IShowSpaceBLL bll) => _bll = bll; public override void Configure() { Post("/Enablement/SaveShowSpace"); AllowAnonymous(); } protected override string? GetCacheKey(SaveShowSpaceParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( SaveShowSpaceParameters req, LoginDTO login, CancellationToken ct) { var dto = new ShowSpaceDTO { SpaceId = req.SpaceId, SpaceCode = req.SpaceCode, SpaceName = req.SpaceName, Description = req.Description, OwnerTeam = req.OwnerTeam, Icon = req.Icon, ColorHex = req.ColorHex, SubscriptionType = req.SubscriptionType, AutoSubscribeRule = req.AutoSubscribeRule, IsActive = req.IsActive, SortOrder = req.SortOrder }; return await _bll.SaveShowSpaceAsync(dto, login, ct).ConfigureAwait(false); } }