namespace zero.Api.Models; public abstract class DisplayModel : ZeroIdEntity { /// /// Meta data /// public DisplayModelConfiguration Configuration { get; set; } = new(); /// /// Permissions for this entity /// public DisplayModelPermissions Permissions { get; set; } = new(); } public abstract class DisplayModel : DisplayModel where T : ZeroEntity { /// /// Full name of the entity /// public string Name { get; set; } /// /// Alias (non-unique) which can be used in the frontend and URLs /// public string Alias { get; set; } /// /// A key which can be used to query this entity in code /// public string Key { get; set; } /// /// Sort order /// public uint Sort { get; set; } /// /// Whether the entity is visible in the frontend /// public bool IsActive { get; set; } /// /// Unique hash for this entity (primarily used for routing) /// public string Hash { get; set; } /// /// Backoffice user who last modified this content /// public string LastModifiedById { get; set; } /// /// Date of last modification /// public DateTimeOffset LastModifiedDate { get; set; } /// /// Backoffice user who created this content /// public string CreatedById { get; set; } /// /// Date of creation /// public DateTimeOffset CreatedDate { get; set; } /// /// Language of the entity /// public string LanguageId { get; set; } } public class DisplayModelConfiguration { /// /// Wehther this entity is application aware /// public bool IsAppAware { get; set; } /// /// Whether this entity can be shared across applications (only for IsAppAware=true) /// public bool CanBeShared { get; set; } public bool IsShared { get; set; } /// /// The change token maps to a database entity which holds ID and collection of the model to edit /// If these values do not match the entity on save it is rejected /// // TODO expiration expiry session.Advanced.GetMetadataFor(user)[Raven.Client.Constants.Documents.Metadata.Expires] = DateTime.UtcNow.AddMinutes(60); /// public string Token { get; set; } } public class DisplayModelPermissions { /// /// Whether an entity of this type can be created /// public bool CanCreate { get; set; } /// /// Whether an entity of this type can be created in the shared app space /// public bool CanCreateShared { get; set; } /// /// Whether this entity can be edited or only viewed /// public bool CanEdit { get; set; } /// /// Whether this entity can be deleted /// public bool CanDelete { get; set; } }