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