Newsbot.Collector/Newsbot.Collector.Domain/Dto/SubscriptionDetailsDto.cs
James Tombleson 70440aa3f5
Features/subscription details dto (#29)
* DTO was updated to reflect the new options

* SubscriptionsController.cs added id's as part of the path not query

* Refactored DiscordNotificationJob.cs to break apart the nesting

* Added a test to make sure commits would not be sent based on model values
2023-04-14 21:39:02 -07:00

25 lines
836 B
C#

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; }
public static SubscriptionDetailsDto Convert(SubscriptionModel subscription, SourceModel source,
DiscordWebHookModel discord)
{
return new SubscriptionDetailsDto
{
Id = subscription.Id,
CodeAllowCommits = subscription.CodeAllowCommits,
CodeAllowReleases = subscription.CodeAllowReleases,
Source = SourceDto.Convert(source),
DiscordWebHook = DiscordWebHookDto.Convert(discord)
};
}
}