using System.ComponentModel.DataAnnotations;
using Connected.Annotations;
using Connected.Entities.Annotations;
using Connected.Entities.Consistency;
namespace Common.Documents;
///
/// Default implementation of the interface.
///
/// The type of the primary key used by document.
/// This is usually int or long.
///
[Table(Schema = CommonSchemas.DocumentSchema)]
public abstract record Document : ConsistentEntity, IDocument
where TPrimaryKey : notnull
{
///
[Ordinal(-1007), Date(Kind = DateKind.SmallDateTime)]
public DateTimeOffset Created { get; init; }
///
[Ordinal(-1006), Nullable, Date(Kind = DateKind.SmallDateTime)]
public DateTimeOffset? Modified { get; init; }
///
[Ordinal(-1005), MaxLength(32), Nullable]
public string? Code { get; init; } = default!;
///
[Ordinal(-1004), Nullable]
public int? Author { get; init; }
///
[Ordinal(-1003), Nullable]
public int? Owner { get; init; }
}