// Copyright © Selmo Technology GmbH. All Rights Reserved

using SelmoStudio.Hmi.Server.SelmoHmi.Notification.Model.Ids;

namespace SelmoStudio.Hmi.Server.SelmoHmi.Notification.Model
{
    public record ProgressNotificationTask
    {
        public ProgressNotificationTask(ProgresNotificationTimer timer, NotificationConfiguration notificationConfiguration,
            Func<Task> function)
        {
            Id = Id = new(Guid.NewGuid());
            Timer = timer;
            NotificationConfiguration = notificationConfiguration;
            Function = function;
        }

        public ProgressNotificationTaskId Id { get; init; }

        public ProgresNotificationTimer Timer { get; init; }

        public NotificationConfiguration NotificationConfiguration { get; init; }

        public bool ErrorOccurred { get; set; }

        public Func<Task> Function { get; init; }
    }
}