ticketman

A simple pull-based job/ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB

ticket-system

A simple pull-based job/ticket system contians a centeral ticket dispatcher and distributed workers. This system is written in NodeJS, runing on MongoDB

This system consists of following 3 parts:

  • Ticketman website - a ExpressJS app display the current status of the centeral ticket system
  • TicketManager - a JS Class for create(TicketManager.issue) new ticket
  • TicketWorker - a JS Class pulls ticket from Ticketman website on a routine, it can also complete/giveup/add comment to a ticket. The TicketWorker instance works on one ticket at time.

Install the module with:

npm install ticketman

  1. Download and extract the latest release from https://github.com/yi/node-ticket-manager/releases
  2. run "npm install" to install dependencies
  3. run "npm start" to start the service
  4. Open http://localhost:3456 in your web browser
var  TicketWorker = require("ticketman").TicketWorker;
var  TicketManager = require("ticketman").TicketManager;
new TicketManager : (@name, @host, basicAuth) ->
 
TicketManager.issue()
// issue : (title, category, content, callback)->
  constructor: (options={}) ->
  # @param {Object} options, optionally includes:
  #     options.name
  #     options.id
  #     options.consumerSecret
  #     options.host
  #     options.category
  #     options.timeout : ticket processing timeout in ms
  #     options.interval : self checking interval
  #     options.basicAuth : basicAuth
  #
  • on "new ticket", listener signature: eventListener(ticket)
  • on "complete", listener signature: eventListener(ticket)
  • on "giveup", listener signature: eventListener(ticket)
  • complete : ()->
  • update : (message, kind='default')->
  • giveup: (reason)->

POST '/api/tickets/new', Admin create ticket

req.body:

{
  title : "title of ticket",
  owner_id : "name of owner",
  category : "category the ticket belongs to",
  content : {
    detailed : "content of ticket",
    mixed : ["data"]
  }
}

req.body:

{
  worker : "assignment worker"
  category : "category the ticket belongs to"
}

req.body:

{
  name : "worker",
  kind : "info",
  content : "test comment"
}

req.body:

{
  name : "worker"
}

req.body:

{
  name : "worker"
}

Copyright (c) 2014 yi Licensed under the MIT license.