diff options
Diffstat (limited to 'models/cards.js')
-rw-r--r-- | models/cards.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/models/cards.js b/models/cards.js index 544afca5..4a662953 100644 --- a/models/cards.js +++ b/models/cards.js @@ -59,6 +59,10 @@ Cards.attachSchema(new SimpleSchema({ type: [String], optional: true, }, + receivedAt: { + type: Date, + optional: true, + }, startAt: { type: Date, optional: true, @@ -67,6 +71,10 @@ Cards.attachSchema(new SimpleSchema({ type: Date, optional: true, }, + endAt: { + type: Date, + optional: true, + }, spentTime: { type: Number, decimal: true, @@ -155,7 +163,7 @@ Cards.helpers({ }, checklists() { - return Checklists.find({cardId: this._id}, {sort: {createdAt: 1}}); + return Checklists.find({cardId: this._id}, {sort: { sort: 1 } }); }, checklistItemCount() { @@ -271,6 +279,14 @@ Cards.mutations({ return {$unset: {coverId: ''}}; }, + setReceived(receivedAt) { + return {$set: {receivedAt}}; + }, + + unsetReceived() { + return {$unset: {receivedAt: ''}}; + }, + setStart(startAt) { return {$set: {startAt}}; }, @@ -287,6 +303,14 @@ Cards.mutations({ return {$unset: {dueAt: ''}}; }, + setEnd(endAt) { + return {$set: {endAt}}; + }, + + unsetEnd() { + return {$unset: {endAt: ''}}; + }, + setOvertime(isOvertime) { return {$set: {isOvertime}}; }, |