Built motion from commit 67e5df37.|2.0.60
[motion2.git] / server / api / chatQueueReport / chatQueueReport.controller.js
index 0747033..57410c6 100644 (file)
@@ -1 +1 @@
-var _0x1ae9=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x61\x73\x74\x2D\x6A\x73\x6F\x6E\x2D\x70\x61\x74\x63\x68","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x75\x73\x74\x61\x63\x68\x65","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x73\x6F\x78","\x74\x6F\x2D\x63\x73\x76","\x65\x6A\x73","\x66\x73","\x6C\x6F\x64\x61\x73\x68","\x73\x71\x75\x65\x6C","\x63\x72\x79\x70\x74\x6F","\x6A\x73\x66\x6F\x72\x63\x65","\x64\x65\x73\x6B\x2E\x6A\x73","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x70\x61\x70\x61\x70\x61\x72\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x70\x61\x72\x73\x65\x72\x73\x2F\x71\x73","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x63\x6F\x75\x6E\x74","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x52\x61\x6E\x67\x65","\x2D","\x2F","\x73\x65\x74","\x61\x70\x70\x6C\x79","\x72\x65\x6A\x65\x63\x74","\x73\x61\x76\x65","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x69\x6E\x64\x65\x78","\x6D\x6F\x64\x65\x6C","\x72\x61\x77\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x43\x68\x61\x74\x51\x75\x65\x75\x65\x52\x65\x70\x6F\x72\x74","\x6B\x65\x79\x73","\x64\x61\x74\x65\x53\x74\x61\x72\x74","\x71\x75\x65\x72\x79","\x64\x61\x74\x65\x45\x6E\x64","\x66\x69\x6C\x74\x65\x72\x73","\x69\x6E\x74\x65\x72\x73\x65\x63\x74\x69\x6F\x6E","\x61\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x66\x69\x65\x6C\x64\x73","\x6C\x65\x6E\x67\x74\x68","\x6E\x6F\x6C\x69\x6D\x69\x74","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x6F\x72\x64\x65\x72","\x73\x6F\x72\x74","\x77\x68\x65\x72\x65","\x70\x69\x63\x6B","\x64\x61\x79","\x61\x64\x64","\x6D\x65\x72\x67\x65","\x66\x69\x6C\x74\x65\x72","\x25","\x6D\x61\x70","\x6F\x70\x74\x69\x6F\x6E\x73","\x63\x61\x74\x63\x68","\x72\x6F\x77\x73","\x69\x6E\x63\x6C\x75\x64\x65\x41\x6C\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x64\x65\x73\x63\x72\x69\x62\x65"];_0x1ae9[0];var jsonpatch=require(_0x1ae9[1]);var rp=require(_0x1ae9[2]);var moment=require(_0x1ae9[3]);var BPromise=require(_0x1ae9[4]);var Mustache=require(_0x1ae9[5]);var util=require(_0x1ae9[6]);var path=require(_0x1ae9[7]);var sox=require(_0x1ae9[8]);var csv=require(_0x1ae9[9]);var ejs=require(_0x1ae9[10]);var fs=require(_0x1ae9[11]);var _=require(_0x1ae9[12]);var squel=require(_0x1ae9[13]);var crypto=require(_0x1ae9[14]);var jsforce=require(_0x1ae9[15]);var deskjs=require(_0x1ae9[16]);var toCsv=require(_0x1ae9[9]);var querystring=require(_0x1ae9[17]);var Papa=require(_0x1ae9[18]);var qs=require(_0x1ae9[19]);var logger=require(_0x1ae9[21])(_0x1ae9[20]);var utils=require(_0x1ae9[22]);var config=require(_0x1ae9[23]);var db=require(_0x1ae9[25])[_0x1ae9[24]];function respondWithStatusCode(_0xe3f3x1a,_0xe3f3x1b){_0xe3f3x1b= _0xe3f3x1b|| 204;return function(_0xe3f3x1c){if(_0xe3f3x1c){return _0xe3f3x1a[_0x1ae9[26]](_0xe3f3x1b)};return _0xe3f3x1a[_0x1ae9[28]](_0xe3f3x1b)[_0x1ae9[27]]()}}function respondWithResult(_0xe3f3x1a,_0xe3f3x1b){_0xe3f3x1b= _0xe3f3x1b|| 200;return function(_0xe3f3x1c){if(_0xe3f3x1c){return _0xe3f3x1a[_0x1ae9[28]](_0xe3f3x1b)[_0x1ae9[29]](_0xe3f3x1c)}}}function respondWithFilteredResult(_0xe3f3x1a,_0xe3f3x1f){return function(_0xe3f3x1c){if(_0xe3f3x1c){var _0xe3f3x20=_0xe3f3x1c[_0x1ae9[30]],_0xe3f3x21=_0xe3f3x1f[_0x1ae9[31]],_0xe3f3x22=_0xe3f3x1f[_0x1ae9[31]]+ _0xe3f3x1f[_0x1ae9[32]],_0xe3f3x1b;if(_0xe3f3x22>= _0xe3f3x20){_0xe3f3x22= _0xe3f3x20;_0xe3f3x1b= 200}else {_0xe3f3x1b= 206};_0xe3f3x1a[_0x1ae9[28]](_0xe3f3x1b);return _0xe3f3x1a[_0x1ae9[36]](_0x1ae9[33],_0xe3f3x21+ _0x1ae9[34]+ _0xe3f3x22+ _0x1ae9[35]+ _0xe3f3x20)[_0x1ae9[29]](_0xe3f3x1c)};return null}}function patchUpdates(_0xe3f3x24){return function(_0xe3f3x1c){try{jsonpatch[_0x1ae9[37]](_0xe3f3x1c,_0xe3f3x24,true)}catch(err){return BPromise[_0x1ae9[38]](err)};return _0xe3f3x1c[_0x1ae9[39]]()}}function saveUpdates(_0xe3f3x26,_0xe3f3x1b){return function(_0xe3f3x1c){if(_0xe3f3x1c){return _0xe3f3x1c[_0x1ae9[41]](_0xe3f3x26)[_0x1ae9[40]](function(_0xe3f3x27){return _0xe3f3x27})};return null}}function removeEntity(_0xe3f3x1a,_0xe3f3x1b){return function(_0xe3f3x1c){if(_0xe3f3x1c){return _0xe3f3x1c[_0x1ae9[42]]()[_0x1ae9[40]](function(){_0xe3f3x1a[_0x1ae9[28]](204)[_0x1ae9[27]]()})}}}function handleEntityNotFound(_0xe3f3x1a,_0xe3f3x1b){return function(_0xe3f3x1c){if(!_0xe3f3x1c){_0xe3f3x1a[_0x1ae9[26]](404)};return _0xe3f3x1c}}function handleError(_0xe3f3x1a,_0xe3f3x1b){_0xe3f3x1b= _0xe3f3x1b|| 500;return function(_0xe3f3x2b){logger[_0x1ae9[44]](_0xe3f3x2b[_0x1ae9[43]]);if(_0xe3f3x2b[_0x1ae9[45]]){delete _0xe3f3x2b[_0x1ae9[45]]};_0xe3f3x1a[_0x1ae9[28]](_0xe3f3x1b)[_0x1ae9[46]](_0xe3f3x2b)}}exports[_0x1ae9[47]]= function(_0xe3f3x2c,_0xe3f3x1a){var _0xe3f3x1f={},_0xe3f3x2d={},_0xe3f3x2e={count:0,rows:[]};_0xe3f3x2d[_0x1ae9[48]]= _[_0x1ae9[51]](db[_0x1ae9[50]][_0x1ae9[49]]);var _0xe3f3x2f={dateStart:_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[52]],dateEnd:_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[54]]};delete _0xe3f3x2c[_0x1ae9[53]][_0x1ae9[52]];delete _0xe3f3x2c[_0x1ae9[53]][_0x1ae9[54]];_0xe3f3x2d[_0x1ae9[53]]= _[_0x1ae9[51]](_0xe3f3x2c[_0x1ae9[53]]);_0xe3f3x2d[_0x1ae9[55]]= _[_0x1ae9[56]](_0xe3f3x2d[_0x1ae9[48]],_0xe3f3x2d[_0x1ae9[53]]);_0xe3f3x1f[_0x1ae9[57]]= _[_0x1ae9[56]](_0xe3f3x2d[_0x1ae9[48]],qs[_0x1ae9[58]](_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[58]]));_0xe3f3x1f[_0x1ae9[57]]= (_0xe3f3x1f[_0x1ae9[57]][_0x1ae9[59]])?_0xe3f3x1f[_0x1ae9[57]]:_0xe3f3x2d[_0x1ae9[48]];if(!_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[61]](_0x1ae9[60])){_0xe3f3x1f[_0x1ae9[32]]= qs[_0x1ae9[32]](_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[32]]);_0xe3f3x1f[_0x1ae9[31]]= qs[_0x1ae9[31]](_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[31]])};_0xe3f3x1f[_0x1ae9[62]]= qs[_0x1ae9[63]](_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[63]]);_0xe3f3x1f[_0x1ae9[64]]= qs[_0x1ae9[55]](_[_0x1ae9[65]](_0xe3f3x2c[_0x1ae9[53]],_0xe3f3x2d[_0x1ae9[55]]));if(_0xe3f3x2f[_0x1ae9[52]]){if(_0xe3f3x2f[_0x1ae9[54]]){_0xe3f3x2f[_0x1ae9[54]]= moment(_0xe3f3x2f[_0x1ae9[54]])[_0x1ae9[67]](1,_0x1ae9[66])}else {_0xe3f3x2f[_0x1ae9[54]]= moment(_0xe3f3x2f[_0x1ae9[52]])[_0x1ae9[67]](1,_0x1ae9[66])};_[_0x1ae9[68]](_0xe3f3x1f[_0x1ae9[64]],{createdAt:{$gte:_0xe3f3x2f[_0x1ae9[52]],$lte:_0xe3f3x2f[_0x1ae9[54]]}})};if(_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[69]]){_0xe3f3x1f[_0x1ae9[64]]= _[_0x1ae9[68]](_0xe3f3x1f[_0x1ae9[64]],{$or:_[_0x1ae9[71]](_0xe3f3x1f[_0x1ae9[57]],function(_0xe3f3x30){var _0xe3f3x2e={};_0xe3f3x2e[_0xe3f3x30]= {$like:_0x1ae9[70]+ _0xe3f3x2c[_0x1ae9[53]][_0x1ae9[69]]+ _0x1ae9[70]};return _0xe3f3x2e})})};_0xe3f3x1f= _[_0x1ae9[68]]({},_0xe3f3x1f,_0xe3f3x2c[_0x1ae9[72]]);var _0xe3f3x31={where:_0xe3f3x1f[_0x1ae9[64]]};return db[_0x1ae9[50]][_0x1ae9[30]](_0xe3f3x31)[_0x1ae9[40]](function(_0xe3f3x20){_0xe3f3x2e[_0x1ae9[30]]= _0xe3f3x20;if(_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[75]]){_0xe3f3x1f[_0x1ae9[76]]= [{all:true}]};return db[_0x1ae9[50]][_0x1ae9[77]](_0xe3f3x1f)})[_0x1ae9[40]](function(_0xe3f3x32){_0xe3f3x2e[_0x1ae9[74]]= _0xe3f3x32;return _0xe3f3x2e})[_0x1ae9[40]](respondWithFilteredResult(_0xe3f3x1a,_0xe3f3x1f))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))};exports[_0x1ae9[78]]= function(_0xe3f3x2c,_0xe3f3x1a){var _0xe3f3x1f={raw:true,where:{id:_0xe3f3x2c[_0x1ae9[80]][_0x1ae9[79]]}},_0xe3f3x2d={};_0xe3f3x2d[_0x1ae9[48]]= _[_0x1ae9[51]](db[_0x1ae9[50]][_0x1ae9[49]]);_0xe3f3x2d[_0x1ae9[53]]= _[_0x1ae9[51]](_0xe3f3x2c[_0x1ae9[53]]);_0xe3f3x2d[_0x1ae9[55]]= _[_0x1ae9[56]](_0xe3f3x2d[_0x1ae9[48]],_0xe3f3x2d[_0x1ae9[53]]);_0xe3f3x1f[_0x1ae9[57]]= _[_0x1ae9[56]](_0xe3f3x2d[_0x1ae9[48]],qs[_0x1ae9[58]](_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[58]]));_0xe3f3x1f[_0x1ae9[57]]= (_0xe3f3x1f[_0x1ae9[57]][_0x1ae9[59]])?_0xe3f3x1f[_0x1ae9[57]]:_0xe3f3x2d[_0x1ae9[48]];if(_0xe3f3x2c[_0x1ae9[53]][_0x1ae9[75]]){_0xe3f3x1f[_0x1ae9[76]]= [{all:true}]};_0xe3f3x1f= _[_0x1ae9[68]]({},_0xe3f3x1f,_0xe3f3x2c[_0x1ae9[72]]);return db[_0x1ae9[50]][_0x1ae9[81]](_0xe3f3x1f)[_0x1ae9[40]](handleEntityNotFound(_0xe3f3x1a,null))[_0x1ae9[40]](respondWithResult(_0xe3f3x1a,null))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))};exports[_0x1ae9[82]]= function(_0xe3f3x2c,_0xe3f3x1a){return db[_0x1ae9[50]][_0x1ae9[82]](_0xe3f3x2c[_0x1ae9[83]],{})[_0x1ae9[40]](respondWithResult(_0xe3f3x1a,201))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))};exports[_0x1ae9[41]]= function(_0xe3f3x2c,_0xe3f3x1a){if(_0xe3f3x2c[_0x1ae9[83]][_0x1ae9[79]]){delete _0xe3f3x2c[_0x1ae9[83]][_0x1ae9[79]]};return db[_0x1ae9[50]][_0x1ae9[81]]({where:{id:_0xe3f3x2c[_0x1ae9[80]][_0x1ae9[79]]}})[_0x1ae9[40]](handleEntityNotFound(_0xe3f3x1a,null))[_0x1ae9[40]](saveUpdates(_0xe3f3x2c[_0x1ae9[83]],null))[_0x1ae9[40]](respondWithResult(_0xe3f3x1a,null))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))};exports[_0x1ae9[42]]= function(_0xe3f3x2c,_0xe3f3x1a){return db[_0x1ae9[50]][_0x1ae9[81]]({where:{id:_0xe3f3x2c[_0x1ae9[80]][_0x1ae9[79]]}})[_0x1ae9[40]](handleEntityNotFound(_0xe3f3x1a,null))[_0x1ae9[40]](removeEntity(_0xe3f3x1a,null))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))};exports[_0x1ae9[84]]= function(_0xe3f3x2c,_0xe3f3x1a){return db[_0x1ae9[50]][_0x1ae9[84]]()[_0x1ae9[40]](respondWithResult(_0xe3f3x1a,null))[_0x1ae9[73]](handleError(_0xe3f3x1a,null))}
\ No newline at end of file
+var _0x6634=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x66\x61\x73\x74\x2D\x6A\x73\x6F\x6E\x2D\x70\x61\x74\x63\x68","\x72\x65\x71\x75\x65\x73\x74\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x75\x73\x74\x61\x63\x68\x65","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x73\x6F\x78","\x74\x6F\x2D\x63\x73\x76","\x65\x6A\x73","\x66\x73","\x6C\x6F\x64\x61\x73\x68","\x73\x71\x75\x65\x6C","\x63\x72\x79\x70\x74\x6F","\x6A\x73\x66\x6F\x72\x63\x65","\x64\x65\x73\x6B\x2E\x6A\x73","\x71\x75\x65\x72\x79\x73\x74\x72\x69\x6E\x67","\x70\x61\x70\x61\x70\x61\x72\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6D\x70\x6F\x6E\x65\x6E\x74\x73\x2F\x70\x61\x72\x73\x65\x72\x73\x2F\x71\x73","\x61\x70\x69","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x75\x74\x69\x6C\x73","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x64\x62","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x79\x73\x71\x6C\x64\x62","\x73\x65\x6E\x64\x53\x74\x61\x74\x75\x73","\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x63\x6F\x75\x6E\x74","\x6F\x66\x66\x73\x65\x74","\x6C\x69\x6D\x69\x74","\x43\x6F\x6E\x74\x65\x6E\x74\x2D\x52\x61\x6E\x67\x65","\x2D","\x2F","\x73\x65\x74","\x61\x70\x70\x6C\x79","\x72\x65\x6A\x65\x63\x74","\x73\x61\x76\x65","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x74\x72\x6F\x79","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x69\x6E\x64\x65\x78","\x6D\x6F\x64\x65\x6C","\x72\x61\x77\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x43\x68\x61\x74\x51\x75\x65\x75\x65\x52\x65\x70\x6F\x72\x74","\x6B\x65\x79\x73","\x64\x61\x74\x65\x53\x74\x61\x72\x74","\x71\x75\x65\x72\x79","\x64\x61\x74\x65\x45\x6E\x64","\x66\x69\x6C\x74\x65\x72\x73","\x69\x6E\x74\x65\x72\x73\x65\x63\x74\x69\x6F\x6E","\x61\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x66\x69\x65\x6C\x64\x73","\x6C\x65\x6E\x67\x74\x68","\x6E\x6F\x6C\x69\x6D\x69\x74","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x6F\x72\x64\x65\x72","\x73\x6F\x72\x74","\x77\x68\x65\x72\x65","\x70\x69\x63\x6B","\x64\x61\x79","\x61\x64\x64","\x6D\x65\x72\x67\x65","\x66\x69\x6C\x74\x65\x72","\x25","\x6D\x61\x70","\x6F\x70\x74\x69\x6F\x6E\x73","\x63\x61\x74\x63\x68","\x72\x6F\x77\x73","\x69\x6E\x63\x6C\x75\x64\x65\x41\x6C\x6C","\x69\x6E\x63\x6C\x75\x64\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x64\x65\x73\x63\x72\x69\x62\x65"];_0x6634[0];var jsonpatch=require(_0x6634[1]);var rp=require(_0x6634[2]);var moment=require(_0x6634[3]);var BPromise=require(_0x6634[4]);var Mustache=require(_0x6634[5]);var util=require(_0x6634[6]);var path=require(_0x6634[7]);var sox=require(_0x6634[8]);var csv=require(_0x6634[9]);var ejs=require(_0x6634[10]);var fs=require(_0x6634[11]);var _=require(_0x6634[12]);var squel=require(_0x6634[13]);var crypto=require(_0x6634[14]);var jsforce=require(_0x6634[15]);var deskjs=require(_0x6634[16]);var toCsv=require(_0x6634[9]);var querystring=require(_0x6634[17]);var Papa=require(_0x6634[18]);var qs=require(_0x6634[19]);var logger=require(_0x6634[21])(_0x6634[20]);var utils=require(_0x6634[22]);var config=require(_0x6634[23]);var db=require(_0x6634[25])[_0x6634[24]];function respondWithStatusCode(_0xf044x1a,_0xf044x1b){_0xf044x1b= _0xf044x1b|| 204;return function(_0xf044x1c){if(_0xf044x1c){return _0xf044x1a[_0x6634[26]](_0xf044x1b)};return _0xf044x1a[_0x6634[28]](_0xf044x1b)[_0x6634[27]]()}}function respondWithResult(_0xf044x1a,_0xf044x1b){_0xf044x1b= _0xf044x1b|| 200;return function(_0xf044x1c){if(_0xf044x1c){return _0xf044x1a[_0x6634[28]](_0xf044x1b)[_0x6634[29]](_0xf044x1c)}}}function respondWithFilteredResult(_0xf044x1a,_0xf044x1f){return function(_0xf044x1c){if(_0xf044x1c){var _0xf044x20=_0xf044x1c[_0x6634[30]],_0xf044x21=_0xf044x1f[_0x6634[31]],_0xf044x22=_0xf044x1f[_0x6634[31]]+ _0xf044x1f[_0x6634[32]],_0xf044x1b;if(_0xf044x22>= _0xf044x20){_0xf044x22= _0xf044x20;_0xf044x1b= 200}else {_0xf044x1b= 206};_0xf044x1a[_0x6634[28]](_0xf044x1b);return _0xf044x1a[_0x6634[36]](_0x6634[33],_0xf044x21+ _0x6634[34]+ _0xf044x22+ _0x6634[35]+ _0xf044x20)[_0x6634[29]](_0xf044x1c)};return null}}function patchUpdates(_0xf044x24){return function(_0xf044x1c){try{jsonpatch[_0x6634[37]](_0xf044x1c,_0xf044x24,true)}catch(err){return BPromise[_0x6634[38]](err)};return _0xf044x1c[_0x6634[39]]()}}function saveUpdates(_0xf044x26,_0xf044x1b){return function(_0xf044x1c){if(_0xf044x1c){return _0xf044x1c[_0x6634[41]](_0xf044x26)[_0x6634[40]](function(_0xf044x27){return _0xf044x27})};return null}}function removeEntity(_0xf044x1a,_0xf044x1b){return function(_0xf044x1c){if(_0xf044x1c){return _0xf044x1c[_0x6634[42]]()[_0x6634[40]](function(){_0xf044x1a[_0x6634[28]](204)[_0x6634[27]]()})}}}function handleEntityNotFound(_0xf044x1a,_0xf044x1b){return function(_0xf044x1c){if(!_0xf044x1c){_0xf044x1a[_0x6634[26]](404)};return _0xf044x1c}}function handleError(_0xf044x1a,_0xf044x1b){_0xf044x1b= _0xf044x1b|| 500;return function(_0xf044x2b){logger[_0x6634[44]](_0xf044x2b[_0x6634[43]]);if(_0xf044x2b[_0x6634[45]]){delete _0xf044x2b[_0x6634[45]]};_0xf044x1a[_0x6634[28]](_0xf044x1b)[_0x6634[46]](_0xf044x2b)}}exports[_0x6634[47]]= function(_0xf044x2c,_0xf044x1a){var _0xf044x1f={},_0xf044x2d={},_0xf044x2e={count:0,rows:[]};_0xf044x2d[_0x6634[48]]= _[_0x6634[51]](db[_0x6634[50]][_0x6634[49]]);var _0xf044x2f={dateStart:_0xf044x2c[_0x6634[53]][_0x6634[52]],dateEnd:_0xf044x2c[_0x6634[53]][_0x6634[54]]};delete _0xf044x2c[_0x6634[53]][_0x6634[52]];delete _0xf044x2c[_0x6634[53]][_0x6634[54]];_0xf044x2d[_0x6634[53]]= _[_0x6634[51]](_0xf044x2c[_0x6634[53]]);_0xf044x2d[_0x6634[55]]= _[_0x6634[56]](_0xf044x2d[_0x6634[48]],_0xf044x2d[_0x6634[53]]);_0xf044x1f[_0x6634[57]]= _[_0x6634[56]](_0xf044x2d[_0x6634[48]],qs[_0x6634[58]](_0xf044x2c[_0x6634[53]][_0x6634[58]]));_0xf044x1f[_0x6634[57]]= (_0xf044x1f[_0x6634[57]][_0x6634[59]])?_0xf044x1f[_0x6634[57]]:_0xf044x2d[_0x6634[48]];if(!_0xf044x2c[_0x6634[53]][_0x6634[61]](_0x6634[60])){_0xf044x1f[_0x6634[32]]= qs[_0x6634[32]](_0xf044x2c[_0x6634[53]][_0x6634[32]]);_0xf044x1f[_0x6634[31]]= qs[_0x6634[31]](_0xf044x2c[_0x6634[53]][_0x6634[31]])};_0xf044x1f[_0x6634[62]]= qs[_0x6634[63]](_0xf044x2c[_0x6634[53]][_0x6634[63]]);_0xf044x1f[_0x6634[64]]= qs[_0x6634[55]](_[_0x6634[65]](_0xf044x2c[_0x6634[53]],_0xf044x2d[_0x6634[55]]));if(_0xf044x2f[_0x6634[52]]){if(_0xf044x2f[_0x6634[54]]){_0xf044x2f[_0x6634[54]]= moment(_0xf044x2f[_0x6634[54]])[_0x6634[67]](1,_0x6634[66])}else {_0xf044x2f[_0x6634[54]]= moment(_0xf044x2f[_0x6634[52]])[_0x6634[67]](1,_0x6634[66])};_[_0x6634[68]](_0xf044x1f[_0x6634[64]],{createdAt:{$gte:_0xf044x2f[_0x6634[52]],$lte:_0xf044x2f[_0x6634[54]]}})};if(_0xf044x2c[_0x6634[53]][_0x6634[69]]){_0xf044x1f[_0x6634[64]]= _[_0x6634[68]](_0xf044x1f[_0x6634[64]],{$or:_[_0x6634[71]](_0xf044x1f[_0x6634[57]],function(_0xf044x30){var _0xf044x2e={};_0xf044x2e[_0xf044x30]= {$like:_0x6634[70]+ _0xf044x2c[_0x6634[53]][_0x6634[69]]+ _0x6634[70]};return _0xf044x2e})})};_0xf044x1f= _[_0x6634[68]]({},_0xf044x1f,_0xf044x2c[_0x6634[72]]);var _0xf044x31={where:_0xf044x1f[_0x6634[64]]};return db[_0x6634[50]][_0x6634[30]](_0xf044x31)[_0x6634[40]](function(_0xf044x20){_0xf044x2e[_0x6634[30]]= _0xf044x20;if(_0xf044x2c[_0x6634[53]][_0x6634[75]]){_0xf044x1f[_0x6634[76]]= [{all:true}]};return db[_0x6634[50]][_0x6634[77]](_0xf044x1f)})[_0x6634[40]](function(_0xf044x32){_0xf044x2e[_0x6634[74]]= _0xf044x32;return _0xf044x2e})[_0x6634[40]](respondWithFilteredResult(_0xf044x1a,_0xf044x1f))[_0x6634[73]](handleError(_0xf044x1a,null))};exports[_0x6634[78]]= function(_0xf044x2c,_0xf044x1a){var _0xf044x1f={raw:true,where:{id:_0xf044x2c[_0x6634[80]][_0x6634[79]]}},_0xf044x2d={};_0xf044x2d[_0x6634[48]]= _[_0x6634[51]](db[_0x6634[50]][_0x6634[49]]);_0xf044x2d[_0x6634[53]]= _[_0x6634[51]](_0xf044x2c[_0x6634[53]]);_0xf044x2d[_0x6634[55]]= _[_0x6634[56]](_0xf044x2d[_0x6634[48]],_0xf044x2d[_0x6634[53]]);_0xf044x1f[_0x6634[57]]= _[_0x6634[56]](_0xf044x2d[_0x6634[48]],qs[_0x6634[58]](_0xf044x2c[_0x6634[53]][_0x6634[58]]));_0xf044x1f[_0x6634[57]]= (_0xf044x1f[_0x6634[57]][_0x6634[59]])?_0xf044x1f[_0x6634[57]]:_0xf044x2d[_0x6634[48]];if(_0xf044x2c[_0x6634[53]][_0x6634[75]]){_0xf044x1f[_0x6634[76]]= [{all:true}]};_0xf044x1f= _[_0x6634[68]]({},_0xf044x1f,_0xf044x2c[_0x6634[72]]);return db[_0x6634[50]][_0x6634[81]](_0xf044x1f)[_0x6634[40]](handleEntityNotFound(_0xf044x1a,null))[_0x6634[40]](respondWithResult(_0xf044x1a,null))[_0x6634[73]](handleError(_0xf044x1a,null))};exports[_0x6634[82]]= function(_0xf044x2c,_0xf044x1a){return db[_0x6634[50]][_0x6634[82]](_0xf044x2c[_0x6634[83]],{})[_0x6634[40]](respondWithResult(_0xf044x1a,201))[_0x6634[73]](handleError(_0xf044x1a,null))};exports[_0x6634[41]]= function(_0xf044x2c,_0xf044x1a){if(_0xf044x2c[_0x6634[83]][_0x6634[79]]){delete _0xf044x2c[_0x6634[83]][_0x6634[79]]};return db[_0x6634[50]][_0x6634[81]]({where:{id:_0xf044x2c[_0x6634[80]][_0x6634[79]]}})[_0x6634[40]](handleEntityNotFound(_0xf044x1a,null))[_0x6634[40]](saveUpdates(_0xf044x2c[_0x6634[83]],null))[_0x6634[40]](respondWithResult(_0xf044x1a,null))[_0x6634[73]](handleError(_0xf044x1a,null))};exports[_0x6634[42]]= function(_0xf044x2c,_0xf044x1a){return db[_0x6634[50]][_0x6634[81]]({where:{id:_0xf044x2c[_0x6634[80]][_0x6634[79]]}})[_0x6634[40]](handleEntityNotFound(_0xf044x1a,null))[_0x6634[40]](removeEntity(_0xf044x1a,null))[_0x6634[73]](handleError(_0xf044x1a,null))};exports[_0x6634[84]]= function(_0xf044x2c,_0xf044x1a){return db[_0x6634[50]][_0x6634[84]]()[_0x6634[40]](respondWithResult(_0xf044x1a,null))[_0x6634[73]](handleError(_0xf044x1a,null))}
\ No newline at end of file