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