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