Notification.cs 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq.Expressions;
  4. using InABox.Core;
  5. namespace Comal.Classes
  6. {
  7. public class NotificationDocumentCount : CoreAggregate<Notification, NotificationDocument, Guid>
  8. {
  9. public override Expression<Func<NotificationDocument, Guid>> Aggregate => x => x.ID;
  10. public override AggregateCalculation Calculation => AggregateCalculation.Count;
  11. public override Dictionary<Expression<Func<NotificationDocument, object>>, Expression<Func<Notification, object>>> Links =>
  12. new Dictionary<Expression<Func<NotificationDocument, object>>, Expression<Func<Notification, object>>>()
  13. {
  14. { NotificationDocument => NotificationDocument.EntityLink.ID, Notification => Notification.ID }
  15. };
  16. }
  17. [UserTracking("Notifications")]
  18. public class Notification : Entity, IRemotable, IPersistent, IOneToMany<Job>, ILicense<CoreLicense>
  19. {
  20. [EditorSequence(1)]
  21. [DateTimeEditor(Editable = Editable.Hidden)]
  22. public override DateTime Created { get; set; }
  23. [EditorSequence(2)]
  24. public EmployeeLink Sender { get; set; }
  25. [EditorSequence(3)]
  26. public EmployeeLink Employee { get; set; }
  27. [EditorSequence(4)]
  28. public JobLink Job { get; set; }
  29. [EditorSequence(5)]
  30. [TextBoxEditor]
  31. public string Title { get; set; }
  32. [EditorSequence(6)]
  33. [RichTextEditor]
  34. public string Description { get; set; }
  35. [EditorSequence(7)]
  36. [TimestampEditor]
  37. public DateTime Closed { get; set; }
  38. [Obsolete("Replaced with Type+EntityID")]
  39. [NullEditor]
  40. public DeliveryLink Delivery { get; set; }
  41. [Obsolete("Replaced with Type+EntityID")]
  42. [NullEditor]
  43. public KanbanLink Kanban { get; set; }
  44. [Obsolete("Replaced with Type+EntityID")]
  45. [NullEditor]
  46. public SetoutLink Setout { get; set; }
  47. [Obsolete("Replaced with Type+EntityID")]
  48. [NullEditor]
  49. public RequisitionLink Requisition { get; set; }
  50. [Obsolete("Replaced with Type+EntityID")]
  51. [NullEditor]
  52. public LeaveRequestLink LeaveRequestLink { get; set; }
  53. [NullEditor]
  54. public string EntityType { get; set; }
  55. [NullEditor]
  56. public Guid EntityID { get; set; }
  57. [NullEditor]
  58. [Aggregate(typeof(NotificationDocumentCount))]
  59. public int DocumentCount { get; set; }
  60. }
  61. }