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