using System; using System.Collections.Generic; using System.Linq.Expressions; using InABox.Core; namespace Comal.Classes { public class NotificationDocumentCount : CoreAggregate { public override Expression> Aggregate => x => x.ID; public override AggregateCalculation Calculation => AggregateCalculation.Count; public override Dictionary>, Expression>> Links => new Dictionary>, Expression>>() { { NotificationDocument => NotificationDocument.EntityLink.ID, Notification => Notification.ID } }; } [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; } [NullEditor] [Aggregate(typeof(NotificationDocumentCount))] public int DocumentCount { get; set; } } }