text:
'use strict';

/**
 * @apiDefine ServiceRequest ServiceRequest
 * An issue(or service request) reported by civilian(or customer)
 * e.g Water Leakage occur at a particular area
 */

//dependencies
const path = require('path');
const express = require('express');
const router = express.Router();
const controller =
  require(path.join(__dirname, '..', 'controllers',
    'service_request_controller'));

// enable token authentication
const jwtAuth = require(path.join(__dirname, '..', 'middlewares', 'jwtAuth'));
const jurisdiction =
  require(path.join(__dirname, '..', 'middlewares', 'jurisdiction'));

// add specific middlewares to servicerequests router
router.all('/servicerequests*', jwtAuth);

/**
 * @api {get} /servicerequests Get Service Requests
 * @apiGroup ServiceRequest
 * @apiName GetServiceRequests
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value
 * @apiHeader {String}      Authorization
 *        Authorization token
 *
 * @apiExample Example Usage
 * curl -i http://dawasco.herokuapp.com/servicerequests
 *
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 * @apiSuccess {Number}       pages
 *        Number of results pages
 * @apiSuccess {Number}       count
 *        Number of ServiceRequest results  in the current json response
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 200 OK
 *    {
 *      "servicerequests": [
 *       {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *       },
 *       {
 *           "jurisdiction": {
 *               "code": "I",
 *               "name": "Ilala",
 *               "phone": "255714999887",
 *               "email": "N/A",
 *               "domain": "ilala.dawasco.org",
 *               "_id": "592029e6e8dd8e00048c1850",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e6e8dd8e00048c1850"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LK",
 *               "name": "Leakage",
 *               "color": "#D31DBB",
 *               "_id": "592029e6e8dd8e00048c1853",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1853"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.502Z",
 *               "endedAt": "2017-05-20T11:35:02.503Z",
 *               "duration": 0.001
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Joachim Mangilima",
 *               "phone": "255713111111",
 *               "_id": "592029e6e8dd8e00048c1865",
 *               "permissions": [],
 *               "email": "joachimm3@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1865"
 *           },
 *           "code": "ILK170001",
 *           "description": "There have been a leakage at my area. Lots of water in the street",
 *           "address": "Kijitonyama",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c185a",
 *           "createdAt": "2017-05-20T11:35:02.523Z",
 *           "updatedAt": "2017-05-20T11:36:34.084Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c185a"
 *       }
 *      ],
 *      "pages": 1,
 *      "count": 2
 *   }
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError JWTExpired     Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 *
 */
router.get('/servicerequests', jurisdiction, function (request, response, next) {
  controller.index(request, response, next);
});

