/**
 * Created by kgrube on 1/8/2016.
 * @author kgrube
 */

/**
 * @private
 */
var Q = require('q'),
    inherits = require('util').inherits,
    ConnectWise = require('../ConnectWise.js');
/**
 * @typedef {object} Status
 * @property {number} id
 * @property {string} name
 * @property {number} boardId
 * @property {number} sortOrder
 * @property {boolean} displayOnBoard
 * @property {boolean} inactive
 * @property {boolean} closedStatus
 * @property {boolean} timeEntryNotAllowed
 * @property {boolean} defaultFlag
 * @property {string} escalationStatus ['NotResponded', 'Responded', 'Plan', 'Resolved', 'NoEscalation']
 * @property {object} _info
 *
 */

/**
 *
 * @param {object} options
 * @param {string} options.companyId
 * @param {string} options.publicKey
 * @param {string} options.privateKey
 * @param {string} options.companyUrl
 * @constructor
 */
function Statuses(options) {
    ConnectWise.apply(this, Array.prototype.slice.call(arguments));
}
inherits(Statuses, ConnectWise);

/**
 *
 * @param id
 * @param params
 * @returns {Status[]|promise}
 */
Statuses.prototype.getStatusesByBoardId = function (id, params) {
    return this.api('/service/boards/' + id + '/statuses', 'GET', params);
};

/**
 *
 * @type {Statuses}
 */
module.exports = Statuses;
@@ -1010,17 +1010,22 @@
  @param 
-i
+boardI
 d%0A * @pa
@@ -1027,16 +1027,25 @@
 * @param
+ %7BParams%7D
  params%0A
@@ -1135,64 +1135,507 @@
 on (
-id, params) %7B%0A    return this.api('/service/boards/' + i
+boardId, params) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses', 'GET', params);%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @param %7BStatus%7D status%0A * @returns %7BStatus%7Cpromise%7D%0A */%0AStatuses.prototype.createStatuses = function (boardId, status) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses', 'POST', status)%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @returns %7BCount%7Cpromise%7D%0A */%0AStatuses.prototype.getStatusesCount = function (boardId) %7B%0A    return this.api('/service/boards/' + boardI
 d + 
@@ -1640,32 +1640,38 @@
 + '/statuses
+/count
 ', 'GET'
 , params);%0A%7D
@@ -1650,39 +1650,1071 @@
 es/count', 'GET'
-, param
+);%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @param statusId%0A * @returns %7BDeleteResponse%7Cpromise%7D%0A */%0AStatuses.prototype.deleteStatusById = function (boardId, statusId) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'DELETE')%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @param statusId%0A * @returns %7BStatus%7Cpromise%7D%0A */%0AStatuses.prototype.getStatusById = function (boardId, statusId) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'GET');%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @param statusId%0A * @param %7BOperations%7D operations%0A * @returns %7BStatus%7Cpromise%7D%0A */%0AStatuses.prototype.updateStatus = function (boardId, statusId, operations) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'PATCH', operations);%0A%7D;%0A%0A/**%0A *%0A * @param boardId%0A * @param statusId%0A * @param %7BStatus%7D status%0A * @returns %7BStatus%7Cpromise%7D%0A */%0AStatuses.prototype.replaceStatuses = function (boardId, statusId, status) %7B%0A    return this.api('/service/boards/' + boardId + '/statuses/' + statusId, 'PUT', statu
 s);%0A%7D;%0A%0A/**%0A *%0A 

Add remaining status methods