using System.ComponentModel.DataAnnotations; using Connected.Annotations; using Connected.ServiceModel; namespace Connected.Collections.Queues; public class QueueArgs : Dto { public QueueArgs() { Options = new(); } public EnqueueOptions Options { get; set; } } public class PrimaryKeyQueueArgs : QueueArgs where TPrimaryKey : notnull { public TPrimaryKey Id { get; set; } = default!; } public sealed class EnqueueOptions { /// /// The date and time the queue message expires. /// /// /// Queue messages that are not processed until they expire /// gets automatically deleted by the system. /// public DateTime Expire { get; set; } = DateTime.UtcNow.AddHours(48); } public sealed class DequeueArgs : Dto { [NonDefault] public List Queues { get; set; } = default!; [Range(1, int.MaxValue)] public int MaxCount { get; set; } public TimeSpan NextVisible { get; set; } }