/**
 * @api {post} /servicerequests Create Service Request
 * @apiGroup ServiceRequest
 * @apiName PostServiceRequest
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value i.e application/json
 * @apiHeader {String}      Authorization
 *        Authorization token
 * @apiHeader {String}      Content-Type
 *        Sent content type i.e application/json
 *
 * @apiParam {ObjectId}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiParam {ObjectId}       group
 *        A service group under which request(issue) belongs to
 * @apiParam {ObjectId}       service
 *        A service under which request(issue) belongs to
 * @apiParam {Object}         call
 *        Log operator call details at a call center
 * @apiParam {ObjectId}       reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiParam {ObjectId}       Operator
 *        A party oversee the work on the service request(issue).It also a party
 *        that is answerable for the progress and status of the service request(issue)
 *        to a reporter. For jurisdiction that own a call center, then operator is a
 *        person who received a call.
 * @apiParam {ObjectId}       assignee
 *        A party assigned to work on the service request(issue). It also a party that
 *        is answerable for the progress and status of the service request(issue)
 *        to operator and overall jurisdiction administrative structure.
 * @apiParam {String}         code
 *        A unique human readable identifier of the service request(issue). It
 *        mainly used by reporter to query for status and progress of the reported issue.
 * @apiParam {String}         description
 *        A detailed human readable explanation about the service request(issue).
 * @apiParam {String}         address
 *        A human entered address or description of location where service
 *        request(issue) happened.
 * @apiParam {String}         method
 *        A communication(contact) method(mechanism) used by a reporter to
 *        report the issue.
 * @apiParam {ObjectId}       status
 *        A current status of the service request(issue)
 * @apiParam {ObjectId}       priority
 *        A priority of the service request(issue).  It used to weight a service
 *        request(issue) relative  to other(s).
 * @apiParam {Array}          attachments
 *        Associated file(s) with service request(issue)
 *
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 201 Created
 *    {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *     }
 *
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError  JWTExpired                   Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.post('/servicerequests', function (request, response, next) {
  controller.create(request, response, next);
});

/**
 * @api {get} /servicerequests/:id Get Service Request
 * @apiGroup ServiceRequest
 * @apiName GetServiceRequest
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value i.e application/json
 * @apiHeader {String}      Authorization
 *        Authorization token

 *
 * @apiParam {ObjectId}       id                  Unique Service Request  Id.
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 200 OK
 *    {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *     }
 *
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError  JWTExpired                   Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.get('/servicerequests/:id', function (request, response, next) {
  controller.show(request, response, next);
});

/**
 * @api {put} /servicerequests/:id Update(PUT) Service Request
 * @apiGroup ServiceRequest
 * @apiName PutServiceRequest
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value i.e application/json
 * @apiHeader {String}      Authorization
 *        Authorization token
 * @apiHeader {String}      Content-Type
 *        Sent content type i.e application/json
 *
 * @apiParam {ObjectId}       id
 *        Unique Service Request Id.
 * @apiParam {ObjectId}       [jurisdiction]
 *        A jurisdiction responsible in handling service request(issue)
 * @apiParam {ObjectId}       [group]
 *        A service group under which request(issue) belongs to
 * @apiParam {ObjectId}       [service]
 *        A service under which request(issue) belongs to
 * @apiParam {Object}         [call]
 *        Log operator call details at a call center
 * @apiParam {ObjectId}       [reporter]
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiParam {ObjectId}       [operator]
 *        A party oversee the work on the service request(issue).It also a party
 *        that is answerable for the progress and status of the service request(issue)
 *        to a reporter. For jurisdiction that own a call center, then operator is a
 *        person who received a call.
 * @apiParam {ObjectId}       [assignee]
 *        A party assigned to work on the service request(issue). It also a party that
 *        is answerable for the progress and status of the service request(issue)
 *        to operator and overall jurisdiction administrative structure.
 * @apiParam {String}         [code]
 *        A unique human readable identifier of the service request(issue). It
 *        mainly used by reporter to query for status and progress of the reported issue.
 * @apiParam {String}         [description]
 *        A detailed human readable explanation about the service request(issue).
 * @apiParam {String}         [address]
 *        A human entered address or description of location where service
 *        request(issue) happened.
 * @apiParam {String}         [method]
 *        A communication(contact) method(mechanism) used by a reporter to
 *        report the issue.
 * @apiParam {ObjectId}       [status]
 *        A current status of the service request(issue)
 * @apiParam {ObjectId}       [priority]
 *        A priority of the service request(issue).  It used to weight a service
 *        request(issue) relative  to other(s).
 * @apiParam {Array}          [attachments]
 *        Associated file(s) with service request(issue)
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 200 OK
 *    {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *     }
 *
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError  JWTExpired                   Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.put('/servicerequests/:id', function (request, response, next) {
  controller.update(request, response, next);
});

/**
 * @api {patch} /servicerequests/:id Update(PATCH) Service Request
 * @apiGroup ServiceRequest
 * @apiName PatchServiceRequest
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value i.e application/json
 * @apiHeader {String}      Authorization
 *        Authorization token
 * @apiHeader {String}      Content-Type
 *        Sent content type i.e application/json
 *
 * @apiParam {ObjectId}       id
 *        Unique Service Request Id.
 * @apiParam {ObjectId}       [jurisdiction]
 *        A jurisdiction responsible in handling service request(issue)
 * @apiParam {ObjectId}       [group]
 *        A service group under which request(issue) belongs to
 * @apiParam {ObjectId}       [service]
 *        A service under which request(issue) belongs to
 * @apiParam {Object}         [call]
 *        Log operator call details at a call center
 * @apiParam {ObjectId}       [reporter]
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiParam {ObjectId}       [operator]
 *        A party oversee the work on the service request(issue).It also a party
 *        that is answerable for the progress and status of the service request(issue)
 *        to a reporter. For jurisdiction that own a call center, then operator is a
 *        person who received a call.
 * @apiParam {ObjectId}       [assignee]
 *        A party assigned to work on the service request(issue). It also a party that
 *        is answerable for the progress and status of the service request(issue)
 *        to operator and overall jurisdiction administrative structure.
 * @apiParam {String}         [code]
 *        A unique human readable identifier of the service request(issue). It
 *        mainly used by reporter to query for status and progress of the reported issue.
 * @apiParam {String}         [description]
 *        A detailed human readable explanation about the service request(issue).
 * @apiParam {String}         [address]
 *        A human entered address or description of location where service
 *        request(issue) happened.
 * @apiParam {String}         [method]
 *        A communication(contact) method(mechanism) used by a reporter to
 *        report the issue.
 * @apiParam {ObjectId}       [status]
 *        A current status of the service request(issue)
 * @apiParam {ObjectId}       [priority]
 *        A priority of the service request(issue).  It used to weight a service
 *        request(issue) relative  to other(s).
 * @apiParam {Array}          [attachments]
 *        Associated file(s) with service request(issue)
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 200 OK
 *    {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *     }
 *
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError  JWTExpired                   Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.patch('/servicerequests/:id', function (request, response, next) {
  controller.update(request, response, next);
});

/**
 * @api {delete} /servicerequests/:id Delete Service Request
 * @apiGroup ServiceRequest
 * @apiName DeleteServiceRequest
 * @apiVersion 0.1.0
 *
 * @apiHeader {String}      Accept
 *        Accept value i.e application/json
 * @apiHeader {String}      Authorization
 *        Authorization token
 *
 * @apiParam {ObjectId}       id
 *        Unique Service Request Id.
 *
 * @apiSuccess {Object}       jurisdiction
 *        A jurisdiction responsible in handling service request(issue)
 * @apiSuccess {Object}       group
 *        A service group under which request(issue) belongs to
 * @apiSuccess {Object}       Service
 *        A service under which request(issue) belongs to
 * @apiSuccess {Object}       Call
 *        Log operator call details at a call center
 * @apiSuccess {Object}       Reporter
 *        A party i.e civilian, customer etc which reported an issue(service request)
 * @apiSuccess {Object}       Operator
 *        A party oversee the work on the service request(issue).
 *        It also a party that is answerable for the progress and status of the
 *        service request(issue) to a reporter. For jurisdiction that own a call
 *        center, then operator is a person who received a call.
 * @apiSuccess {Object}       assignee
 *        A party assigned to work on the service request(issue).
 *        It also a party that is answerable for the progress and status of
 *        the service request(issue) to operator and overall jurisdiction
 *        administrative structure.
 * @apiSuccess {String}       code
 *        A unique human readable identifier of the service request(issue).
 *        It mainly used by reporter to query for status and progress of the reported issue.
 * @apiSuccess {String}       description
 *        A detailed human readable explanation about the service request(issue).
 * @apiSuccess {String}       address
 *        A human entered address or description of location where service request(issue) happened.
 * @apiSuccess {String}       method
 *        A communication(contact) method(mechanism) used by a reporter to report the issue.
 * @apiSuccess {Object}       status
 *        A current status of the service request(issue)
 * @apiSuccess {Object}       priority
 *        A priority of the service request(issue).
 *        It used to weight a service request(issue) relative  to other(s).
 * @apiSuccess {Array}        attachments
 *        Associated file(s) with service request(issue)
 * @apiSuccess {Duration}     ttr
 *        A time taken to resolve the issue(service request) in duration format.
 *        Used to calculate Mean Time To Resolve(MTTR) KPI.
 *        It calculated as time taken since the issue reported to the  time when issue resolved.
 * @apiSuccess {ObjectId}     _id
 *        Unique ServiceRequest Id
 * @apiSuccess {Timestamp}    createdAt
 *        Service request creation date
 * @apiSuccess {Timestamp}    updatedAt
 *        Service request last updated date
 * @apiSuccess {Number}       ttrSeconds
 *        A time taken to resolve the issue(service request) in seconds
 * @apiSuccess {Number}       ttrMinutes
 *        A time taken to resolve the issue(service request) in minutes
 * @apiSuccess {Number}       ttrHours
 *        A time taken to resolve the issue(service request) in hours
 * @apiSuccess {Number}       longitude
 *        Service request(issue) longitude
 * @apiSuccess {Number}       latitude
 *        Service request(issue) latitude
 * @apiSuccess {String}       uri
 *        ServiceRequest URI
 *
 * @apiSuccessExample {json} Success-Response:
 *    HTTP/1.1 200 OK
 *    {
 *           "jurisdiction": {
 *               "code": "H",
 *               "name": "HQ",
 *               "phone": "255714999888",
 *               "email": "N/A",
 *               "domain": "dawasco.org",
 *               "_id": "592029e5e8dd8e00048c184b",
 *               "longitude": 0,
 *               "latitude": 0,
 *               "uri": "https://dawasco.herokuapp.com/jurisdictions/592029e5e8dd8e00048c184b"
 *           },
 *           "service": {
 *               "group": {
 *                   "code": "N",
 *                   "name": "Non Commercial",
 *                   "color": "#960F1E",
 *                   "_id": "592029e6e8dd8e00048c184d",
 *                   "uri": "https://dawasco.herokuapp.com/servicegroups/592029e6e8dd8e00048c184d"
 *               },
 *               "code": "LW",
 *               "name": "Lack of Water",
 *               "color": "#960F1E",
 *               "_id": "592029e6e8dd8e00048c1852",
 *               "uri": "https://dawasco.herokuapp.com/services/592029e6e8dd8e00048c1852"
 *           },
 *           "call": {
 *               "startedAt": "2017-05-20T11:35:02.421Z",
 *               "endedAt": "2017-05-20T11:35:02.421Z",
 *               "duration": 0
 *           },
 *           "reporter": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "email": "scala.lally@gmail.com"
 *           },
 *           "operator": {
 *               "name": "Juma John",
 *               "phone": "255765952971",
 *               "_id": "592029e6e8dd8e00048c1856",
 *               "permissions": [],
 *               "email": "scala.lally@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c1856"
 *           },
 *           "assignee": {
 *               "name": "Moses Kabungo",
 *               "phone": "255753111039",
 *               "_id": "592029e6e8dd8e00048c185f",
 *               "permissions": [],
 *               "email": "kbng.moses@gmail.com",
 *               "uri": "https://dawasco.herokuapp.com/parties/592029e6e8dd8e00048c185f"
 *           },
 *           "code": "HLW170001",
 *           "description": "For three days now we dont have water",
 *           "address": "Mikocheni",
 *           "method": "Call",
 *           "status": {
 *               "name": "Open",
 *               "weight": -5,
 *               "color": "#0D47A1",
 *               "_id": "592029e5e8dd8e00048c180d",
 *               "createdAt": "2017-05-20T11:35:01.059Z",
 *               "updatedAt": "2017-05-20T11:35:01.059Z",
 *               "uri": "https://dawasco.herokuapp.com/statuses/592029e5e8dd8e00048c180d"
 *           },
 *           "priority": {
 *               "name": "Low",
 *               "weight": 0,
 *               "color": "#1B5E29",
 *               "_id": "592029e5e8dd8e00048c1816",
 *               "createdAt": "2017-05-20T11:35:01.586Z",
 *               "updatedAt": "2017-07-29T19:12:40.178Z",
 *               "uri": "https://dawasco.herokuapp.com/priorities/592029e5e8dd8e00048c1816"
 *           },
 *           "attachments": [],
 *           "ttr": 0,
 *           "_id": "592029e6e8dd8e00048c1859",
 *           "createdAt": "2017-05-20T11:35:02.474Z",
 *           "updatedAt": "2017-05-20T11:36:45.294Z",
 *           "ttrSeconds": 0,
 *           "ttrMinutes": 0,
 *           "ttrHours": 0,
 *           "longitude": 0,
 *           "latitude": 0,
 *           "uri": "https://dawasco.herokuapp.com/servicerequests/592029e6e8dd8e00048c1859"
 *     }
 *
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError  JWTExpired                   Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.delete('/servicerequests/:id', function (request, response, next) {
  controller.destroy(request, response, next);
});

/*
 * @api {patch} /servicerequests/:id/changelogs Get ServiceRequest ChangeLogs
 * @apiGroup ServiceRequest
 * @apiName PatchServiceRequestChangeLogs
 * @apiVersion 0.1.0
 *
 *
 * @apiHeader {String}        Accept
 *        Accept value i.e application/json
 * @apiHeader {String}        Authorization
 *        Authorization token
 *
 * @apiError  AuthorizationHeaderRequired  Authorization header is required
 *
 * @apiErrorExample   {json} Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"Authorization header required",
 *      "error":{}
 *    }
 *
 * @apiError JWTExpired     Authorization token has expired
 *
 * @apiErrorExample  {json}   Error-Response:
 *    HTTP/1.1 403 Forbidden
 *    {
 *      "success":false,
 *      "message :"jwt expired",
 *      "error":{}
 *    }
 */
