using System; using System.Collections.Generic; using System.Linq.Expressions; using InABox.Core; namespace Comal.Classes { [UserTracking("Notifications")] public class Notification : Entity, IRemotable, IPersistent, IOneToMany, ILicense { [EditorSequence(1)] [DateTimeEditor(Editable = Editable.Hidden)] public override DateTime Created { get => base.Created; set => base.Created = value; } [EditorSequence(2)] public EmployeeLink Sender { get; set; } [EditorSequence(3)] public EmployeeLink Employee { get; set; } [EditorSequence(4)] public JobLink Job { get; set; } [EditorSequence(5)] [TextBoxEditor] public string Title { get; set; } [EditorSequence(6)] [RichTextEditor] public string Description { get; set; } [EditorSequence(7)] [TimestampEditor] public DateTime Closed { get; set; } [Obsolete("Replaced with Type+EntityID")] [NullEditor] public DeliveryLink Delivery { get; set; } [Obsolete("Replaced with Type+EntityID")] [NullEditor] public KanbanLink Kanban { get; set; } [Obsolete("Replaced with Type+EntityID")] [NullEditor] public SetoutLink Setout { get; set; } [Obsolete("Replaced with Type+EntityID")] [NullEditor] public RequisitionLink Requisition { get; set; } [Obsolete("Replaced with Type+EntityID")] [NullEditor] public LeaveRequestLink LeaveRequestLink { get; set; } [NullEditor] public string EntityType { get; set; } [NullEditor] public Guid EntityID { get; set; } private class DocumentCountFormula : ComplexFormulaGenerator { public override IComplexFormulaNode GetFormula() => Count(x => x.Property(x => x.ID)).WithLink(x => x.EntityLink.ID, x => x.ID); } [NullEditor] [ComplexFormula(typeof(DocumentCountFormula))] public int DocumentCount { get; set; } } }