Newsbot.Collector/Newsbot.Collector.Domain/Dto/SubscriptionDetailsDto.cs

26 lines
880 B
C#
Raw Normal View History

using Newsbot.Collector.Domain.Entities;
using Newsbot.Collector.Domain.Models;
namespace Newsbot.Collector.Domain.Dto;
public class SubscriptionDetailsDto
{
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; }
2023-06-25 21:02:26 -07:00
public static SubscriptionDetailsDto Convert(SubscriptionEntity subscription, SourceEntity source,
DiscordWebhookEntity discord)
{
return new SubscriptionDetailsDto
{
Id = subscription.Id,
CodeAllowCommits = subscription.CodeAllowCommits,
CodeAllowReleases = subscription.CodeAllowReleases,
Source = SourceDto.Convert(source),
DiscordWebHook = DiscordWebHookDto.Convert(discord)
};
}
}