File tree 2 files changed +61
-5
lines changed
2 files changed +61
-5
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,15 @@ The following document describes the MongoDB Schema used by the TuxLab app:
28
28
' administrator' : [' global' ],
29
29
' instructor' : [' 574465a21109160b518a4291' ], // Array of IDs to Courses
30
30
' student' : [[' 574465a21109160b518a4299' ,' 574467bc1109160b518a429d' ]] // Array of Tuples of {CourseID, CourseRecordID}
31
- }
31
+ },
32
+ announcements: [
33
+ {
34
+ timeCreated: 1469648536858 ,
35
+ type: ' lab' ,
36
+ message: ' Git Lab is due in 2 Weeks' ,
37
+ link: ' course/1/lab/12'
38
+ }
39
+ ]
32
40
},
33
41
{
34
42
_id : " 23123454ab2d765eef993343" ,
@@ -48,8 +56,15 @@ The following document describes the MongoDB Schema used by the TuxLab app:
48
56
},
49
57
roles: {
50
58
' student' : [' 574465a21109160b518a4299' ,' 574467a21109160b518a4334' ]
51
- }
52
-
59
+ },
60
+ announcements: [
61
+ {
62
+ timeCreated: 1469648536858 ,
63
+ type: ' lab' ,
64
+ message: ' Git Lab is due in 2 Weeks' ,
65
+ link: ' course/1/lab/12'
66
+ }
67
+ ]
53
68
}
54
69
```
55
70
@@ -63,7 +78,7 @@ The following document describes the MongoDB Schema used by the TuxLab app:
63
78
{
64
79
name: " Derek Bro" ,
65
80
id: " 948fhp23irjer9823r3rwef"
66
- },
81
+ },
67
82
{
68
83
name: " Tom Cortina" ,
69
84
id: " 573de804b17eca6c452d9ff7"
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ declare var nconf: any;
9
9
10
10
if ( Meteor . isServer ) {
11
11
Meteor . startup ( function ( ) {
12
+
13
+ // Defines User Profile
12
14
var profileSchema = new SimpleSchema ( {
13
15
first_name : {
14
16
type : String
@@ -32,6 +34,8 @@ if (Meteor.isServer){
32
34
type : String
33
35
}
34
36
} ) ;
37
+
38
+ // Defines User Abilities
35
39
var roleSchema = new SimpleSchema ( {
36
40
administrator : {
37
41
type : [ String ] ,
@@ -50,8 +54,45 @@ if (Meteor.isServer){
50
54
defaultValue : [ ]
51
55
}
52
56
} ) ;
57
+
58
+ // Defines Notifications presented to user
59
+ var announcementSchema = new SimpleSchema ( {
60
+ timeCreated : {
61
+ type : Date ,
62
+ autoValue : function ( ) {
63
+ return Date . now ( ) ;
64
+ }
65
+ } ,
66
+ type : {
67
+ type : String ,
68
+ allowedValues : [ 'lab' , 'instructor' , 'tuxlab' ]
69
+ } ,
70
+ message : {
71
+ type : String
72
+ } ,
73
+ link : {
74
+ type : String ,
75
+ optional : true
76
+ }
77
+ } )
78
+
79
+ // Overall User Schema
53
80
var userSchema = new SimpleSchema ( {
54
- //TODO @sander
81
+ services : {
82
+ type : Object ,
83
+ optional : true ,
84
+ blackbox : true
85
+ } ,
86
+ profile : {
87
+ type : profileSchema
88
+ } ,
89
+ roles : {
90
+ type : roleSchema
91
+ } ,
92
+ announcements :{
93
+ type : [ announcementSchema ] ,
94
+ defaultValue : [ ]
95
+ }
55
96
} ) ;
56
97
( < any > Meteor . users ) . attachSchema ( userSchema ) ;
57
98
} ) ;
You can’t perform that action at this time.
0 commit comments