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 _0xf05a=['hopper1','log','contacts2','hopper2','util','../mysqldb','push','Biondo','@xcally.com','now','innocenzo.biondo','destroy','CmContact','bulkCreate','then','finished\x20populating','contacts1','CmHopper'];(function(_0x2e6b71,_0x14f23b){var _0x305200=function(_0x3b13ce){while(--_0x3b13ce){_0x2e6b71['push'](_0x2e6b71['shift']());}};_0x305200(++_0x14f23b);}(_0xf05a,0xa6));var _0xaf05=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf05a[_0x59ee6f];return _0x4c0979;};'use strict';var util=require(_0xaf05('0x0'));var db=require(_0xaf05('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xaf05('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xaf05('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xaf05('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xaf05('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xaf05('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf05('0x5')](),'updatedAt':Date[_0xaf05('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xaf05('0x6')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xaf05('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xaf05('0x5')](),'updatedAt':Date[_0xaf05('0x5')]()});}db['CmContact'][_0xaf05('0x7')]({'where':{}})['then'](function(){return db[_0xaf05('0x8')][_0xaf05('0x9')](contacts);})[_0xaf05('0xa')](function(){console['log'](_0xaf05('0xb'),_0xaf05('0xc'));return db['CmHopper'][_0xaf05('0x7')]({'where':{}});})[_0xaf05('0xa')](function(){return db[_0xaf05('0xd')][_0xaf05('0x9')](hopper);})[_0xaf05('0xa')](function(){console['log'](_0xaf05('0xb'),_0xaf05('0xe'));return db[_0xaf05('0x8')]['bulkCreate'](contacts2);})[_0xaf05('0xa')](function(){console[_0xaf05('0xf')](_0xaf05('0xb'),_0xaf05('0x10'));return db[_0xaf05('0xd')][_0xaf05('0x9')](hopper2);})['then'](function(){console[_0xaf05('0xf')](_0xaf05('0xb'),_0xaf05('0x11'));})['catch'](function(_0x159bc6){console[_0xaf05('0xf')](_0x159bc6);});