Newsbot.Collector/Newsbot.Collector.Domain/Dto/DiscordNotificationDetailsDto.cs

26 lines
936 B
C#
Raw Normal View History

using Newsbot.Collector.Domain.Entities;
using Newsbot.Collector.Domain.Models;
namespace Newsbot.Collector.Domain.Dto;
public class DiscordNotificationDetailsDto
{
public Guid Id { get; set; }
public bool CodeAllowReleases { get; set; }
public bool CodeAllowCommits { get; set; }
public SourceDto? Source { get; set; }
public DiscordWebHookDto? DiscordWebHook { get; set; }
public static DiscordNotificationDetailsDto Convert(DiscordNotificationEntity discordNotification, SourceEntity source,
DiscordWebhookEntity discord)
{
return new DiscordNotificationDetailsDto
{
Id = discordNotification.Id,
CodeAllowCommits = discordNotification.CodeAllowCommits,
CodeAllowReleases = discordNotification.CodeAllowReleases,
Source = SourceDto.Convert(source),
DiscordWebHook = DiscordWebHookDto.Convert(discord)
};
}
}