1e5d47ae61ccbf5abfba5d46636658b4a9dbac4f
[motion2.git] / server / services / ami / rpc / cmHopperHistory.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x0bb5=['format','YYYY-MM-DD\x20HH:mm:ss','getVoiceQueueHopperHistory','GetVoiceQueueHopperHistory','day','endOf','GetCampaignHopperHistory','ivr','../client','moment','campaign','queue','Request','CreateCmHopperHistory','avgHandleTime','minutes'];(function(_0x34c505,_0x282385){var _0x255f48=function(_0x53dbe1){while(--_0x53dbe1){_0x34c505['push'](_0x34c505['shift']());}};_0x255f48(++_0x282385);}(_0x0bb5,0x148));var _0x50bb=function(_0x472980,_0x80f544){_0x472980=_0x472980-0x0;var _0x4f2ef8=_0x0bb5[_0x472980];return _0x4f2ef8;};'use strict';var client=require(_0x50bb('0x0'));var moment=require(_0x50bb('0x1'));exports['createHistory']=function(_0x5a12b6){return function(){_0x5a12b6[_0x50bb('0x2')]=_0x5a12b6[_0x50bb('0x3')];return client[_0x50bb('0x4')](_0x50bb('0x5'),{'body':_0x5a12b6,'log':_0x50bb('0x5')});};};exports[_0x50bb('0x6')]=function(_0x451b4c){return function(){return client[_0x50bb('0x4')]('AvgHandleTime',{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x451b4c,_0x50bb('0x7'))[_0x50bb('0x8')](_0x50bb('0x9')),moment()[_0x50bb('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]}},'raw':![]},'log':'GetCmHopperHistory'});};};exports[_0x50bb('0xa')]=function(_0x1c2174){return function(){return client[_0x50bb('0x4')](_0x50bb('0xb'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x50bb('0xc'))[_0x50bb('0x8')](_0x50bb('0x9')),moment()[_0x50bb('0xd')](_0x50bb('0xc'))[_0x50bb('0x8')](_0x50bb('0x9'))]},'campaigntype':'queue'},'raw':![]},'log':_0x50bb('0xb')});};};exports['getCampaignHopperHistory']=function(_0x283f04){return function(){return client[_0x50bb('0x4')](_0x50bb('0xe'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x50bb('0xc'))[_0x50bb('0x8')](_0x50bb('0x9')),moment()['endOf'](_0x50bb('0xc'))['format'](_0x50bb('0x9'))]},'campaigntype':_0x50bb('0xf')},'raw':![]},'log':_0x50bb('0xe')});};};