Built motion from commit d1eab355.|2.6.28
[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 _0x5e0c=['bulkCreate','finished\x20populating','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','contacts1','CmHopper'];(function(_0x4404f6,_0x3b8ab2){var _0x465ae3=function(_0x852d21){while(--_0x852d21){_0x4404f6['push'](_0x4404f6['shift']());}};_0x465ae3(++_0x3b8ab2);}(_0x5e0c,0x78));var _0xc5e0=function(_0x4a7843,_0x24f6d1){_0x4a7843=_0x4a7843-0x0;var _0x2c57fe=_0x5e0c[_0x4a7843];return _0x2c57fe;};'use strict';var util=require('util');var db=require(_0xc5e0('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xc5e0('0x1')]({'id':i,'firstName':_0xc5e0('0x2')+i,'lastName':_0xc5e0('0x3')+i,'phone':0xf879fb460+i,'email':_0xc5e0('0x4')+i+_0xc5e0('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc5e0('0x6')](),'updatedAt':Date[_0xc5e0('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xc5e0('0x1')]({'id':i,'firstName':_0xc5e0('0x2')+i,'lastName':_0xc5e0('0x3')+i,'phone':0xf879fb460+i,'email':_0xc5e0('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xc5e0('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xc5e0('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xc5e0('0x6')](),'updatedAt':Date['now']()});}db[_0xc5e0('0x7')][_0xc5e0('0x8')]({'where':{}})[_0xc5e0('0x9')](function(){return db[_0xc5e0('0x7')]['bulkCreate'](contacts);})[_0xc5e0('0x9')](function(){console[_0xc5e0('0xa')]('finished\x20populating',_0xc5e0('0xb'));return db[_0xc5e0('0xc')][_0xc5e0('0x8')]({'where':{}});})[_0xc5e0('0x9')](function(){return db[_0xc5e0('0xc')][_0xc5e0('0xd')](hopper);})['then'](function(){console['log'](_0xc5e0('0xe'),_0xc5e0('0xf'));return db[_0xc5e0('0x7')][_0xc5e0('0xd')](contacts2);})[_0xc5e0('0x9')](function(){console[_0xc5e0('0xa')]('finished\x20populating',_0xc5e0('0x10'));return db[_0xc5e0('0xc')]['bulkCreate'](hopper2);})[_0xc5e0('0x9')](function(){console[_0xc5e0('0xa')](_0xc5e0('0xe'),_0xc5e0('0x11'));})[_0xc5e0('0x12')](function(_0x3f6963){console[_0xc5e0('0xa')](_0x3f6963);});