Built motion from commit 67e5df37.|2.0.66
[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 _0x428f=['@xcally.com','now','CmContact','destroy','then','bulkCreate','log','CmHopper','finished\x20populating','hopper1','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo'];(function(_0x1a6108,_0x5805ff){var _0x2a19b7=function(_0x50705d){while(--_0x50705d){_0x1a6108['push'](_0x1a6108['shift']());}};_0x2a19b7(++_0x5805ff);}(_0x428f,0x18a));var _0xf428=function(_0x22205c,_0x411cdd){_0x22205c=_0x22205c-0x0;var _0x413a6a=_0x428f[_0x22205c];return _0x413a6a;};'use strict';var util=require(_0xf428('0x0'));var db=require(_0xf428('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xf428('0x2')]({'id':i,'firstName':_0xf428('0x3')+i,'lastName':_0xf428('0x4')+i,'phone':0xf879fb460+i,'email':_0xf428('0x5')+i+_0xf428('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xf428('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xf428('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf428('0x7')](),'updatedAt':Date[_0xf428('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xf428('0x3')+i,'lastName':_0xf428('0x4')+i,'phone':0xf879fb460+i,'email':_0xf428('0x5')+i+_0xf428('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xf428('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xf428('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xf428('0x7')](),'updatedAt':Date[_0xf428('0x7')]()});}db[_0xf428('0x8')][_0xf428('0x9')]({'where':{}})[_0xf428('0xa')](function(){return db[_0xf428('0x8')][_0xf428('0xb')](contacts);})[_0xf428('0xa')](function(){console[_0xf428('0xc')]('finished\x20populating','contacts1');return db[_0xf428('0xd')][_0xf428('0x9')]({'where':{}});})[_0xf428('0xa')](function(){return db['CmHopper'][_0xf428('0xb')](hopper);})[_0xf428('0xa')](function(){console['log'](_0xf428('0xe'),_0xf428('0xf'));return db[_0xf428('0x8')][_0xf428('0xb')](contacts2);})[_0xf428('0xa')](function(){console[_0xf428('0xc')]('finished\x20populating','contacts2');return db[_0xf428('0xd')][_0xf428('0xb')](hopper2);})[_0xf428('0xa')](function(){console[_0xf428('0xc')](_0xf428('0xe'),'hopper2');})['catch'](function(_0xdc7ce0){console['log'](_0xdc7ce0);});