Built motion from commit 9d0783e6.|2.6.13
[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 _0xa0d6=['Fax','Mail','Openchannel','Voice','Whatsapp','resolve','lodash','./team.attributes','get','Queues','then','map','setDataValue','channel','catch','exports','define','Team','teams','Chat'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xa0d6,0x1be));var _0x6a0d=function(_0x54ac4c,_0xf27fc6){_0x54ac4c=_0x54ac4c-0x0;var _0xf0376d=_0xa0d6[_0x54ac4c];return _0xf0376d;};'use strict';var _=require(_0x6a0d('0x0'));var attributes=require(_0x6a0d('0x1'));function getQueuesByChannel(_0x408b99,_0x54dea9){var _0x223f6e=_0x6a0d('0x2')+_0x54dea9+_0x6a0d('0x3');return _0x408b99[_0x223f6e]()[_0x6a0d('0x4')](function(_0x5aab80){return _[_0x6a0d('0x5')](_0x5aab80,function(_0xed7ef7){_0xed7ef7[_0x6a0d('0x6')](_0x6a0d('0x7'),_0x54dea9);return _0xed7ef7;});})[_0x6a0d('0x8')](function(_0x3fc120){throw _0x3fc120;});}module[_0x6a0d('0x9')]=function(_0x3fabd6){return _0x3fabd6[_0x6a0d('0xa')](_0x6a0d('0xb'),attributes,{'tableName':_0x6a0d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x23f935=this;var _0x3cf5f1=[_0x6a0d('0xd'),_0x6a0d('0xe'),_0x6a0d('0xf'),_0x6a0d('0x10'),'Sms',_0x6a0d('0x11'),_0x6a0d('0x12')];return Promise[_0x6a0d('0x13')]()['then'](function(){var _0x596831=_['map'](_0x3cf5f1,function(_0x555c9e){return getQueuesByChannel(_0x23f935,_0x555c9e);});return Promise['all'](_0x596831);})[_0x6a0d('0x8')](function(_0xb66f20){throw _0xb66f20;});}}});};