04e6725e2276bc2d78f7727ef681f1e73f874201
[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 _0x8f3d=['map','channel','catch','define','Team','teams','Chat','Fax','Mail','Openchannel','Sms','Voice','Whatsapp','resolve','lodash','./team.attributes','then'];(function(_0x1fc9e8,_0x382720){var _0x55b160=function(_0x4e1db6){while(--_0x4e1db6){_0x1fc9e8['push'](_0x1fc9e8['shift']());}};_0x55b160(++_0x382720);}(_0x8f3d,0x96));var _0xd8f3=function(_0x1442b0,_0x2bfe92){_0x1442b0=_0x1442b0-0x0;var _0xe195c0=_0x8f3d[_0x1442b0];return _0xe195c0;};'use strict';var _=require(_0xd8f3('0x0'));var attributes=require(_0xd8f3('0x1'));function getQueuesByChannel(_0x34c33b,_0x520187){var _0x16381d='get'+_0x520187+'Queues';return _0x34c33b[_0x16381d]()[_0xd8f3('0x2')](function(_0x28f0a7){return _[_0xd8f3('0x3')](_0x28f0a7,function(_0x32b3cc){_0x32b3cc['setDataValue'](_0xd8f3('0x4'),_0x520187);return _0x32b3cc;});})[_0xd8f3('0x5')](function(_0x55a9cc){throw _0x55a9cc;});}module['exports']=function(_0x200e89){return _0x200e89[_0xd8f3('0x6')](_0xd8f3('0x7'),attributes,{'tableName':_0xd8f3('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x4dee6d=this;var _0x2033c3=[_0xd8f3('0x9'),_0xd8f3('0xa'),_0xd8f3('0xb'),_0xd8f3('0xc'),_0xd8f3('0xd'),_0xd8f3('0xe'),_0xd8f3('0xf')];return Promise[_0xd8f3('0x10')]()[_0xd8f3('0x2')](function(){var _0x1a71cf=_[_0xd8f3('0x3')](_0x2033c3,function(_0x5b7cce){return getQueuesByChannel(_0x4dee6d,_0x5b7cce);});return Promise['all'](_0x1a71cf);})[_0xd8f3('0x5')](function(_0x50d3bd){throw _0x50d3bd;});}}});};