File tree Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Expand file tree Collapse file tree 2 files changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ module default {
2
+ abstract type Notification extending Mixin:: Audited {
3
+ readAt := .currentRecipient.readAt;
4
+ unread := not exists .currentRecipient.readAt;
5
+ single currentRecipient := assert_single ((
6
+ select .recipients filter .user = global currentUser
7
+ ));
8
+ recipients := .< notification[is Notification:: Recipient];
9
+ }
10
+ }
11
+
12
+ module Notification {
13
+ type Recipient {
14
+ required notification: default :: Notification {
15
+ on target delete delete source ;
16
+ };
17
+ required user: default :: User {
18
+ on target delete delete source ;
19
+ };
20
+
21
+ readAt: datetime ;
22
+ }
23
+
24
+ type System extending default :: Notification {
25
+ required message: str ;
26
+ }
27
+ abstract type Comment extending default :: Notification {
28
+ required comment: Comments:: Comment {
29
+ on target delete delete source ;
30
+ };
31
+ }
32
+ type CommentViaMention extending Comment;
33
+ type CommentViaMembership extending Comment;
34
+ }
You can’t perform that action at this time.
0 commit comments