Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / api / team / team.model.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 _0x6dd9=['Team','Fax','Voice','Whatsapp','resolve','all','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports'];(function(_0x4aebab,_0x56eda8){var _0x3ff553=function(_0xd7ae2e){while(--_0xd7ae2e){_0x4aebab['push'](_0x4aebab['shift']());}};_0x3ff553(++_0x56eda8);}(_0x6dd9,0x126));var _0x96dd=function(_0x538f46,_0x24d4d1){_0x538f46=_0x538f46-0x0;var _0x3d7ed8=_0x6dd9[_0x538f46];return _0x3d7ed8;};'use strict';var _=require(_0x96dd('0x0'));var attributes=require(_0x96dd('0x1'));function getQueuesByChannel(_0x549ec5,_0x93bd59){var _0x152d79=_0x96dd('0x2')+_0x93bd59+_0x96dd('0x3');return _0x549ec5[_0x152d79]()[_0x96dd('0x4')](function(_0x1d9d20){return _[_0x96dd('0x5')](_0x1d9d20,function(_0x21995e){_0x21995e[_0x96dd('0x6')](_0x96dd('0x7'),_0x93bd59);return _0x21995e;});})[_0x96dd('0x8')](function(_0x529681){throw _0x529681;});}module[_0x96dd('0x9')]=function(_0x305aae){return _0x305aae['define'](_0x96dd('0xa'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x22d928=this;var _0x2d09c1=['Chat',_0x96dd('0xb'),'Mail','Openchannel','Sms',_0x96dd('0xc'),_0x96dd('0xd')];return Promise[_0x96dd('0xe')]()[_0x96dd('0x4')](function(){var _0x5510f9=_['map'](_0x2d09c1,function(_0x591464){return getQueuesByChannel(_0x22d928,_0x591464);});return Promise[_0x96dd('0xf')](_0x5510f9);})[_0x96dd('0x8')](function(_0x12d2aa){throw _0x12d2aa;});}}});};