router.patch('/servicerequests/:id/changelogs',
  function (request, response, next) {
    controller.changelogs(request, response, next);
  });

/**
 * exports servicerequests router
 * @type {Object}
 */
module.exports = router;


text:
/*
 * DamageTypes.h
 *
 *  Created on: May 20, 2013
 *      Author: planke
 */

#ifndef AchievementUpdateType_H_
#define AchievementUpdateType_H_

enum AchievementUpdateType {
	AUT_ALL, AUT_ACHIEVED, AUT_NOT_ACHIEVED
};

#endif /* AchievementUpdateType_H_ */

redpajama_set_name: RedPajamaGithub


text:
Salt Lake City, Salt Lake, Utah
1 GHEEN, Margarett Louisa 1 Jun 1859 Salt Lake City, Salt Lake, Utah I920
2 GRAHAM, Douglas Irvin 5 Nov 1902 Salt Lake City, Salt Lake, Utah I2237
3 STEWART, Boyd Mccullough 20 Nov 1862 Salt Lake City, Salt Lake, Utah I922
4 STEWART, Lydia Mccullough 29 Dec 1864 Salt Lake City, Salt Lake, Utah I923
1 BISHOP, Francis Edmund 22 Sep 1893 Salt Lake City, Salt Lake, Utah I2258
2 BLACK, Eva Almeda 10 Jun 1931 Salt Lake City, Salt Lake, Utah I151
3 BLACK, Homer "P" 26 Oct 1960 Salt Lake City, Salt Lake, Utah I152
4 BLACK, Margaret Ellen 18 Jan 1961 Salt Lake City, Salt Lake, Utah I233
5 GHEEN, John 26 Sep 1859 Salt Lake City, Salt Lake, Utah I919
6 JORGENSEN, Manola 22 May 1988 Salt Lake City, Salt Lake, Utah I2238
7 KNELL, Joseph Karl 18 Oct 1950 Salt Lake City, Salt Lake, Utah I558
8 KNELL, Mary Lue 28 Mar 1979 Salt Lake City, Salt Lake, Utah I560
9 PRATT, Eltha BISHOP 16 May 1928 Salt Lake City, Salt Lake, Utah I2281
2 GHEEN, John Salt Lake City, Salt Lake, Utah I919
1 BISHOP / PRATT 24 Jan 1873 Salt Lake City, Salt Lake, Utah F639
2 BLACK / JAMISON 26 Nov 1919 Salt Lake City, Salt Lake, Utah F80
3 EDWARDS / PRATT 20 Aug 1880 Salt Lake City, Salt Lake, Utah F677
4 PRATT / FREDRICKSON 24 Oct 1863 Salt Lake City, Salt Lake, Utah F692
5 PRATT / ROSS 19 Feb 1852 Salt Lake City, Salt Lake, Utah F667
6 STEWART / MC CULLOUGH 20 Aug 1861 Salt Lake City, Salt Lake, Utah F299
7 WOLVERTON / WHEELER 21 Aug 1912 Salt Lake City, Salt Lake, Utah F7
8 YOUNG / BLACK 9 May 1870 Salt Lake City, Salt Lake, Utah F88
9 YOUNG / BLACK 15 Jul 1872 Salt Lake City, Salt Lake, Utah F89

