diff options
author | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-11-20 22:26:31 +0700 |
---|---|---|
committer | Thuan Pham Quoc <thuanpq.io@gmail.com> | 2017-11-20 22:26:31 +0700 |
commit | eec3c301bc7b0f29d7a7fcfcf59d330ceb604985 (patch) | |
tree | 57000da1012bfdd24363b6449dd77dfddcefe6de /models | |
parent | dfd0b2194746208c85b16fd485e7ca6f0cc34b57 (diff) | |
download | wekan-eec3c301bc7b0f29d7a7fcfcf59d330ceb604985.tar.gz wekan-eec3c301bc7b0f29d7a7fcfcf59d330ceb604985.tar.bz2 wekan-eec3c301bc7b0f29d7a7fcfcf59d330ceb604985.zip |
Add card spent time to log time what can be overtime or not (will support filtering in future)
Diffstat (limited to 'models')
-rw-r--r-- | models/cards.js | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/models/cards.js b/models/cards.js index 5de17c6f..56c3908f 100644 --- a/models/cards.js +++ b/models/cards.js @@ -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}}; + }, }); |