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