Built motion from commit f7831a8.|0.0.80
[motion.git] / server / api / report_call / report_call.controller.js
1 var _0xf16a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C\x48\x69\x73\x74\x6F\x72\x79","\x68\x69\x73\x74\x6F\x72\x79","\x73\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x6A\x73\x6F\x6E","\x65\x6E\x64","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x64\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78","\x63\x61\x74\x63\x68","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x66\x69\x6E\x64\x42\x79\x49\x64","\x6D\x61\x6E\x75\x61\x6C\x4F\x75\x74\x62\x6F\x75\x6E\x64","\x64\x61\x74\x61","\x6C\x6F\x67","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x63\x6F\x75\x6E\x74","\x6D\x61\x6E\x75\x61\x6C\x4F\x75\x74\x62\x6F\x75\x6E\x64\x47\x6C\x6F\x62\x61\x6C\x44\x75\x72\x61\x74\x69\x6F\x6E","\x76\x61\x6C\x75\x65","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x53\x55\x4D\x28\x64\x75\x72\x61\x74\x69\x6F\x6E\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x20\x57\x48\x45\x52\x45\x20\x74\x79\x70\x65\x3D\x22\x6F\x75\x74\x62\x6F\x75\x6E\x64\x22","\x53\x45\x4C\x45\x43\x54","\x51\x75\x65\x72\x79\x54\x79\x70\x65\x73","\x71\x75\x65\x72\x79","\x6D\x61\x6E\x75\x61\x6C\x4F\x75\x74\x62\x6F\x75\x6E\x64\x41\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x53\x45\x4C\x45\x43\x54\x20\x53\x45\x43\x5F\x54\x4F\x5F\x54\x49\x4D\x45\x28\x52\x4F\x55\x4E\x44\x28\x41\x56\x47\x28\x64\x75\x72\x61\x74\x69\x6F\x6E\x29\x2C\x20\x30\x29\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x20\x57\x48\x45\x52\x45\x20\x74\x79\x70\x65\x3D\x22\x6F\x75\x74\x62\x6F\x75\x6E\x64\x22","\x6D\x61\x6E\x75\x61\x6C\x4F\x75\x74\x62\x6F\x75\x6E\x64\x41\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x6D\x61\x6E\x75\x61\x6C\x4F\x75\x74\x62\x6F\x75\x6E\x64\x41\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x53\x45\x4C\x45\x43\x54\x20\x52\x4F\x55\x4E\x44\x28\x53\x55\x4D\x28\x49\x46\x28\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E\x3D\x22\x41\x4E\x53\x57\x45\x52\x45\x44\x22\x2C\x20\x31\x2C\x20\x30\x29\x29\x20\x2F\x20\x43\x4F\x55\x4E\x54\x28\x2A\x29\x20\x2A\x20\x31\x30\x30\x2C\x20\x31\x29\x20\x61\x73\x20\x76\x61\x6C\x75\x65\x20\x46\x52\x4F\x4D\x20\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x20\x57\x48\x45\x52\x45\x20\x74\x79\x70\x65\x3D\x22\x6F\x75\x74\x62\x6F\x75\x6E\x64\x22","\x64\x65\x73\x63\x72\x69\x62\x65","\x63\x72\x65\x61\x74\x65","\x62\x6F\x64\x79","\x75\x70\x64\x61\x74\x65"];_0xf16a[0];var _=require(_0xf16a[1]);var sequelize=require(_0xf16a[3])[_0xf16a[2]];var ReportCall=require(_0xf16a[3])[_0xf16a[4]];var ReportCallHistory=require(_0xf16a[3])[_0xf16a[6]][_0xf16a[5]];function handleError(_0x3693x6,_0x3693x7){_0x3693x7=_0x3693x7||500;return function(_0x3693x8){_0x3693x6[_0xf16a[8]](_0x3693x7)[_0xf16a[7]](_0x3693x8)}}function responseWithResult(_0x3693x6,_0x3693x7){_0x3693x7=_0x3693x7||200;return function(_0x3693xa){if(_0x3693xa){_0x3693x6[_0xf16a[8]](_0x3693x7)[_0xf16a[9]](_0x3693xa)}}}function handleEntityNotFound(_0x3693x6){return function(_0x3693xa){if(!_0x3693xa){_0x3693x6[_0xf16a[8]](404)[_0xf16a[10]]();return null};return _0x3693xa}}function saveUpdates(_0x3693xd){return function(_0x3693xa){return _0x3693xa[_0xf16a[12]](_0x3693xd)[_0xf16a[11]](function(_0x3693xe){return _0x3693xe})}}function removeEntity(_0x3693x6){return function(_0x3693xa){if(_0x3693xa){return _0x3693xa[_0xf16a[13]]()[_0xf16a[11]](function(){_0x3693x6[_0xf16a[8]](204)[_0xf16a[10]]()})}}}exports[_0xf16a[14]]=function(_0x3693x10,_0x3693x6){ReportCall[_0xf16a[16]]()[_0xf16a[11]](responseWithResult(_0x3693x6))[_0xf16a[15]](handleError(_0x3693x6))};exports[_0xf16a[17]]=function(_0x3693x10,_0x3693x6){ReportCall[_0xf16a[20]](_0x3693x10[_0xf16a[19]][_0xf16a[18]])[_0xf16a[11]](handleEntityNotFound(_0x3693x6))[_0xf16a[11]](responseWithResult(_0x3693x6))[_0xf16a[15]](handleError(_0x3693x6))};exports[_0xf16a[21]]=function(_0x3693x10,_0x3693x6){return ReportCall[_0xf16a[25]]({where:{type:_0xf16a[24]}})[_0xf16a[11]](function(_0x3693x11){console[_0xf16a[23]](_0xf16a[22],_0x3693x11);return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]]({value:_0x3693x11})})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[26]]=function(_0x3693x10,_0x3693x6){return sequelize[_0xf16a[31]](_0xf16a[28],{type:sequelize[_0xf16a[30]][_0xf16a[29]]})[_0xf16a[11]](function(_0x3693x11){return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]]({value:_0x3693x11[0][_0xf16a[27]]})})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[32]]=function(_0x3693x10,_0x3693x6){return sequelize[_0xf16a[31]](_0xf16a[33],{type:sequelize[_0xf16a[30]][_0xf16a[29]]})[_0xf16a[11]](function(_0x3693x11){return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]]({value:_0x3693x11[0][_0xf16a[27]]})})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[34]]=function(_0x3693x10,_0x3693x6){return ReportCall[_0xf16a[25]]({where:{disposition:_0xf16a[35],type:_0xf16a[24]}})[_0xf16a[11]](function(_0x3693x11){return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]]({value:_0x3693x11})})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[36]]=function(_0x3693x10,_0x3693x6){return sequelize[_0xf16a[31]](_0xf16a[37],{type:sequelize[_0xf16a[30]][_0xf16a[29]]})[_0xf16a[11]](function(_0x3693x11){return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]]({value:_0x3693x11[0][_0xf16a[27]]})})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[38]]=function(_0x3693x10,_0x3693x6){return ReportCallHistory[_0xf16a[38]]()[_0xf16a[11]](function(_0x3693x12){return _0x3693x6[_0xf16a[8]](200)[_0xf16a[7]](_0x3693x12)})[_0xf16a[15]](function(_0x3693x8){return handleError(_0x3693x6,_0x3693x8)})};exports[_0xf16a[39]]=function(_0x3693x10,_0x3693x6){ReportCall[_0xf16a[39]](_0x3693x10[_0xf16a[40]])[_0xf16a[11]](responseWithResult(_0x3693x6,201))[_0xf16a[15]](handleError(_0x3693x6))};exports[_0xf16a[41]]=function(_0x3693x10,_0x3693x6){if(_0x3693x10[_0xf16a[40]][_0xf16a[18]]){delete _0x3693x10[_0xf16a[40]][_0xf16a[18]]};ReportCall[_0xf16a[20]](_0x3693x10[_0xf16a[19]][_0xf16a[18]])[_0xf16a[11]](handleEntityNotFound(_0x3693x6))[_0xf16a[11]](saveUpdates(_0x3693x10[_0xf16a[40]]))[_0xf16a[11]](responseWithResult(_0x3693x6))[_0xf16a[15]](handleError(_0x3693x6))};exports[_0xf16a[13]]=function(_0x3693x10,_0x3693x6){ReportCall[_0xf16a[20]](_0x3693x10[_0xf16a[19]][_0xf16a[18]])[_0xf16a[11]](handleEntityNotFound(_0x3693x6))[_0xf16a[11]](removeEntity(_0x3693x6))[_0xf16a[15]](handleError(_0x3693x6))}