redpajama_set_name: RedPajamaCommonCrawl


Ricoh USA, Inc. today unveiled two new wide-format latex printers that provide the reliability and segment-leading print speeds needed to meet modern demands for fast turns. The RICOH Pro L5130/L5160 print up to 473.6 ft2/hr, with curing technology that leaves output ready for finishing as soon as it comes off the printer. Printers seeking to produce a broad range of output and drive greater productivity will immediately benefit from the printers' automated maintenance features and durable design. These next-generation Ricoh roll-to-roll latex printers, leveraging Ricoh's GREENGUARD-certified latex inks and industry leading printheads, will be showcased October 18-20 at Ricoh's SGIA EXPO booth 3601.
The L5130/L5160 series' speed, reliability and media versatility make it an excellent choice for today's print providers. In addition to speeds of up to 473.6 ft2/hr in outdoor standard mode and 270 ft2/hr in indoor standard mode, the series produces applications up to 1,200 x 1,200 dpi with high reliability due to the devices' industrial-grade Ricoh printheads. With CMYK and CMYK plus white options available, high ink opacity and adhesion enable the production of crisp, clear prints for a variety of applications on substrates that range from wall coverings to window graphics to backlit day/night signage.


March has in the main been a dry and warm month, although the last few days have returned to wet and cold. I hope we are nearly at the end of the Winter and am looking forward to a return to warm and sunny weather. The last few days have been so bad that I have not gone for my daily walk. Outside the rain has just stopped, so maybe I will walk today. There has been a lot of snow on the mountains and I attach a couple of pictures to illustrate the lovely view. Last week we filtered the wine, and the locals who tested it say that it is going to be good, so maybe this year will be a good one. Whilst doing this job, I stupidly managed to trip while approaching the wall to our neighbors field. I couldn´t stop myself and managed to fall the twenty odd feet to the bottom. Luckily I landed on my feet and so far there do not appear to be any lasting effects. I shall try to take greater care in the future!


