-
Notifications
You must be signed in to change notification settings - Fork 2
/
user_stories.js
executable file
·135 lines (133 loc) · 3.27 KB
/
user_stories.js
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
UserStories = new Mongo.Collection('userStories');
UserStories.allow({
insert: scrumTeam,
update: scrumTeam,
remove: scrumTeam
});
UserStories.attachSchema(new SimpleSchema({
title: {
type: String,
label: "Title",
max: 20,
autoform: {
placeholder: "Name your story."
}
},
productId: {
type: String,
autoform: {
omit: true
},
denyUpdate: true
},
sprintId: {
type: String,
autoform: {
omit: true
},
optional: true
},
userId: {
type: String,
autoValue: function () {
if (this.isInsert) {
if (!this.isFromTrustedCode) {
return this.userId;
}
} else
/* Prevent user from supplying their own user ID. */
this.unset();
},
denyUpdate: true,
autoform: {
omit: true
}
},
lastEditedBy: {
type: String,
autoValue: function () {
if (this.isUpdate) {
return this.userId;
} else
/* Prevent user from supplying their own user ID. */
this.unset();
},
denyInsert: true,
optional: true,
autoform: {
omit: true
}
},
description: {
type: String,
label: "Description",
autoform: {
placeholder: "As a 'role', I want 'goal' so that 'benefit'."
}
},
priority: {
type: Number,
label: "Priority",
optional: true,
autoform: {
omit: true
}
},
storyPoints: {
type: Number,
label: "Story Points",
allowedValues: [0.5, 1, 2, 3, 5, 8, 13, 20, 40, 80],
decimal: true,
autoform: {
options: [
{label: "½", value: 0.5},
{label: "1", value: 1},
{label: "2", value: 2},
{label: "3", value: 3},
{label: "5", value: 5},
{label: "8", value: 8},
{label: "13", value: 13},
{label: "20", value: 20},
{label: "40", value: 40},
{label: "80", value: 80}
]
},
optional: true
},
businessValue: {
type: Number,
label: "Business Value",
min: 1,
max: 1000,
optional: true,
autoform: {
placeholder: "1-1000"
}
},
createdAt: {
type: Date,
autoValue: function () {
if (this.isInsert) return new Date;
else if (this.isUpsert) return {$setOnInsert: new Date};
else
/* Prevent user from supplying their own date. */
this.unset();
},
autoform: {
omit: true
}
},
updatedAt: {
type: Date,
autoValue: function () {
if (this.isInsert || this.isUpdate) return new Date;
else if (this.isUpsert) return {$setOnInsert: new Date};
else
/* Prevent user from supplying their own date. */
this.unset();
},
autoform: {
omit: true
}
}
}));