Add card spent time to log time what can be overtime or not (will support filtering in future)

This commit is contained in:
Thuan Pham Quoc 2017-11-20 22:26:31 +07:00
parent dfd0b21947
commit eec3c301bc
8 changed files with 164 additions and 6 deletions

View file

@ -64,8 +64,18 @@ Cards.attachSchema(new SimpleSchema({
type: Date,
optional: true,
},
// XXX Should probably be called `authorId`. Is it even needed since we have
// the `members` field?
spentTime: {
type: Number,
decimal: true,
optional: true,
},
isOvertime: {
type: Boolean,
defaultValue: false,
optional: true,
},
// XXX Should probably be called `authorId`. Is it even needed since we have
// the `members` field?
userId: {
type: String,
autoValue() { // eslint-disable-line consistent-return
@ -269,6 +279,18 @@ Cards.mutations({
unsetDue() {
return {$unset: {dueAt: ''}};
},
setOvertime(isOvertime) {
return {$set: {isOvertime}};
},
setSpentTime(spentTime) {
return {$set: {spentTime}};
},
unsetSpentTime() {
return {$unset: {spentTime: '', isOvertime: false}};
},
});