2023-06-23 23:01:40 -07:00
|
|
|
using Newsbot.Collector.Domain.Entities;
|
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-04-14 21:39:02 -07:00
|
|
|
public bool CodeAllowReleases { get; set; }
|
|
|
|
public bool CodeAllowCommits { get; set; }
|
2023-02-26 09:40:04 -08:00
|
|
|
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,
|
2023-06-23 23:01:40 -07:00
|
|
|
DiscordWebhookEntity discord)
|
2023-02-26 09:40:04 -08:00
|
|
|
{
|
|
|
|
return new SubscriptionDetailsDto
|
|
|
|
{
|
2023-04-13 22:13:06 -07:00
|
|
|
Id = subscription.Id,
|
2023-04-14 21:39:02 -07:00
|
|
|
CodeAllowCommits = subscription.CodeAllowCommits,
|
|
|
|
CodeAllowReleases = subscription.CodeAllowReleases,
|
2023-02-26 09:40:04 -08:00
|
|
|
Source = SourceDto.Convert(source),
|
|
|
|
DiscordWebHook = DiscordWebHookDto.Convert(discord)
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|