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