using EnablementBLL.ShowChannel; using EnablementDAL.DTO; using EnablementSL.Parameters.ShowChannel; using FastEndpoints; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.Framework.ResponseStandard; using GB5Shared.FastEndPoint; namespace EnablementSL.Endpoints.ShowChannel; public class SaveShowChannel : BaseEndpoint> { private readonly IShowChannelBLL _bll; public SaveShowChannel(IShowChannelBLL bll) => _bll = bll; public override void Configure() { Post("/Enablement/SaveShowChannel"); AllowAnonymous(); } protected override string? GetCacheKey(SaveShowChannelParameters req, LoginDTO login) => null; protected override async Task> ExecuteAsync( SaveShowChannelParameters req, LoginDTO login, CancellationToken ct) { var dto = new ShowChannelDTO { ChannelId = req.ChannelId, ChannelCode = req.ChannelCode, ChannelName = req.ChannelName, Description = req.Description, SubscriptionType = req.SubscriptionType, AutoSubscribeRule = req.AutoSubscribeRule, IsPortalInternal = req.IsPortalInternal, IsPortalEss = req.IsPortalEss, IsPortalVendor = req.IsPortalVendor, IsPortalCustomer = req.IsPortalCustomer, IsActive = req.IsActive, SortOrder = req.SortOrder }; return await _bll.SaveShowChannelAsync(dto, login, ct).ConfigureAwait(false); } }