using System.ComponentModel.DataAnnotations; using Connected.Annotations; using Connected.Data; using Connected.ServiceModel; namespace Connected.Logistics.Types.Serials; /// /// Arguments used when inserting a new serial number. /// public sealed class InsertSerialArgs : Dto { /// [Required, MaxLength(128)] public string Entity { get; set; } = default!; /// [Required, MaxLength(128)] public string EntityId { get; set; } = default!; /// [MinValue(0)] public float Quantity { get; set; } /// /// /// If this property is null, the process will most likely /// set the value of the current date (DateTime.UtcNow). /// public DateTimeOffset? Created { get; set; } /// public DateTimeOffset? BestBefore { get; set; } /// public Status Status { get; set; } = Status.Disabled; /// [Required, MaxLength(128)] public string Value { get; set; } = default!; } /// /// The arguments used when updating the existing serial entity. /// public sealed class UpdateSerialArgs : PrimaryKeyArgs { /// /// The new quantity. This is an absolute value, do not provide /// delta values. /// [MinValue(0)] public float Quantity { get; set; } /// public DateTimeOffset? BestBefore { get; set; } /// public Status Status { get; set; } = Status.Disabled; } /// /// The arguments used for selecting serial by its value. /// public sealed class SelectSerialArgs : Dto { /// [Required, MaxLength(128)] public string Value { get; set; } = default!; }