task-model
task domain model
Last updated 3 years ago by shuvalov-anton .
MIT · Original npm · Tarball
$ cnpm install task-model 
SYNC missed versions from official npm registry.

Task Model

Build Status

Simply high leveled task class with mongoose backend and ES6-genetators.

Install

npm install task-model

API

var tasks = new Tasks(options);

Task Schema

var TaskSchema = new Schema({
  name: String, // task name
  description: String, // task description
  tags: [String], // list of tags (projects, contexts and other stuff)
  estimate: Number, // estimate time in ms
  created: Date, // date of creation
  due: Date, // used for tasks.next()
  start: Date // used for tasks.next()
});

tasks#*add(task)

Create the task with given task object. Return new task document;

tasks#*done(id)

Mark task as finished and remove it from next() and get() results. Return task document.

tasks#*get()

Return all tasks.

tasks#*get(id)

Return task by id. id should be a number or string contains the number.

tasks#*get(tag)

Return all tasks with given tag. Tag should be a string

tasks#*update(id, updates)

Update the task with given data. Return updated task document.

tasks#*remove(id)

Remove task by id. Return removed task document.

tasks#*next(n)

Return next n tasks sorted by due and start.

tasks#model

Link to mongoose ODM model.

Licence

MIT

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (4)
Dev Dependencies (4)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |