803e78e23d377723516f0d850ff580eb1b8991fb
[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 _0x3c3e=['log','finished\x20populating','contacts1','CmHopper','then','hopper1','contacts2','catch','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','bulkCreate'];(function(_0x1577d6,_0x1db963){var _0x5c2a4f=function(_0x523369){while(--_0x523369){_0x1577d6['push'](_0x1577d6['shift']());}};_0x5c2a4f(++_0x1db963);}(_0x3c3e,0x1a6));var _0xe3c3=function(_0x4c807c,_0x3e41c5){_0x4c807c=_0x4c807c-0x0;var _0xad2435=_0x3c3e[_0x4c807c];return _0xad2435;};'use strict';var util=require(_0xe3c3('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe3c3('0x1')]({'id':i,'firstName':_0xe3c3('0x2')+i,'lastName':_0xe3c3('0x3')+i,'phone':0xf879fb460+i,'email':_0xe3c3('0x4')+i+_0xe3c3('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe3c3('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xe3c3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe3c3('0x6')](),'updatedAt':Date[_0xe3c3('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe3c3('0x1')]({'id':i,'firstName':_0xe3c3('0x2')+i,'lastName':_0xe3c3('0x3')+i,'phone':0xf879fb460+i,'email':_0xe3c3('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe3c3('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xe3c3('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe3c3('0x6')](),'updatedAt':Date[_0xe3c3('0x6')]()});}db[_0xe3c3('0x7')][_0xe3c3('0x8')]({'where':{}})['then'](function(){return db[_0xe3c3('0x7')][_0xe3c3('0x9')](contacts);})['then'](function(){console[_0xe3c3('0xa')](_0xe3c3('0xb'),_0xe3c3('0xc'));return db[_0xe3c3('0xd')][_0xe3c3('0x8')]({'where':{}});})[_0xe3c3('0xe')](function(){return db['CmHopper'][_0xe3c3('0x9')](hopper);})[_0xe3c3('0xe')](function(){console[_0xe3c3('0xa')](_0xe3c3('0xb'),_0xe3c3('0xf'));return db[_0xe3c3('0x7')][_0xe3c3('0x9')](contacts2);})[_0xe3c3('0xe')](function(){console[_0xe3c3('0xa')](_0xe3c3('0xb'),_0xe3c3('0x10'));return db['CmHopper'][_0xe3c3('0x9')](hopper2);})[_0xe3c3('0xe')](function(){console['log'](_0xe3c3('0xb'),'hopper2');})[_0xe3c3('0x11')](function(_0x380d26){console['log'](_0x380d26);});