Feeling nauseous is the worst. Be kind to yourself and help your body recover with IV hydration.
Important: If you're too sick to be able to drink water and keep it down, you should seek professional medical treatment from your primary care physician or a hospital. Dehydration caused by vomiting, diarrhea and other illness can be very serious. This advice is not intended as a substitute for medical counseling.
Your body loses a lot of fluids when you're sick. It's important to replace lost water and nutrients so your cells have the energy to fight off the sickness. When you're sick, you often don't have the appetite to eat properly.
There's a better way to get the hydration and nutrients you need to get better faster. IV vitamin infusions deliver fluids, electrolytes, and essential nutrients directly to your cells, bypassing your digestive system.
After one easy, 30-minute treatment in our relaxing spa environment, you'll be on your way to recovering.
You can also add anti-nausea supplements to any of our IV treatments to help quell a queasy stomach. Our hydration clinic near Newport Beach also offers flu shots to keep you healthy.
If you're feeling weak, tired and mentally sluggish from an illness or other condition, IV therapy can help you recover faster.
IV hydration can help you stay hydrated whether you're recovering from a recent illness or suffer from chronic digestive disorders making your system sensitive.
Of course it's best to rest in a climate-controlled environment out of the sun if heat has been a factor in causing your symptoms. Staying hydrated when you're feeling bad can seem like a lot of work, but it's far better than allowing dehydration to get worse.
Fast-acting IV hydration has many health benefits in addition to a faster recovery from illness. We can even customize a treatment just for you.
Book an appointment for IV therapy for the fastest way to rehydrate, or contact our IV hydration experts to learn more!


Theses bright airy spacious 3 bedroom cottages are an ideal base for exploring the wonders that the North coast has to offer.
Each cottage has 2 double bedrooms one with En-suite (upstairs)and one downstairs next to main bathroom and one 2 single bed bedroom (upstairs)with En-suite.
Six Fantastic holiday cottages situated just 2.5 miles from the Royal Portrush Golf Course which hosted the 2012 Irish Open and just 3.5 miles from both Coleraine and Bushmills.
Set in rural tranquil surroundings along the spectacular North Coast this property has much to offer including TV's in all 3 bedrooms and living room with all RTE channels, Scandinavian Styled Kitchen and cosy wood burning stove.
Ground Floor The Lounge /kitchen/diner, double, bathroom.
First Floor double (dressing room) with ensuite shower room, twin with ensuite shower room.
~ Coleraine is a large town near the mouth of the River Bann. It is 55 miles northwest of Belfast, both of which are linked by major roads and railway connection. City of Derry Airport , 25 miles to the West, Belfast International Airport, the main regional airport to the south and George Best Belfast City Airport to the South-East are all easily accessible from Coleraine.
~Portrush is a small seaside resort town in County Antrim. The main part of the old town, including the railway station as well as most hotels, restaurants and bars, is built on a mile-long peninsula, Ramore Head. It neighbours the resort of Portstewart. The town is well known for its three sandy beaches, the west Strand, East Strand and White Rocks, as well as the Royal Portrush Golf Club hosts to the British Open 2019, the only golf club outside of mainland Great Britain which has hosted the Open Championship and has also hosted the 2012 Irish Open.
~Bushmills is a village on the North Coast of County Antrim, two minutes from the Giants Causway World Heritage site and famous for its Distilery the oldest in the world reg.1608. It is Located 95 km from Belfast ,10km from Ballycastle and 15km from Coleraine. The village owes its name to the River Bush and to a large watermill that was built there in the early 17th century. The village is best known as the location of the Old Bushmills Distillery, founded in 1608, which is the oldest licensed distillery in the world.
Don't believe us, believe your own eyes! You can get a feel for our lovely cottages and grounds.
Just browse your way through our photo gallery.


Have you noticed an area of skin that is changing colors or growing larger? Or maybe you have what appears to be a common mole but that seems to be changing over time? Damage done to the skin as a result of overexposure to the sun, environmental toxins and DNA mutations cause changes in the appearance of the skin and put you at risk for developing potentially life threatening skin cancer spots. Ignorance surrounding the condition of skin cancer has led to an unfortunate number of deaths in the United States.
Almost completely preventable and curable, skin cancer is still overlooked by many as a medical threat. In an effort to educate and spread awareness, Soderstrom Skin Institute offers free Skin Cancer Screening Clinics to help the people of Central Illinois identify and also treat potentially harmful areas of skin. Sun or actinic damage causes early changes in the skin that can forewarn the development of skin cancers, and many precancerous skin spots are found on patients during these visits.
If you have noticed an area of skin that is changing colors or morphing, or have a common mole that seems to be changing over time, schedule an appointment with a dermatologist immediately.
There are many different types of skin cancer, but Basal cell carcinomas are the most common form. They are frequently seen on sun exposed areas of the skin, particularly the face. In most instances, they are completely curable.
Squamous cell carcinomas are frequently seen developing from pre-cancerous spots on the skin. These are treatable and, in many cases, preventable. Once found, they must be removed surgically and do have a small, but serious, chance of recurrence.
Malignant melanomas are the most dangerous form of skin cancers and a very serious reason Soderstrom Skin Institute hosts free skin cancer screenings. These are usually moles that are dark, black and growing with irregular borders and relentless growth patterns. The cause of malignant melanomas can be both genetic and environmental, as they are aggravated by sunlight. The best treatment for malignant melanomas is early detection and complete surgical removal. There are new experimental methods of vaccination that look promising towards treating patients who have had malignant melanomas that have spread. However, no treatment is better than early detection and surgical removal.
The prevention of skin cancer starts with self evaluation, knowing your "ABCDE's", and being aware of your melanoma family history. "ABCDE" is an acronym that can help you remember what to look for on your skin.
"A" is for asymmetry; look for moles or pigmented spots where one half is unlike the other.
"B" is for border; irregular, scalloped or poorly circumscribed borders should be checked by a dermatologist immediately.
"D" is for diameter; while melanomas are usually greater than 6mm in diameter when diagnosed, they can be smaller.
"E" is for evolving; if you notice a mole different from others, or which changes, itches, or bleeds, you should see a dermatologist.
It is important to avoid the hot midday sun, wear protective clothing (long sleeved lightweight shirts and blouses, wide-brimmed hats, and cover-ups on the beach), and always use sunscreens and sun blocks liberally and frequently. Prevention is always worth more than the treatment.
Decades of excessive sun exposure and ignorance about the cancer led to what appeared to be a serious skin cancer epidemic in the 1980's. Dermatologists saw a flood of people with signs and symptoms that before had gone unnoticed and untreated. Coincidentally, this medical outbreak came at a time when thousands of workers had been laid off in Central Illinois. In an effort to help those with reduced or non-existent medical benefits, Soderstrom Skin Institute began free Skin Cancer Screening Clinics. Thus, free Skin Cancer Screening Clinics began as a humanitarian effort, and have continued to grow locally, as well as nationally.
More than 25,000 patients have been examined for atypical spots and changing moles at Soderstrom Clinics. Each year, Soderstrom Skin Institute sponsors more than 15 free Skin Cancer Screening Clinics in central Illinois and eastern Iowa. Screening days are completely devoted to our patients. Patients seen at each clinic enjoy complimentary refreshments, consultations, informational lectures, and a free examination of worrisome or changing spots or skin diseases.


