Notification.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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
  23. {
  24. get => base.Created;
  25. set => base.Created = value;
  26. }
  27. [EditorSequence(2)]
  28. public EmployeeLink Sender { get; set; }
  29. [EditorSequence(3)]
  30. public EmployeeLink Employee { get; set; }
  31. [EditorSequence(4)]
  32. public JobLink Job { get; set; }
  33. [EditorSequence(5)]
  34. [TextBoxEditor]
  35. public string Title { get; set; }
  36. [EditorSequence(6)]
  37. [RichTextEditor]
  38. public string Description { get; set; }
  39. [EditorSequence(7)]
  40. [TimestampEditor]
  41. public DateTime Closed { get; set; }
  42. [Obsolete("Replaced with Type+EntityID")]
  43. [NullEditor]
  44. public DeliveryLink Delivery { get; set; }
  45. [Obsolete("Replaced with Type+EntityID")]
  46. [NullEditor]
  47. public KanbanLink Kanban { get; set; }
  48. [Obsolete("Replaced with Type+EntityID")]
  49. [NullEditor]
  50. public SetoutLink Setout { get; set; }
  51. [Obsolete("Replaced with Type+EntityID")]
  52. [NullEditor]
  53. public RequisitionLink Requisition { get; set; }
  54. [Obsolete("Replaced with Type+EntityID")]
  55. [NullEditor]
  56. public LeaveRequestLink LeaveRequestLink { get; set; }
  57. [NullEditor]
  58. public string EntityType { get; set; }
  59. [NullEditor]
  60. public Guid EntityID { get; set; }
  61. [NullEditor]
  62. [Aggregate(typeof(NotificationDocumentCount))]
  63. public int DocumentCount { get; set; }
  64. }
  65. }