2023-02-26 09:40:04 -08:00
|
|
|
using Newsbot.Collector.Domain.Models;
|
|
|
|
|
|
|
|
namespace Newsbot.Collector.Domain.Dto;
|
|
|
|
|
|
|
|
public class SubscriptionDetailsDto
|
|
|
|
{
|
2023-04-13 22:13:06 -07:00
|
|
|
public Guid Id { get; set; }
|
2023-02-26 09:40:04 -08:00
|
|
|
public SourceDto? Source { get; set; }
|
|
|
|
public DiscordWebHookDto? DiscordWebHook { get; set; }
|
|
|
|
|
2023-04-13 22:13:06 -07:00
|
|
|
public static SubscriptionDetailsDto Convert(SubscriptionModel subscription, SourceModel source,
|
|
|
|
DiscordWebHookModel discord)
|
2023-02-26 09:40:04 -08:00
|
|
|
{
|
|
|
|
return new SubscriptionDetailsDto
|
|
|
|
{
|
2023-04-13 22:13:06 -07:00
|
|
|
Id = subscription.Id,
|
2023-02-26 09:40:04 -08:00
|
|
|
Source = SourceDto.Convert(source),
|
|
|
|
DiscordWebHook = DiscordWebHookDto.Convert(discord)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|