Built motion from commit (unavailable).|2.5.15
[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 _0x70b8=['destroy','then','bulkCreate','finished\x20populating','contacts1','CmHopper','log','CmContact','contacts2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now'];(function(_0x42a1fd,_0x54d943){var _0x4e258a=function(_0x6752f7){while(--_0x6752f7){_0x42a1fd['push'](_0x42a1fd['shift']());}};_0x4e258a(++_0x54d943);}(_0x70b8,0x9a));var _0x870b=function(_0x519c2e,_0x5eb3ad){_0x519c2e=_0x519c2e-0x0;var _0x2c68f5=_0x70b8[_0x519c2e];return _0x2c68f5;};'use strict';var util=require(_0x870b('0x0'));var db=require(_0x870b('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x870b('0x2')]({'id':i,'firstName':_0x870b('0x3')+i,'lastName':_0x870b('0x4')+i,'phone':0xf879fb460+i,'email':_0x870b('0x5')+i+_0x870b('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x870b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x870b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x870b('0x7')](),'updatedAt':Date[_0x870b('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':_0x870b('0x4')+i,'phone':0xf879fb460+i,'email':_0x870b('0x5')+i+_0x870b('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x870b('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x870b('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x870b('0x7')]()});}db['CmContact'][_0x870b('0x8')]({'where':{}})[_0x870b('0x9')](function(){return db['CmContact'][_0x870b('0xa')](contacts);})['then'](function(){console['log'](_0x870b('0xb'),_0x870b('0xc'));return db[_0x870b('0xd')][_0x870b('0x8')]({'where':{}});})[_0x870b('0x9')](function(){return db[_0x870b('0xd')][_0x870b('0xa')](hopper);})[_0x870b('0x9')](function(){console[_0x870b('0xe')](_0x870b('0xb'),'hopper1');return db[_0x870b('0xf')]['bulkCreate'](contacts2);})[_0x870b('0x9')](function(){console[_0x870b('0xe')](_0x870b('0xb'),_0x870b('0x10'));return db[_0x870b('0xd')][_0x870b('0xa')](hopper2);})['then'](function(){console[_0x870b('0xe')](_0x870b('0xb'),'hopper2');})[_0x870b('0x11')](function(_0x298290){console['log'](_0x298290);});