1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0xe923=['Sms','Voice','Whatsapp','all','lodash','./team.attributes','get','Queues','then','map','setDataValue','catch','exports','define','Fax','Mail','Openchannel'];(function(_0x1663ae,_0x10484a){var _0x30ffb8=function(_0x21e006){while(--_0x21e006){_0x1663ae['push'](_0x1663ae['shift']());}};_0x30ffb8(++_0x10484a);}(_0xe923,0x136));var _0x3e92=function(_0xcf69e4,_0x22359f){_0xcf69e4=_0xcf69e4-0x0;var _0x3ae183=_0xe923[_0xcf69e4];return _0x3ae183;};'use strict';var _=require(_0x3e92('0x0'));var attributes=require(_0x3e92('0x1'));function getQueuesByChannel(_0x4ca446,_0x562ecf){var _0x199224=_0x3e92('0x2')+_0x562ecf+_0x3e92('0x3');return _0x4ca446[_0x199224]()[_0x3e92('0x4')](function(_0x83eff4){return _[_0x3e92('0x5')](_0x83eff4,function(_0x3c7e75){_0x3c7e75[_0x3e92('0x6')]('channel',_0x562ecf);return _0x3c7e75;});})[_0x3e92('0x7')](function(_0xcac0ad){throw _0xcac0ad;});}module[_0x3e92('0x8')]=function(_0x2b344f){return _0x2b344f[_0x3e92('0x9')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x236ec3=this;var _0xb944ad=['Chat',_0x3e92('0xa'),_0x3e92('0xb'),_0x3e92('0xc'),_0x3e92('0xd'),_0x3e92('0xe'),_0x3e92('0xf')];return Promise['resolve']()['then'](function(){var _0x3bc021=_[_0x3e92('0x5')](_0xb944ad,function(_0x4b4633){return getQueuesByChannel(_0x236ec3,_0x4b4633);});return Promise[_0x3e92('0x10')](_0x3bc021);})['catch'](function(_0x3c4573){throw _0x3c4573;});}}});};