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 _0x95d9=['define','Fax','Mail','Openchannel','Whatsapp','resolve','then','all','catch','lodash','./team.attributes','get','Queues','map','setDataValue','channel','exports'];(function(_0x2a561e,_0x2e87c3){var _0x166d32=function(_0x51890a){while(--_0x51890a){_0x2a561e['push'](_0x2a561e['shift']());}};_0x166d32(++_0x2e87c3);}(_0x95d9,0x80));var _0x995d=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x95d9[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0x995d('0x0'));var attributes=require(_0x995d('0x1'));function getQueuesByChannel(_0x44d04e,_0x99df98){var _0x2204d2=_0x995d('0x2')+_0x99df98+_0x995d('0x3');return _0x44d04e[_0x2204d2]()['then'](function(_0x80f7bf){return _[_0x995d('0x4')](_0x80f7bf,function(_0x28b862){_0x28b862[_0x995d('0x5')](_0x995d('0x6'),_0x99df98);return _0x28b862;});})['catch'](function(_0x5ac3fd){throw _0x5ac3fd;});}module[_0x995d('0x7')]=function(_0x327c2f){return _0x327c2f[_0x995d('0x8')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x2b5dd5=this;var _0x403eb5=['Chat',_0x995d('0x9'),_0x995d('0xa'),_0x995d('0xb'),'Sms','Voice',_0x995d('0xc')];return Promise[_0x995d('0xd')]()[_0x995d('0xe')](function(){var _0x43c722=_[_0x995d('0x4')](_0x403eb5,function(_0x58289d){return getQueuesByChannel(_0x2b5dd5,_0x58289d);});return Promise[_0x995d('0xf')](_0x43c722);})[_0x995d('0x10')](function(_0x2c6ff5){throw _0x2c6ff5;});}}});};