text:
Q: Getting all available category, subcategory list in magento 2 I want the replacement of the following code or similar to this code to get all category and subcategory in Magento 2.
$categories = Mage::getModel('catalog/category')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addIsActiveFilter();

any help will be appreciated
Thanks.

A: 1 – Create you new Extension for our case in folder
app/code/Ibnab/CategoriesSide
and inside etc folder declare you etc declare module.xml and di.xml with content :
module.xml :
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
    <module name="Ibnab_CategoriesSide" setup_version="1.0.0" schema_version="1.0.0">
        <sequence>
            <module name="Magento_Catalog"/>
        </sequence>
    </module>
</config>

 di.xml :
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <type name="Ibnab\CategoriesSide\Block\CategorisCollection">
        <arguments>
            <argument name="deleteorderAction" xsi:type="array">
                <item name="context" xsi:type="string">\Magento\Framework\View\Element\Template\Context</item>
                <item name="helper" xsi:type="string">\Magento\Catalog\Helper\Category</item>
                <item name="flatstate" xsi:type="string">\Magento\Catalog\Model\Indexer\Category\Flat\State</item>
               <item name="menu" xsi:type="string">\Magento\Theme\Block\Html\Topmenu</item>
            </argument>
        </arguments>
    </type>
</config>

Note - Here the dependency is for inject the class  \Magento\Catalog\Helper\Category for getting all categories of current store (And OR ) get the top menu html for the complete collection you need inject \Magento\Theme\Block\Html\Topmenu  ,
2 -  the injection is for our data source the block
Ibnab\CategoriesSide\Block\CategorisCollection create and put the code :
<?php
namespace Ibnab\CategoriesSide\Block;
class CategorisCollection extends \Magento\Framework\View\Element\Template
{
     protected $_categoryHelper;
     protected $categoryFlatConfig;
     protected $topMenu;
    /**
     * @param \Magento\Framework\View\Element\Template\Context $context
     * @param \Magento\Catalog\Helper\Category $categoryHelper
     * @param array $data
     */
    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Catalog\Helper\Category $categoryHelper,
        \Magento\Catalog\Model\Indexer\Category\Flat\State $categoryFlatState,
        \Magento\Theme\Block\Html\Topmenu $topMenu
    ) {
        $this->_categoryHelper = $categoryHelper;
        $this->categoryFlatConfig = $categoryFlatState;
        $this->topMenu = $topMenu;
        parent::__construct($context);
    }
    /**
     * Return categories helper
     */
    public function getCategoryHelper()
    {
        return $this->_categoryHelper;
    }
    /**
     * Return top menu html
     * getHtml($outermostClass = '', $childrenWrapClass = '', $limit = 0)
     * example getHtml('level-top', 'submenu', 0)
     */
    public function getHtml()
    {
        return $this->topMenu->getHtml();
    }
    /**
     * Retrieve current store categories
     *
     * @param bool|string $sorted
     * @param bool $asCollection
     * @param bool $toLoad
     * @return \Magento\Framework\Data\Tree\Node\Collection|\Magento\Catalog\Model\Resource\Category\Collection|array
     */
   public function getStoreCategories($sorted = false, $asCollection = false, $toLoad = true)
    {
        return $this->_categoryHelper->getStoreCategories($sorted , $asCollection, $toLoad);
    }
    /**
     * Retrieve child store categories
     *
     */
    public function getChildCategories($category)
    {
           if ($this->categoryFlatConfig->isFlatEnabled() && $category->getUseFlatResource()) {
                $subcategories = (array)$category->getChildrenNodes();
            } else {
                $subcategories = $category->getChildren();
            }
            return $subcategories;
    }
}

Note – The more important here is  getStoreCategories and getChildCategories($category)
  , it  get you the data collection tree from helper , and getHtml()
 is return the complete collection is more quick for correct the html
3 - ok now create you template inside view/frontend/template/storecategories.phtml with content :
<?php
$categories = $this->getStoreCategories(true,false,true);
$categoryHelper = $this->getCategoryHelper();
?>

<?php
foreach($categories as $category):
     if (!$category->getIsActive()) {
        continue;
     }
?>

<a href="<?php echo $categoryHelper->getCategoryUrl($category) ?>"><?php echo $category->getName() ?>

<?php
if($childrenCategories = $this->getChildCategories($category)):
?>

<?php
foreach($childrenCategories as $childrenCategory):
     if (!$childrenCategory->getIsActive()) {
        continue;
     }
?>

<a href="<?php echo $categoryHelper->getCategoryUrl($childrenCategory) ?>"><?php echo $childrenCategory->getName() ?>

