-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathData.cs
More file actions
71 lines (53 loc) · 2.57 KB
/
Data.cs
File metadata and controls
71 lines (53 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
using System;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using MongoDB.Bson.Serialization.Attributes;
using net.vieapps.Components.Utility;
using net.vieapps.Components.Security;
using net.vieapps.Components.Repository;
namespace net.vieapps.Services.Notifications
{
[BsonIgnoreExtraElements, Entity(CollectionName = "Notifications", TableName = "T_Notifications", CacheClass = typeof(ServiceComponent), CacheName = "Cache")]
public class Notification : Repository<Notification>
{
public Notification() : base()
=> this.ID = UtilityService.NewUUID;
[Sortable(IndexName = "Management")]
public DateTime Time { get; set; } = DateTime.Now;
[Sortable(IndexName = "Management")]
public bool Read { get; set; } = false;
[JsonConverter(typeof(StringEnumConverter)), BsonRepresentation(MongoDB.Bson.BsonType.String)]
[Sortable(IndexName = "Management")]
public Components.Security.Action Action { get; set; } = Components.Security.Action.Update;
[Property(MaxLength = 32, NotNull = true), Sortable(IndexName = "IDs")]
public string SenderID { get; set; }
[Property(MaxLength = 250, NotNull = true)]
public string SenderName { get; set; }
[Property(MaxLength = 32), Sortable(IndexName = "IDs")]
public string RecipientID { get; set; }
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "Services")]
public new string ServiceName { get; set; }
[Property(MaxLength = 50, NotNull = true), Sortable(IndexName = "Services")]
public new string ObjectName { get; set; }
[Property(MaxLength = 32), Sortable(IndexName = "IDs")]
public override string SystemID { get; set; }
[Property(MaxLength = 32), Sortable(IndexName = "IDs")]
public override string RepositoryID { get; set; }
[Property(MaxLength = 32), Sortable(IndexName = "IDs")]
public override string RepositoryEntityID { get; set; }
[Property(MaxLength = 32), Sortable(IndexName = "IDs")]
public new string ObjectID { get; set; }
[Property(MaxLength = 250)]
public override string Title { get; set; }
[JsonConverter(typeof(StringEnumConverter)), BsonRepresentation(MongoDB.Bson.BsonType.String)]
[Sortable(IndexName = "Management")]
public ApprovalStatus Status { get; set; } = ApprovalStatus.Pending;
[JsonConverter(typeof(StringEnumConverter)), BsonRepresentation(MongoDB.Bson.BsonType.String)]
[Sortable(IndexName = "Management")]
public ApprovalStatus PreviousStatus { get; set; } = ApprovalStatus.Pending;
[AsJson]
public string Additionals { get; set; }
[JsonIgnore, BsonIgnore, Ignore]
public override Privileges OriginalPrivileges { get; set; }
}
}