using System.ComponentModel.DataAnnotations;
using Connected.Annotations;
using Connected.Data;
using Connected.Entities.Annotations;
using Connected.Entities.Consistency;
namespace Connected.Logistics.Types.Serials;
///
[Table(Schema = Domain.Code)]
internal sealed record Serial : ConsistentEntity, ISerial
{
///
/// The entity identifier which can be used in caching keys for example.
///
public const string EntityKey = $"{Domain.Code}.{nameof(Serial)}";
///
[Ordinal(0), MaxLength(128)]
public string Entity { get; init; } = default!;
///
[Ordinal(1), MaxLength(128)]
public string EntityId { get; init; } = default!;
///
[Ordinal(2), MaxLength(128), Index(Unique = true)]
public string Value { get; init; } = default!;
///
[Ordinal(3)]
public float Quantity { get; init; }
///
[Ordinal(4)]
public DateTimeOffset Created { get; init; }
///
[Ordinal(5)]
public DateTimeOffset? BestBefore { get; init; }
///
[Ordinal(6)]
public Status Status { get; init; } = Status.Disabled;
}