Built motion from commit c116dc8b.|2.6.30
[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 _0xd0fa=['Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','contacts2','hopper2','util','push'];(function(_0x943e6,_0x3ce269){var _0x39a6e9=function(_0x286cc7){while(--_0x286cc7){_0x943e6['push'](_0x943e6['shift']());}};_0x39a6e9(++_0x3ce269);}(_0xd0fa,0x64));var _0xad0f=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xd0fa[_0xda464c];return _0x19e222;};'use strict';var util=require(_0xad0f('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xad0f('0x1')]({'id':i,'firstName':_0xad0f('0x2')+i,'lastName':_0xad0f('0x3')+i,'phone':0xf879fb460+i,'email':_0xad0f('0x4')+i+_0xad0f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xad0f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xad0f('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xad0f('0x1')]({'id':i,'firstName':_0xad0f('0x2')+i,'lastName':_0xad0f('0x3')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xad0f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xad0f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xad0f('0x6')](),'updatedAt':Date[_0xad0f('0x6')]()});}db[_0xad0f('0x7')][_0xad0f('0x8')]({'where':{}})[_0xad0f('0x9')](function(){return db['CmContact'][_0xad0f('0xa')](contacts);})[_0xad0f('0x9')](function(){console[_0xad0f('0xb')](_0xad0f('0xc'),_0xad0f('0xd'));return db[_0xad0f('0xe')][_0xad0f('0x8')]({'where':{}});})['then'](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0xad0f('0x9')](function(){console['log'](_0xad0f('0xc'),'hopper1');return db[_0xad0f('0x7')][_0xad0f('0xa')](contacts2);})[_0xad0f('0x9')](function(){console[_0xad0f('0xb')](_0xad0f('0xc'),_0xad0f('0xf'));return db['CmHopper'][_0xad0f('0xa')](hopper2);})[_0xad0f('0x9')](function(){console[_0xad0f('0xb')]('finished\x20populating',_0xad0f('0x10'));})['catch'](function(_0x5a295b){console[_0xad0f('0xb')](_0x5a295b);});