Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / config / seedContact.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 _0x1dbf=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','util','../mysqldb','Innocenzo','Biondo','push','now','innocenzo.biondo','@xcally.com','CmContact','destroy','bulkCreate','then'];(function(_0x181fba,_0x3e23f4){var _0x509d8d=function(_0x1357d1){while(--_0x1357d1){_0x181fba['push'](_0x181fba['shift']());}};_0x509d8d(++_0x3e23f4);}(_0x1dbf,0xb2));var _0xf1db=function(_0x3f55de,_0x3ae98f){_0x3f55de=_0x3f55de-0x0;var _0x2698de=_0x1dbf[_0x3f55de];return _0x2698de;};'use strict';var util=require(_0xf1db('0x0'));var db=require(_0xf1db('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0xf1db('0x2')+i,'lastName':_0xf1db('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf1db('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xf1db('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf1db('0x5')](),'updatedAt':Date[_0xf1db('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xf1db('0x6')+i+_0xf1db('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf1db('0x4')]({'id':i,'active':![],'scheduledat':Date[_0xf1db('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf1db('0x5')](),'updatedAt':Date[_0xf1db('0x5')]()});}db[_0xf1db('0x8')][_0xf1db('0x9')]({'where':{}})['then'](function(){return db[_0xf1db('0x8')][_0xf1db('0xa')](contacts);})[_0xf1db('0xb')](function(){console[_0xf1db('0xc')](_0xf1db('0xd'),_0xf1db('0xe'));return db[_0xf1db('0xf')][_0xf1db('0x9')]({'where':{}});})[_0xf1db('0xb')](function(){return db[_0xf1db('0xf')][_0xf1db('0xa')](hopper);})[_0xf1db('0xb')](function(){console[_0xf1db('0xc')](_0xf1db('0xd'),_0xf1db('0x10'));return db[_0xf1db('0x8')]['bulkCreate'](contacts2);})['then'](function(){console[_0xf1db('0xc')](_0xf1db('0xd'),_0xf1db('0x11'));return db[_0xf1db('0xf')][_0xf1db('0xa')](hopper2);})[_0xf1db('0xb')](function(){console['log'](_0xf1db('0xd'),_0xf1db('0x12'));})['catch'](function(_0x569d35){console[_0xf1db('0xc')](_0x569d35);});