<?php
endforeach;
?>

<?php
endif;
endforeach;
?>

OR Just

<?php echo $this->getHtml() ?>

For more detail see here.
enter preformatted text here

A: <?php
 $catId =2;
        $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
        $subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
        $subcats = $subcategory->getChildrenCategories();
        ?>

  All Categories

            <?php
            foreach ($subcats as $subcat) {
                if ($subcat->getIsActive()) {

                    $subcat_url = $subcat->getUrl();
                    $subcat_img = "";
                    $placeholder_img = "/media/placeholder.png";
                    ?>

                        <a href="<?php echo $subcat_url; ?>">
                            <?php echo $subcat->getName(); ?>

                    <?php
                }
            }
            ?>

A: Magento 2.2.3
Get all Subcategories base on current category.

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');//get current category

    $catId =$category->getId();
    $subcategory = $objectManager->create('Magento\Catalog\Model\Category')->load($catId);
    $subcats = $subcategory->getChildrenCategories();
    ?>

        <?php
        foreach ($subcats as $subcat) {
            if ($subcat->getIsActive()) {

                $subcat_url = $subcat->getUrl();
                $subcat_img = "";
                $placeholder_img = "/media/placeholder.png";
                ?>

                    <a href="<?php echo $subcat_url; ?>">
                        <?php echo $subcat->getName(); ?>

                <?php
            }
        }
        ?>

redpajama_set_name: RedPajamaStackExchange


We are celebrating 200 years of providing fine Coffee and Tea across the Lake District, proud of our people and heritage here.
Along with Coffee roasted on site and Teas blended in Kendal, we offer the complete hot beverage service with the whole range of products, ancillaries, coffee machines, specialist servicing as well as Barista training at the only Beverage Standards Association recognised centre in the North West.
Join us on Stand 30 for a coffee and learn more about the plans for the rest of our Bicentennial year.


text:
Business & Economy • Society & Culture
Government contracting decreases employee diversity
by Shelby R. Steuart
Ed Kellough and his graduate research assistant Lawrence Brown review a paper in Kellough's office.
A new study by researchers at the University of Georgia revealed that when governments contract work out to private companies, fewer African American, Hispanic and female employees are hired.
Over the past 20 years, private contracting has become a popular way to improve efficiency in the public sector.
"Increasingly, services that were once performed by public employees are provided under contract by private firms," said study author J. Edward Kellough, a UGA professor of public administration and policy in the School of Public and International Affairs. "The question," he added, "is whether this growth in contracting has been detrimental to minority and female employment."
Kellough and research assistant Lawrence Brown's study reveals that it has.
Using a panel data set, the researchers examined the representation of minorities and women at 16 federal agencies between 2010 to 2016. They looked for patterns in diversity following high levels of contracting, controlling for variables that have been shown to impact minority and female employment.
Listen to WUGA's report on this study.
They found that increases in contracting led to decreases in workforce diversity. This finding is most noticeable in African American and female participation at the highest-level positions.
"Traditionally, public sector employment has been an engine for advancing economic progress for women and minorities," Kellough said. "It has promoted the growth of the minority middle class while providing stability and security for employees."
If opportunities for minorities and women are diminishing because government contracting is growing, there could be fewer avenues to economic security for a demographically diverse middle class, Kellough concluded.
Additionally, Kellough and Brown observed that diversity in the public workforce improves the quality of American public service. Diversity and inclusion spur innovation, increase productivity and create a healthy, respectful workplace.
They hope that this line of research will prompt further inquiry and consideration of these issues.
Diversity Research School of Public and International Affairs
The moon landing's legacy: A better life on Earth
New book explains how mass tort suits may benefit…


