00c70c565ac7812f42506b6da7a05f6ab99061a4
[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 _0x00ce=['contacts1','CmHopper','hopper1','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0x00ce,0x92));var _0xe00c=function(_0x5214ea,_0x383361){_0x5214ea=_0x5214ea-0x0;var _0x2eb863=_0x00ce[_0x5214ea];return _0x2eb863;};'use strict';var util=require(_0xe00c('0x0'));var db=require(_0xe00c('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe00c('0x2')]({'id':i,'firstName':_0xe00c('0x3')+i,'lastName':_0xe00c('0x4')+i,'phone':0xf879fb460+i,'email':_0xe00c('0x5')+i+_0xe00c('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe00c('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe00c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe00c('0x7')](),'updatedAt':Date[_0xe00c('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe00c('0x2')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xe00c('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0xe00c('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe00c('0x7')](),'updatedAt':Date[_0xe00c('0x7')]()});}db[_0xe00c('0x8')][_0xe00c('0x9')]({'where':{}})[_0xe00c('0xa')](function(){return db[_0xe00c('0x8')][_0xe00c('0xb')](contacts);})[_0xe00c('0xa')](function(){console[_0xe00c('0xc')](_0xe00c('0xd'),_0xe00c('0xe'));return db[_0xe00c('0xf')][_0xe00c('0x9')]({'where':{}});})[_0xe00c('0xa')](function(){return db[_0xe00c('0xf')]['bulkCreate'](hopper);})[_0xe00c('0xa')](function(){console['log'](_0xe00c('0xd'),_0xe00c('0x10'));return db[_0xe00c('0x8')][_0xe00c('0xb')](contacts2);})[_0xe00c('0xa')](function(){console[_0xe00c('0xc')]('finished\x20populating',_0xe00c('0x11'));return db[_0xe00c('0xf')][_0xe00c('0xb')](hopper2);})[_0xe00c('0xa')](function(){console[_0xe00c('0xc')](_0xe00c('0xd'),_0xe00c('0x12'));})[_0xe00c('0x13')](function(_0x4ad46b){console[_0xe00c('0xc')](_0x4ad46b);});