Commit 16765649 authored by David Černý's avatar David Černý
Browse files

moved StockReport to separate file

parent 1c218b1b
Loading
Loading
Loading
Loading
Loading
+0 −30
Original line number Diff line number Diff line
namespace MailDispatch;

public class StockReport
{
    public required string SenderName { get; set; }
    public required string Subject { get; set; }
    public required string Body { get; set; }
    public StockReportBodyFormat BodyFormat { get; set; } = StockReportBodyFormat.Html;
}

public enum StockReportBodyFormat
{
    PlainText,
    Html
}

static class StockReportBodyFormatMethods
{
    public static string GetBodyFormatString(this StockReportBodyFormat format)
    {
        switch (format)
        {
            case StockReportBodyFormat.PlainText:
                return "plain";
            case StockReportBodyFormat.Html:
                return "html";
            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
        }
    }
}

public interface IMailSender
{
    void SendStockReport(string receiver, StockReport email);
+31 −0
Original line number Diff line number Diff line
namespace MailDispatch;

public class StockReport
{
    public required string SenderName { get; set; }
    public required string Subject { get; set; }
    public required string Body { get; set; }
    public StockReportBodyFormat BodyFormat { get; set; } = StockReportBodyFormat.Html;
}

public enum StockReportBodyFormat
{
    PlainText,
    Html
}

static class StockReportBodyFormatMethods
{
    public static string GetBodyFormatString(this StockReportBodyFormat format)
    {
        switch (format)
        {
            case StockReportBodyFormat.PlainText:
                return "plain";
            case StockReportBodyFormat.Html:
                return "html";
            default:
                throw new ArgumentOutOfRangeException(nameof(format), format, null);
        }
    }
}