Spot on but with this footnote: 1. our brains are configured for data being integrated to wisdom 2. Early PC studies knew to teach: differentiate data and knowledge. Add after some 4 decades: differentiate knowledge and wisdom. 3. Our non-spatial "minds" (with many aliases) are the controllers (Greek/ Latin gubernertai/ governors that utilise our time and space-bound grey matter, so wonderfully fashioned!!


Navigator Homestead FL | Berry's Paint Wallpaper & Flooring Inc.
Mower deck widths: 42" 48"
The optional powered dump attachment system means less time emptying and more time mowing. An exclusive baffle design fills, evenly back to front, for maximum efficiency on large lawns.
Landscape professionals can spend more time mowing and less time maintaining their commercial mower.
The Navigator's patented fill-reduction system lets you bag 100%, bag 33% and mulch 67% or mulch 100%. All with its versatile cutting deck and baffle system.
As the name implies, you don't have to muscle the Navigator around. Its FeatherTouch controls make maneuvering tight spots virtually effortless.
Superior gear with spiral-bevel cut gears. Rated at 50hp for improved durability.
4 5/8 inch deep deck allows for improved productivity and durability.
Larger diameter blower helps improve hopper fill and reduce plugging.
Orientation of the engine draws air from the front of the machine over the belts, pumps and through the engine to the rear of the machine extending driveline component life. Fuel tank pivots out for easy servicing of the engine.
Blade Spindles Heavy Duty cast iron right-angle gearboxes.
Drive Tires 18 x 10.5-10 Multi-Trac® C/S.
Tractor Frame Channeled and fully welded 1.5" x 1.5" x 0.187" wall tubing with a ground clearance of 4.0", strategically located, continuous force counterweight springs.
Steering Control FeatherTouch hand-control drive levers, low-force constant speed lever.
Front Caster Tires 8 x 3.0-4 semi-pneumatic.
Parking Brake Wet disc, internal in wheel motor.
Seat Commercial grade high back contoured foam padded with hinged mounting.
Fuel Capacity 7.5-gallon (28.4-L), pivoting tank for easier engine service.
Drive Description New Dual Hydro-Gear 12 cc variable displacement pumps power Hydro-Gear H Series motors.
Speed Infinitely variable speed selection from 0–7.0 mph (11.3 kmph) forward, 0–4.5 mph (7.2 kmph) reverse.
ROPS Optional 2-post foldable ROPS with seat belt and latch.
PTO Engagement Lever-actuated clutching belt with 6" brake band.
Drive Wheel Release Allows movement without engine running.
Deck Style Description Full floating center discharge cutting deck for dedicated bagging with patented Fill Reduction Baffles and heavy duty gear driven spindle assembly.
Deck Construction 7-gauge sides joined by a continuous bead weld to a 10-gauge top, 3/16" wear guard is welded to the entire base of the deck, 7-gauge deck spindle supports, 0.25"-thick strap steel deck supports.
Cutting Heights 1.0" (2.54 cm) to 4.0" (10.2 cm) in 0.25" (0.64 cm) increments .
Debris can be quickly and conveniently managed with our two polyethylene tub inserts. These removable tubs enable the weight of a full, 9.5-bushel hopper to be split and unloaded, one tub at a time.
Keep mowing after the sun goes down with brilliant, 35-watt halogen power from this Navigator work lamp kit. The highly durable lenses repel dust, and withstand impact. With twice the illumination output of a conventional work lamp, the kit also features a pivot base.
Optimize safe operation with this Roll Over Protection System.
Enhance your productivity with this quick opening auto door system.
Improve productivity by not having to leave your operator position with this power dump accessory. A full load of grass can be managed with the push of a button. Or, if dumping by hand is your preference, this accessory automatically disengages and re-engages the hopper without operator intervention.
Spread your hopper load to minimize turf impact with this split caster kit.
A great value in comparison to more expensive full-suspension seats, our CustomRide suspension system easily mounts to your existing EVC operator seat. System features enable operator to customize suspension settings to their individual weight and personal preference. Fits all Lazer Z models.
Turns the dedicated bagging deck into a mulcher. The aerodynamically designed deck, baffles and special mulching blades create airflow patterns that circulate leaves and grass for repeated cuttings and even dispersal deep into the turf. Single one piece bolt in baffle redirects clippings away from the center rear discharge opening.


Dr. Ronald Takaki comes to campus for public lecture and workshop!
OED 1st Annual Diversity Fair!
November 19, 2008 OED 2nd Annual Diversity Fair!
"Best Practices to Champion Diversity"
"Social Justice from a Faith Perspective"
4th Floor St. Thomas is the place to be!
Rosette Adera and Jennifer Pennington, OED DIVERSITY FAIR 3!


text:
Coronapod: new data affirms the benefits of air filters and masks
New data suggests that inexpensive, high-efficiency particulate air (HEPA) filters can effectively scrub SARS-CoV-2 particles from the air in hospital COVID wards. The result validates previous studies carried out in controlled conditions. Currently, HEPA filters are not routinely used in hospital settings, but researchers suggest they could could help mitigate the risk of tramission of airborne viruses.
In addition a new study has demonstrated the effectiveness of mask wearing, with surgical masks proving more effective than those made of cloth. The trial, which involved 350,000 participants in Bangladesh, is the latest in a long line of studies demonstrating mask efficacy - but this is the first randomised control trial of its kind. We ask if this gold-standard trial will prove to be the final word on the effectiveness of masks.
News: Real-world data show that filters clean COVID-causing virus from air
News: Face masks for COVID pass their largest test yet
Subscribe to Nature Briefing, an unmissable daily round-up of science news, opinion and analysis free in your inbox every weekday.
More from Nature Podcast
29:29Coronapod: COVID death toll is likely millions more than official countsJan 21, 2022
30:55Why mutation is not as random as we thoughtJan 19, 2022
13:01Podcast Extra: Recreating the lost sounds of springJan 14, 2022
20:09Webb Space Telescope makes history after tense launchJan 12, 2022
11:02Science in 2022: what to expect this yearJan 05, 2022
16:03Audio long-read: The secret lives of cells — as never seen beforeDec 31, 2021
36:07Our podcast highlights of 2021Dec 29, 2021
33:54The Nature Podcast annual holiday spectacularDec 22, 2021
31:33Coronapod: Omicron - your questions answeredDec 17, 2021
25:27Pluto's strange ice patterns explained by new theoryDec 15, 2021


text:
Poor asbestos assessment
Home/HSE2/Poor asbestos assessment
Contractor fined for poor asbestos assessment
A Bedfordshire based contractor has been fined after failing to carry out suitable assessment of asbestos removal work.
Luton Magistrates Court heard how Anthony West was contracted to complete demolition work at a building in Biggleswade. West then had a pre-demolition asbestos survey carried out for the building.
The Health and Safety Executive (HSE) had the demolition work reported to 16 April 2015by a member of the public which prompted an investigation into the work.
The investigation found that West did not adequately check the pre-demolition asbestos survey before carrying out the work, and did not follow advice to use a licensed asbestos removal contractor.
West, of Earwig Farm House, Pavenham, Bedford has pleaded guilty to breaching sections 5,7,8 and 16 of the Control of Asbestos Regulations 2012 and has been fined £2970 and ordered to pay costs of £5419.
Speaking after the hearing HSE inspector Alison Outhwaite said:
"The safety failings in this case could have led to severe illness in later years. West not only put himself at risk to exposure but potentially to fellow workers and members of the public walking past. Duty holders have the responsibility to ensure that adequate assessments take place to avoid the risk of asbestos exposure. This includes checking the accuracy and clarity of any information provided by others."


text:
Xanthoconalia timossii es una especie de coleóptero de la familia Mordellidae.

Distribución geográfica
Habita en Somalia.

Referencias

Mordellidae
Fauna de Somalia

redpajama_set_name: RedPajamaWikipedia