118656a1527010296aae9514c98aede0cc6effee
[motion2.git] / server / api / cmHopper / cmHopper.rpc.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 _0x749a=['voicePause','length','UserId','push','update','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','transaction','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','literal','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','availableAgentsIds','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','NOW()','name','CmList','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','findAll','options','where','attributes','limit','include','map','model','then','stringify','catch','error','message','CmHopper','find','raw','ShowCmHopper','CreateCmHopper','create','body','info','debug','UpdateCmHopper','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','order','LOCK','UPDATE','Contact','keys','User','Agent'];(function(_0x3512c3,_0x346843){var _0x3b2842=function(_0x49341b){while(--_0x49341b){_0x3512c3['push'](_0x3512c3['shift']());}};_0x3b2842(++_0x346843);}(_0x749a,0x73));var _0xa749=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x749a[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xa749('0x0'));var util=require(_0xa749('0x1'));var moment=require(_0xa749('0x2'));var BPromise=require(_0xa749('0x3'));var db=require(_0xa749('0x4'))['db'];var logger=require(_0xa749('0x5'))(_0xa749('0x6'));exports[_0xa749('0x7')]=function(_0x4af66b){var _0x253241=this;return new Promise(function(_0x5a9e39,_0x35fe9f){return db['CmHopper'][_0xa749('0x8')]({'raw':_0x4af66b['options']?_0x4af66b[_0xa749('0x9')]['raw']===undefined?!![]:![]:!![],'where':_0x4af66b[_0xa749('0x9')]?_0x4af66b['options'][_0xa749('0xa')]||null:null,'attributes':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xc')]||null:null,'include':_0x4af66b[_0xa749('0x9')]?_0x4af66b[_0xa749('0x9')][_0xa749('0xd')]?_['map'](_0x4af66b[_0xa749('0x9')][_0xa749('0xd')],function(_0x6b3bbc){return{'model':db[_0x6b3bbc['model']],'as':_0x6b3bbc['as'],'attributes':_0x6b3bbc[_0xa749('0xb')],'include':_0x6b3bbc[_0xa749('0xd')]?_[_0xa749('0xe')](_0x6b3bbc[_0xa749('0xd')],function(_0x713c50){return{'model':db[_0x713c50[_0xa749('0xf')]],'as':_0x713c50['as'],'attributes':_0x713c50[_0xa749('0xb')],'include':_0x713c50[_0xa749('0xd')]?_['map'](_0x713c50['include'],function(_0x58e5b9){return{'model':db[_0x58e5b9['model']],'as':_0x58e5b9['as'],'attributes':_0x58e5b9['attributes']};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x1daa0a){logger['info'](_0xa749('0x7'),_0x4af66b);logger['debug'](_0xa749('0x7'),_0x4af66b,JSON[_0xa749('0x11')](_0x1daa0a));_0x5a9e39(_0x1daa0a);})[_0xa749('0x12')](function(_0x99271a){logger[_0xa749('0x13')]('GetCmHopper',_0x99271a['message'],_0x4af66b);_0x35fe9f(_0x253241[_0xa749('0x13')](0x1f4,_0x99271a[_0xa749('0x14')]));});});};exports['ShowCmHopper']=function(_0x2c5928){var _0x157946=this;return new Promise(function(_0x5b6575,_0x1a7f0a){return db[_0xa749('0x15')][_0xa749('0x16')]({'raw':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x2c5928[_0xa749('0x9')]?_0x2c5928[_0xa749('0x9')]['attributes']||null:null,'include':_0x2c5928['options']?_0x2c5928['options'][_0xa749('0xd')]?_['map'](_0x2c5928['options'][_0xa749('0xd')],function(_0x1791ee){return{'model':db[_0x1791ee[_0xa749('0xf')]],'as':_0x1791ee['as'],'attributes':_0x1791ee[_0xa749('0xb')],'include':_0x1791ee['include']?_[_0xa749('0xe')](_0x1791ee[_0xa749('0xd')],function(_0xfd21df){return{'model':db[_0xfd21df[_0xa749('0xf')]],'as':_0xfd21df['as'],'attributes':_0xfd21df[_0xa749('0xb')],'include':_0xfd21df['include']?_['map'](_0xfd21df['include'],function(_0x43f0d6){return{'model':db[_0x43f0d6[_0xa749('0xf')]],'as':_0x43f0d6['as'],'attributes':_0x43f0d6[_0xa749('0xb')]};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x4f736a){logger['info'](_0xa749('0x18'),_0x2c5928);logger['debug'](_0xa749('0x18'),_0x2c5928,JSON[_0xa749('0x11')](_0x4f736a));_0x5b6575(_0x4f736a);})[_0xa749('0x12')](function(_0x13828b){logger[_0xa749('0x13')]('ShowCmHopper',_0x13828b[_0xa749('0x14')],_0x2c5928);_0x1a7f0a(_0x157946[_0xa749('0x13')](0x1f4,_0x13828b['message']));});});};exports[_0xa749('0x19')]=function(_0x3bd883){var _0xbfe527=this;return new Promise(function(_0x51a239,_0x273b0d){return db[_0xa749('0x15')][_0xa749('0x1a')](_0x3bd883[_0xa749('0x1b')],{'raw':_0x3bd883['options']?_0x3bd883['options'][_0xa749('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x364267){logger[_0xa749('0x1c')]('CreateCmHopper',_0x3bd883);logger[_0xa749('0x1d')](_0xa749('0x19'),_0x3bd883,JSON[_0xa749('0x11')](_0x364267));_0x51a239(_0x364267);})[_0xa749('0x12')](function(_0x5dd4be){logger['error'](_0xa749('0x19'),_0x5dd4be[_0xa749('0x14')],_0x3bd883);_0x273b0d(_0xbfe527['error'](0x1f4,_0x5dd4be[_0xa749('0x14')]));});});};exports[_0xa749('0x1e')]=function(_0x24fb19){var _0x2c5d7c=this;return new Promise(function(_0x5194e7,_0xebaed5){return db[_0xa749('0x15')]['update'](_0x24fb19[_0xa749('0x1b')],{'raw':_0x24fb19[_0xa749('0x9')]?_0x24fb19['options'][_0xa749('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')]['attributes']||null:null,'limit':_0x24fb19[_0xa749('0x9')]?_0x24fb19[_0xa749('0x9')][_0xa749('0xc')]||null:null})['then'](function(_0xa11e4c){logger[_0xa749('0x1c')](_0xa749('0x1e'),_0x24fb19);logger[_0xa749('0x1c')](_0xa749('0x1f'),JSON['stringify'](_0x24fb19[_0xa749('0x9')]['where']),_0x24fb19[_0xa749('0x1b')][_0xa749('0x20')]);logger[_0xa749('0x1d')](_0xa749('0x1e'),_0x24fb19,JSON[_0xa749('0x11')](_0xa11e4c));_0x5194e7(_0xa11e4c);})[_0xa749('0x12')](function(_0x10ffa2){logger[_0xa749('0x13')](_0xa749('0x1e'),_0x10ffa2[_0xa749('0x14')],_0x24fb19);_0xebaed5(_0x2c5d7c[_0xa749('0x13')](0x1f4,_0x10ffa2[_0xa749('0x14')]));});});};exports[_0xa749('0x21')]=function(_0x366911){var _0x1ec3fa=this;return new Promise(function(_0x144985,_0x21d1ed){return db[_0xa749('0x15')][_0xa749('0x22')]({'where':_0x366911['options']?_0x366911[_0xa749('0x9')][_0xa749('0xa')]||null:null})[_0xa749('0x10')](function(_0x4e37b2){logger[_0xa749('0x1c')](_0xa749('0x21'),_0x366911);logger[_0xa749('0x1d')](_0xa749('0x21'),_0x366911,JSON[_0xa749('0x11')](_0x4e37b2));_0x144985(_0x4e37b2);})['catch'](function(_0x1935a5){logger[_0xa749('0x13')](_0xa749('0x21'),_0x1935a5['message'],_0x366911);_0x21d1ed(_0x1ec3fa['error'](0x1f4,_0x1935a5[_0xa749('0x14')]));});});};exports['GetContactDialer']=function(_0x472407){var _0x42ed79=this;return new Promise(function(_0x2f4bd6,_0x42deef){return db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(_0x4b9961){return db[_0xa749('0x25')]['transaction'](function(_0x9b547a){return db[_0xa749('0x15')][_0xa749('0x8')]({'where':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x472407[_0xa749('0x9')]?_0x472407[_0xa749('0x9')][_0xa749('0xc')]||null:null,'order':_0x472407[_0xa749('0x9')]?_0x472407['options'][_0xa749('0x26')]||null:null,'transaction':_0x9b547a,'lock':_0x9b547a[_0xa749('0x27')][_0xa749('0x28')],'include':[{'model':db['CmContact'],'as':_0xa749('0x29'),'attributes':_[_0xa749('0x2a')](_0x4b9961)},{'model':db[_0xa749('0x2b')],'as':_0xa749('0x2c'),'attributes':['id','name',_0xa749('0x2d')]}]})[_0xa749('0x10')](function(_0x2a8254){var _0x348546=[];var _0x1a72f5=[];for(var _0x50d7b2=0x0;_0x50d7b2<_0x2a8254[_0xa749('0x2e')];_0x50d7b2+=0x1){var _0x1c961c=_0x2a8254[_0x50d7b2][_0xa749('0x2f')];if(_0x1c961c===null){_0x348546[_0xa749('0x30')](_0x2a8254[_0x50d7b2][_0xa749('0x31')](_0x472407[_0xa749('0x1b')],{'transaction':_0x9b547a}));}else if(!_0x1a72f5[_0xa749('0x32')](_0x1c961c)){_0x1a72f5['push'](_0x1c961c);_0x348546[_0xa749('0x30')](_0x2a8254[_0x50d7b2][_0xa749('0x31')](_0x472407[_0xa749('0x1b')],{'transaction':_0x9b547a}));}}return BPromise[_0xa749('0x33')](_0x348546);});})[_0xa749('0x10')](function(_0x41d611){logger[_0xa749('0x1c')](_0xa749('0x34'),_0x472407);if(_0x41d611[_0xa749('0x2e')]>0x0){logger['info'](_0xa749('0x35'),_0x41d611[0x0]['dataValues']['id'],_0x41d611[0x0][_0xa749('0x36')]['ContactId'],_0x41d611[0x0]['dataValues'][_0xa749('0x20')]);}logger['debug'](_0xa749('0x34'),_0x472407,JSON[_0xa749('0x11')](_0x41d611));_0x2f4bd6(_0x41d611);})[_0xa749('0x12')](function(_0x5b260e){logger[_0xa749('0x13')](_0xa749('0x34'),_0x5b260e[_0xa749('0x14')],_0x472407);_0x42deef(_0x42ed79[_0xa749('0x13')](0x1f4,_0x5b260e[_0xa749('0x14')]));});});});};exports['MoveContactManagedDialer']=function(_0x3e55e6){var _0x161708=this;return new Promise(function(_0x1104a6,_0x45ff94){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x33e7bb){return db['CmHopperFinal'][_0xa749('0x1a')](_0x3e55e6[_0xa749('0x1b')],{'raw':_0x3e55e6['options']?_0x3e55e6[_0xa749('0x9')]['raw']===undefined?!![]:![]:!![],'transaction':_0x33e7bb})[_0xa749('0x10')](function(){logger['info'](_0xa749('0x38'),JSON['stringify'](_0x3e55e6[_0xa749('0x9')][_0xa749('0xa')]),_0x3e55e6[_0xa749('0x9')][_0xa749('0xa')][_0xa749('0x20')]);return db[_0xa749('0x15')]['destroy']({'where':_0x3e55e6[_0xa749('0x9')]?_0x3e55e6[_0xa749('0x9')]['where']||null:null,'transaction':_0x33e7bb});});})[_0xa749('0x10')](function(_0x28c437){logger['info'](_0xa749('0x39'),_0x3e55e6);logger[_0xa749('0x1d')](_0xa749('0x39'),_0x3e55e6,JSON[_0xa749('0x11')](_0x28c437));_0x1104a6(_0x28c437);})[_0xa749('0x12')](function(_0x587840){logger[_0xa749('0x13')](_0xa749('0x39'),_0x587840[_0xa749('0x14')],_0x3e55e6);_0x45ff94(_0x161708[_0xa749('0x13')](0x1f4,_0x587840['message']));});});};exports[_0xa749('0x3a')]=function(_0x5d5f07){var _0x287a74=this;return new Promise(function(_0x41e41d,_0x29dda0){return db['CmHopper'][_0xa749('0x8')]({'raw':_0x5d5f07[_0xa749('0x9')]?_0x5d5f07[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x5d5f07['options']?_0x5d5f07['options'][_0xa749('0xa')]||null:null,'attributes':[[db[_0xa749('0x25')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xa749('0x3b')](_0xa749('0x3c')+util[_0xa749('0x3d')]('\x22%s\x22',moment()['format'](_0xa749('0x3e')))+'\x20,\x201,\x20null'))),_0xa749('0x3f')]]})[_0xa749('0x10')](function(_0x337066){logger[_0xa749('0x1c')](_0xa749('0x3a'),_0x5d5f07);logger['debug'](_0xa749('0x3a'),_0x5d5f07,JSON[_0xa749('0x11')](_0x337066));_0x41e41d(_0x337066);})[_0xa749('0x12')](function(_0x5c9be1){logger[_0xa749('0x13')](_0xa749('0x3a'),_0x5c9be1[_0xa749('0x14')],_0x5d5f07);_0x29dda0(_0x287a74[_0xa749('0x13')](0x1f4,_0x5c9be1[_0xa749('0x14')]));});});};exports[_0xa749('0x40')]=function(_0x33cadc){var _0x1b6b71=this;return new Promise(function(_0x4363c9,_0x539eaa){return db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x5bac4f){return db[_0xa749('0x15')]['findAll']({'where':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')][_0xa749('0xa')]||null:null,'attributes':_0x33cadc['options']?_0x33cadc[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':0x1,'order':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')]['order']||null:null,'group':db['CmHopper'][_0xa749('0x2f')],'transaction':_0x5bac4f,'lock':_0x5bac4f[_0xa749('0x27')]['UPDATE'],'include':_0x33cadc[_0xa749('0x9')]?_0x33cadc[_0xa749('0x9')]['include']?_[_0xa749('0xe')](_0x33cadc[_0xa749('0x9')][_0xa749('0xd')],function(_0x112a77){return{'model':db[_0x112a77['model']],'as':_0x112a77['as'],'attributes':_0x112a77[_0xa749('0xb')],'include':_0x112a77[_0xa749('0xd')]?_[_0xa749('0xe')](_0x112a77[_0xa749('0xd')],function(_0x43bac9){return{'model':db[_0x43bac9[_0xa749('0xf')]],'as':_0x43bac9['as'],'attributes':_0x43bac9[_0xa749('0xb')],'include':_0x43bac9[_0xa749('0xd')]?_[_0xa749('0xe')](_0x43bac9[_0xa749('0xd')],function(_0x2c3c99){return{'model':db[_0x2c3c99[_0xa749('0xf')]],'as':_0x2c3c99['as'],'attributes':_0x2c3c99['attributes']};}):[]};}):[]};}):[]:[]})[_0xa749('0x10')](function(_0x60fb01){var _0xd76495=[];for(var _0xc92df=0x0;_0xc92df<_0x60fb01['length'];_0xc92df+=0x1){_0xd76495['push'](_0x60fb01[_0xc92df][_0xa749('0x31')](_0x33cadc[_0xa749('0x1b')],{'transaction':_0x5bac4f}));}return BPromise['all'](_0xd76495);});})[_0xa749('0x10')](function(_0x1743f8){logger[_0xa749('0x1c')]('GetContactRecallMe',_0x33cadc);logger[_0xa749('0x1d')](_0xa749('0x40'),_0x33cadc,JSON['stringify'](_0x1743f8));_0x4363c9(_0x1743f8);})[_0xa749('0x12')](function(_0x505a06){logger[_0xa749('0x13')]('GetContactRecallMe',_0x505a06['message'],_0x33cadc);_0x539eaa(_0x1b6b71[_0xa749('0x13')](0x1f4,_0x505a06[_0xa749('0x14')]));});});});};exports[_0xa749('0x41')]=function(_0x4fcceb){var _0xc25360=this;return new Promise(function(_0x52ff69,_0x31e45a){db[_0xa749('0x23')][_0xa749('0x24')]()[_0xa749('0x10')](function(_0x2ab17e){return db[_0xa749('0x15')][_0xa749('0x8')]({'raw':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')][_0xa749('0x17')]===undefined?!![]:![]:!![],'where':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')]['where']||null:null,'attributes':_0x4fcceb['options']?_0x4fcceb[_0xa749('0x9')][_0xa749('0xb')]||null:null,'limit':_0x4fcceb['options']?_0x4fcceb[_0xa749('0x9')][_0xa749('0xc')]||null:null,'include':_0x4fcceb[_0xa749('0x9')]?_0x4fcceb[_0xa749('0x9')][_0xa749('0xd')]?_['map'](_0x4fcceb['options'][_0xa749('0xd')],function(_0x539cd2){return{'model':db[_0x539cd2[_0xa749('0xf')]],'as':_0x539cd2['as'],'attributes':_0x539cd2['as']===_0xa749('0x29')?_[_0xa749('0x2a')](_0x2ab17e):_0x539cd2[_0xa749('0xb')],'include':_0x539cd2['include']?_['map'](_0x539cd2['include'],function(_0x3ecc0c){return{'model':db[_0x3ecc0c[_0xa749('0xf')]],'as':_0x3ecc0c['as'],'attributes':_0x3ecc0c[_0xa749('0xb')],'include':_0x3ecc0c[_0xa749('0xd')]?_[_0xa749('0xe')](_0x3ecc0c[_0xa749('0xd')],function(_0x4ba8b6){return{'model':db[_0x4ba8b6['model']],'as':_0x4ba8b6['as'],'attributes':_0x4ba8b6[_0xa749('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd34272){logger[_0xa749('0x1c')](_0xa749('0x7'),_0x4fcceb);logger[_0xa749('0x1d')](_0xa749('0x7'),_0x4fcceb,JSON[_0xa749('0x11')](_0xd34272));_0x52ff69(_0xd34272);})[_0xa749('0x12')](function(_0x51631b){logger[_0xa749('0x13')](_0xa749('0x7'),_0x51631b[_0xa749('0x14')],_0x4fcceb);_0x31e45a(_0xc25360[_0xa749('0x13')](0x1f4,_0x51631b[_0xa749('0x14')]));});});});};exports['GetContactByPhone']=function(_0x4e3d47){var _0x35af39=this;return new Promise(function(_0x46f5ee,_0x4ce9ad){return db[_0xa749('0x23')][_0xa749('0x42')]({'raw':!![],'where':{'phone':_0x4e3d47[_0xa749('0x9')][_0xa749('0xa')][_0xa749('0x43')]},'attributes':['id',_0xa749('0x44')],'order':[['id','DESC']]})[_0xa749('0x10')](function(_0x10da89){logger[_0xa749('0x1c')](_0xa749('0x45'),_0x4e3d47);logger[_0xa749('0x1d')]('getContactByPhone',_0x4e3d47,JSON['stringify'](_0x10da89));_0x46f5ee(_0x10da89);})[_0xa749('0x12')](function(_0x31ef26){logger[_0xa749('0x13')](_0xa749('0x45'),_0x31ef26['message'],_0x4e3d47);_0x4ce9ad(_0x35af39[_0xa749('0x13')](0x1f4,_0x31ef26[_0xa749('0x14')]));});});};exports['ResetActiveCalls']=function(_0x29f180){var _0x2dcfa9=this;return new Promise(function(_0x2b2991,_0x2d2c47){return db[_0xa749('0x25')][_0xa749('0x37')](function(_0x49a353){var _0x2be106=_0x29f180[_0xa749('0x9')]&&_0x29f180[_0xa749('0x9')][_0xa749('0xa')]?_0x29f180[_0xa749('0x9')]['where']:{};return db[_0xa749('0x15')][_0xa749('0x31')](_0x29f180[_0xa749('0x1b')],{'where':_0x2be106,'transaction':_0x49a353})['then'](function(_0x2dda87){logger[_0xa749('0x1c')](_0xa749('0x46'),_0x29f180);logger[_0xa749('0x1d')](_0xa749('0x46'),_0x29f180,JSON[_0xa749('0x11')](_0x2dda87));_0x2b2991(_0x2dda87);})[_0xa749('0x12')](function(_0xa6fbcd){logger[_0xa749('0x13')](_0xa749('0x46'),_0xa6fbcd[_0xa749('0x14')],_0x29f180);_0x2d2c47(_0x2dcfa9[_0xa749('0x13')](0x1f4,_0xa6fbcd[_0xa749('0x14')]));});});});};exports[_0xa749('0x47')]=function(_0xf1bb57){var _0x2e747c=this;var _0x26c76d=_0xf1bb57[_0xa749('0x1b')][_0xa749('0xa')][_0xa749('0x48')];var _0xc3147=_0xf1bb57[_0xa749('0x1b')]['where'][_0xa749('0x49')];var _0x4daaff=_0xf1bb57[_0xa749('0x1b')][_0xa749('0xa')][_0xa749('0x4a')];return new Promise(function(_0xe5549c,_0x1acf10){return db[_0xa749('0x15')][_0xa749('0x8')]({'where':{'voiceQueueId':{'$in':_0x26c76d},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xa749('0x3b')](_0xa749('0x4b')+_0xc3147+_0xa749('0x4c')),'$gt':db[_0xa749('0x25')]['literal'](_0xa749('0x4d'))}},'UserId':{'$in':_0x4daaff}},'include':[{'model':db[_0xa749('0x23')],'as':_0xa749('0x29')},{'model':db['User'],'as':_0xa749('0x2c'),'attributes':['id',_0xa749('0x4e'),_0xa749('0x2d')]},{'model':db[_0xa749('0x4f')],'as':'List'}]})[_0xa749('0x10')](function(_0x4d0eef){if(_0x4d0eef[_0xa749('0x2e')]>0x0){return db['sequelize'][_0xa749('0x37')](function(_0x37ce24){return db[_0xa749('0x15')][_0xa749('0x31')]({'recallmeNotifiedDate':db['sequelize'][_0xa749('0x3b')](_0xa749('0x4d'))},{'where':{'id':{'$in':_[_0xa749('0xe')](_0x4d0eef,'id')}},'transaction':_0x37ce24})[_0xa749('0x10')](function(){_0xe5549c(_0x4d0eef);})['catch'](function(_0x19e6c7){logger['error'](_0xa749('0x47'),_0x19e6c7[_0xa749('0x14')],_0xf1bb57);_0x1acf10(_0x2e747c[_0xa749('0x13')](0x1f4,_0x19e6c7[_0xa749('0x14')]));});})[_0xa749('0x12')](function(_0x5c01b2){logger[_0xa749('0x13')]('CmHopperHandlePreviewRecallNotifications',_0x5c01b2[_0xa749('0x14')],_0xf1bb57);_0x1acf10(_0x2e747c[_0xa749('0x13')](0x1f4,_0x5c01b2[_0xa749('0x14')]));});}else{_0xe5549c(_0x4d0eef);}});});};