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