Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / api / squareReport / squareReport.controller.js
index f7dd179..9447ce3 100644 (file)
@@ -1 +1 @@
-const a610_0x940f=['where','undefined','filter','include','intersection','show','../../config/logger','options','set','nolimit','sendStatus','order','offset','type','api','merge','like','length','describe','catch','count','send','VIRTUAL','name','../../mysqldb','filters','findAll','limit','map','error','rawAttributes','attributes','sort','json','update','body','params','pick','query','SquareReport','findOne','fields','destroy','then','model','includeAll','status','create','keys','sequelize','end'];(function(_0x1d7554,_0x940f5e){const _0x517f61=function(_0x1de540){while(--_0x1de540){_0x1d7554['push'](_0x1d7554['shift']());}};_0x517f61(++_0x940f5e);}(a610_0x940f,0x156));const a610_0x517f=function(_0x1d7554,_0x940f5e){_0x1d7554=_0x1d7554-0x0;let _0x517f61=a610_0x940f[_0x1d7554];return _0x517f61;};const _0x583a6e=a610_0x517f;'use strict';const _=require('lodash'),qs=require('../../components/parsers/qs'),logger=require(_0x583a6e('0x15'))(_0x583a6e('0x1d')),db=require(_0x583a6e('0x27'))['db'],{Op}=require(_0x583a6e('0xd'));function respondWithResult(_0x1de540,_0x2f27a5){return _0x2f27a5=_0x2f27a5||0xc8,function(_0x31c08c){const _0x524fc4=a610_0x517f;if(_0x31c08c)return _0x1de540[_0x524fc4('0xa')](_0x2f27a5)[_0x524fc4('0x30')](_0x31c08c);};}function respondWithFilteredResult(_0x9b2b0b,_0x7f4738){return function(_0x45927b){const _0x10430f=a610_0x517f;if(_0x45927b){const _0xedd1c1=_0x45927b[_0x10430f('0x23')],_0x3998fa=_0x7f4738[_0x10430f('0x1b')];let _0x4a4d8a=_0x7f4738[_0x10430f('0x1b')]+_0x7f4738[_0x10430f('0x2a')],_0x144943;return _0x4a4d8a>=_0xedd1c1?(_0x4a4d8a=_0xedd1c1,_0x144943=0xc8):_0x144943=0xce,_0x9b2b0b['status'](_0x144943),_0x9b2b0b[_0x10430f('0x17')]('Content-Range',_0x3998fa+'-'+_0x4a4d8a+'/'+_0xedd1c1)[_0x10430f('0x30')](_0x45927b);}return null;};}function saveUpdates(_0x26ed71){return function(_0x123779){if(_0x123779)return _0x123779['update'](_0x26ed71)['then'](function(_0x4a671d){return _0x4a671d;});return null;};}function removeEntity(_0x41d5b6){return function(_0x13b246){const _0x1d5e30=a610_0x517f;if(_0x13b246)return _0x13b246['destroy']()[_0x1d5e30('0x7')](function(){const _0x29b95a=_0x1d5e30;_0x41d5b6[_0x29b95a('0xa')](0xcc)[_0x29b95a('0xe')]();});};}function handleEntityNotFound(_0x21de96){return function(_0x180bb3){const _0x3ba6c6=a610_0x517f;return!_0x180bb3&&_0x21de96[_0x3ba6c6('0x19')](0x194),_0x180bb3;};}function handleError(_0x3c1575,_0x3e7b59){return _0x3e7b59=_0x3e7b59||0x1f4,function(_0x24590c){const _0x27125c=a610_0x517f;logger[_0x27125c('0x2c')](_0x24590c['stack']),_0x24590c['name']&&delete _0x24590c[_0x27125c('0x26')],_0x3c1575[_0x27125c('0xa')](_0x3e7b59)[_0x27125c('0x24')](_0x24590c);};}exports['index']=function(_0x2b4944,_0x315df8){const _0x460bbe=_0x583a6e;let _0x1705f3={};const _0x40a4e8={},_0x1e6713={'count':0x0,'rows':[]},_0x167b9c=_[_0x460bbe('0x2b')](db[_0x460bbe('0x3')][_0x460bbe('0x2d')],function(_0x2476aa){const _0x325974=_0x460bbe;return{'name':_0x2476aa['fieldName'],'type':_0x2476aa[_0x325974('0x1c')]['key']};});_0x40a4e8['model']=_[_0x460bbe('0x2b')](_0x167b9c,_0x460bbe('0x26')),_0x40a4e8[_0x460bbe('0x2')]=_[_0x460bbe('0xc')](_0x2b4944[_0x460bbe('0x2')]),_0x40a4e8[_0x460bbe('0x28')]=_['intersection'](_0x40a4e8[_0x460bbe('0x8')],_0x40a4e8['query']),_0x1705f3[_0x460bbe('0x2e')]=_[_0x460bbe('0x13')](_0x40a4e8[_0x460bbe('0x8')],qs[_0x460bbe('0x5')](_0x2b4944[_0x460bbe('0x2')][_0x460bbe('0x5')])),_0x1705f3[_0x460bbe('0x2e')]=_0x1705f3[_0x460bbe('0x2e')]['length']?_0x1705f3[_0x460bbe('0x2e')]:_0x40a4e8[_0x460bbe('0x8')];typeof _0x2b4944[_0x460bbe('0x2')][_0x460bbe('0x18')]===_0x460bbe('0x10')&&(_0x1705f3[_0x460bbe('0x2a')]=qs[_0x460bbe('0x2a')](_0x2b4944[_0x460bbe('0x2')][_0x460bbe('0x2a')]),_0x1705f3[_0x460bbe('0x1b')]=qs[_0x460bbe('0x1b')](_0x2b4944[_0x460bbe('0x2')][_0x460bbe('0x1b')]));_0x1705f3[_0x460bbe('0x1a')]=qs[_0x460bbe('0x2f')](_0x2b4944[_0x460bbe('0x2')]['sort']),_0x1705f3[_0x460bbe('0xf')]=qs['filters'](_[_0x460bbe('0x1')](_0x2b4944[_0x460bbe('0x2')],_0x40a4e8[_0x460bbe('0x28')]),_0x167b9c);_0x2b4944[_0x460bbe('0x2')][_0x460bbe('0x11')]&&(_0x1705f3[_0x460bbe('0xf')]=_[_0x460bbe('0x1e')](_0x1705f3[_0x460bbe('0xf')],{[Op['or']]:_[_0x460bbe('0x2b')](_0x167b9c,function(_0x589114){const _0x315463=_0x460bbe;if(_0x589114['type']!==_0x315463('0x25')){const _0x2c5445={};return _0x2c5445[_0x589114[_0x315463('0x26')]]={[Op[_0x315463('0x1f')]]:'%'+_0x2b4944[_0x315463('0x2')][_0x315463('0x11')]+'%'},_0x2c5445;}})}));_0x1705f3=_[_0x460bbe('0x1e')]({},_0x1705f3,_0x2b4944[_0x460bbe('0x16')]);const _0x57ef78={'where':_0x1705f3[_0x460bbe('0xf')]};return db[_0x460bbe('0x3')][_0x460bbe('0x23')](_0x57ef78)[_0x460bbe('0x7')](function(_0x526b23){const _0x378d8d=_0x460bbe;return _0x1e6713['count']=_0x526b23,_0x2b4944[_0x378d8d('0x2')][_0x378d8d('0x9')]&&(_0x1705f3[_0x378d8d('0x12')]=[{'all':!![]}]),db['SquareReport'][_0x378d8d('0x29')](_0x1705f3);})['then'](function(_0x3f2b04){return _0x1e6713['rows']=_0x3f2b04,_0x1e6713;})[_0x460bbe('0x7')](respondWithFilteredResult(_0x315df8,_0x1705f3))[_0x460bbe('0x22')](handleError(_0x315df8,null));},exports[_0x583a6e('0x14')]=function(_0x5b803d,_0x591f40){const _0x5bd8b8=_0x583a6e;let _0x4541d4={'raw':!![],'where':{'id':_0x5b803d[_0x5bd8b8('0x0')]['id']}};const _0x1e11c5={};return _0x1e11c5[_0x5bd8b8('0x8')]=_['keys'](db[_0x5bd8b8('0x3')][_0x5bd8b8('0x2d')]),_0x1e11c5['query']=_[_0x5bd8b8('0xc')](_0x5b803d[_0x5bd8b8('0x2')]),_0x1e11c5['filters']=_['intersection'](_0x1e11c5[_0x5bd8b8('0x8')],_0x1e11c5[_0x5bd8b8('0x2')]),_0x4541d4[_0x5bd8b8('0x2e')]=_[_0x5bd8b8('0x13')](_0x1e11c5[_0x5bd8b8('0x8')],qs[_0x5bd8b8('0x5')](_0x5b803d[_0x5bd8b8('0x2')][_0x5bd8b8('0x5')])),_0x4541d4[_0x5bd8b8('0x2e')]=_0x4541d4[_0x5bd8b8('0x2e')][_0x5bd8b8('0x20')]?_0x4541d4['attributes']:_0x1e11c5[_0x5bd8b8('0x8')],_0x5b803d['query'][_0x5bd8b8('0x9')]&&(_0x4541d4['include']=[{'all':!![]}]),_0x4541d4=_[_0x5bd8b8('0x1e')]({},_0x4541d4,_0x5b803d['options']),db[_0x5bd8b8('0x3')][_0x5bd8b8('0x4')](_0x4541d4)[_0x5bd8b8('0x7')](handleEntityNotFound(_0x591f40,null))[_0x5bd8b8('0x7')](respondWithResult(_0x591f40,null))[_0x5bd8b8('0x22')](handleError(_0x591f40,null));},exports[_0x583a6e('0xb')]=function(_0x599e40,_0x5b69a3){const _0x1280b0=_0x583a6e;return db[_0x1280b0('0x3')]['create'](_0x599e40[_0x1280b0('0x32')],{})[_0x1280b0('0x7')](respondWithResult(_0x5b69a3,0xc9))[_0x1280b0('0x22')](handleError(_0x5b69a3,null));},exports[_0x583a6e('0x31')]=function(_0x1337af,_0x4cb686){const _0x2342a8=_0x583a6e;return _0x1337af['body']['id']&&delete _0x1337af[_0x2342a8('0x32')]['id'],db[_0x2342a8('0x3')][_0x2342a8('0x4')]({'where':{'id':_0x1337af[_0x2342a8('0x0')]['id']}})[_0x2342a8('0x7')](handleEntityNotFound(_0x4cb686,null))[_0x2342a8('0x7')](saveUpdates(_0x1337af[_0x2342a8('0x32')],null))[_0x2342a8('0x7')](respondWithResult(_0x4cb686,null))['catch'](handleError(_0x4cb686,null));},exports[_0x583a6e('0x6')]=function(_0x2c6c3c,_0x4f91f4){const _0x200b93=_0x583a6e;return db[_0x200b93('0x3')][_0x200b93('0x4')]({'where':{'id':_0x2c6c3c['params']['id']}})['then'](handleEntityNotFound(_0x4f91f4,null))[_0x200b93('0x7')](removeEntity(_0x4f91f4,null))[_0x200b93('0x22')](handleError(_0x4f91f4,null));},exports['describe']=function(_0x106e23,_0x13c3b5){const _0x57c1de=_0x583a6e;return db[_0x57c1de('0x3')][_0x57c1de('0x21')]()[_0x57c1de('0x7')](respondWithResult(_0x13c3b5,null))['catch'](handleError(_0x13c3b5,null));};
\ No newline at end of file
+const a610_0x8d19=['index','filters','body','length','describe','keys','then','json','VIRTUAL','destroy','key','limit','error','stack','where','status','send','sort','type','create','count','../../mysqldb','map','includeAll','rawAttributes','Content-Range','undefined','findOne','end','sendStatus','options','model','pick','query','name','lodash','offset','fields','attributes','params','set','filter','rows','update','like','catch','include','SquareReport','intersection','show','merge'];(function(_0x4ca3e2,_0x8d19e8){const _0x1ed507=function(_0x221741){while(--_0x221741){_0x4ca3e2['push'](_0x4ca3e2['shift']());}};_0x1ed507(++_0x8d19e8);}(a610_0x8d19,0xbf));const a610_0x1ed5=function(_0x4ca3e2,_0x8d19e8){_0x4ca3e2=_0x4ca3e2-0x0;let _0x1ed507=a610_0x8d19[_0x4ca3e2];return _0x1ed507;};const _0x35956f=a610_0x1ed5;'use strict';const _=require(_0x35956f('0x30')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')('api'),db=require(_0x35956f('0x22'))['db'],{Op}=require('sequelize');function respondWithResult(_0x221741,_0x29b443){return _0x29b443=_0x29b443||0xc8,function(_0x2aa940){const _0x145bc7=a610_0x1ed5;if(_0x2aa940)return _0x221741[_0x145bc7('0x1c')](_0x29b443)[_0x145bc7('0x14')](_0x2aa940);};}function respondWithFilteredResult(_0x143805,_0xcebb2f){return function(_0x4af367){const _0x4d685b=a610_0x1ed5;if(_0x4af367){const _0x56e204=_0x4af367['count'],_0x5b6091=_0xcebb2f[_0x4d685b('0x31')];let _0x1552d3=_0xcebb2f['offset']+_0xcebb2f[_0x4d685b('0x18')],_0x1e01d8;return _0x1552d3>=_0x56e204?(_0x1552d3=_0x56e204,_0x1e01d8=0xc8):_0x1e01d8=0xce,_0x143805[_0x4d685b('0x1c')](_0x1e01d8),_0x143805[_0x4d685b('0x2')](_0x4d685b('0x26'),_0x5b6091+'-'+_0x1552d3+'/'+_0x56e204)[_0x4d685b('0x14')](_0x4af367);}return null;};}function saveUpdates(_0x3a294a){return function(_0x4dcfb7){const _0x1606f5=a610_0x1ed5;if(_0x4dcfb7)return _0x4dcfb7[_0x1606f5('0x5')](_0x3a294a)[_0x1606f5('0x13')](function(_0x3cfe74){return _0x3cfe74;});return null;};}function removeEntity(_0x1e2f07){return function(_0x196ea5){const _0x2cb09f=a610_0x1ed5;if(_0x196ea5)return _0x196ea5[_0x2cb09f('0x16')]()[_0x2cb09f('0x13')](function(){const _0x1b66d4=_0x2cb09f;_0x1e2f07[_0x1b66d4('0x1c')](0xcc)[_0x1b66d4('0x29')]();});};}function handleEntityNotFound(_0x56bde4){return function(_0x219c12){const _0x43c3c6=a610_0x1ed5;return!_0x219c12&&_0x56bde4[_0x43c3c6('0x2a')](0x194),_0x219c12;};}function handleError(_0x1224ed,_0x1dc0b2){return _0x1dc0b2=_0x1dc0b2||0x1f4,function(_0x5b32d0){const _0x545a5b=a610_0x1ed5;logger[_0x545a5b('0x19')](_0x5b32d0[_0x545a5b('0x1a')]),_0x5b32d0[_0x545a5b('0x2f')]&&delete _0x5b32d0[_0x545a5b('0x2f')],_0x1224ed[_0x545a5b('0x1c')](_0x1dc0b2)[_0x545a5b('0x1d')](_0x5b32d0);};}exports[_0x35956f('0xd')]=function(_0x3cd698,_0x3d21fc){const _0x326596=_0x35956f;let _0x387e13={};const _0x46d2c0={},_0x2392b2={'count':0x0,'rows':[]},_0x4d0458=_['map'](db[_0x326596('0x9')][_0x326596('0x25')],function(_0x323e20){const _0x191593=_0x326596;return{'name':_0x323e20['fieldName'],'type':_0x323e20[_0x191593('0x1f')][_0x191593('0x17')]};});_0x46d2c0['model']=_['map'](_0x4d0458,_0x326596('0x2f')),_0x46d2c0[_0x326596('0x2e')]=_['keys'](_0x3cd698[_0x326596('0x2e')]),_0x46d2c0[_0x326596('0xe')]=_[_0x326596('0xa')](_0x46d2c0[_0x326596('0x2c')],_0x46d2c0[_0x326596('0x2e')]),_0x387e13[_0x326596('0x0')]=_[_0x326596('0xa')](_0x46d2c0['model'],qs[_0x326596('0x32')](_0x3cd698['query'][_0x326596('0x32')])),_0x387e13[_0x326596('0x0')]=_0x387e13['attributes'][_0x326596('0x10')]?_0x387e13[_0x326596('0x0')]:_0x46d2c0[_0x326596('0x2c')];typeof _0x3cd698['query']['nolimit']===_0x326596('0x27')&&(_0x387e13['limit']=qs[_0x326596('0x18')](_0x3cd698[_0x326596('0x2e')][_0x326596('0x18')]),_0x387e13['offset']=qs[_0x326596('0x31')](_0x3cd698[_0x326596('0x2e')][_0x326596('0x31')]));_0x387e13['order']=qs[_0x326596('0x1e')](_0x3cd698['query'][_0x326596('0x1e')]),_0x387e13[_0x326596('0x1b')]=qs[_0x326596('0xe')](_[_0x326596('0x2d')](_0x3cd698['query'],_0x46d2c0['filters']),_0x4d0458);_0x3cd698['query'][_0x326596('0x3')]&&(_0x387e13[_0x326596('0x1b')]=_['merge'](_0x387e13[_0x326596('0x1b')],{[Op['or']]:_[_0x326596('0x23')](_0x4d0458,function(_0x2ce59){const _0x43d558=_0x326596;if(_0x2ce59['type']!==_0x43d558('0x15')){const _0x53dc8c={};return _0x53dc8c[_0x2ce59[_0x43d558('0x2f')]]={[Op[_0x43d558('0x6')]]:'%'+_0x3cd698[_0x43d558('0x2e')][_0x43d558('0x3')]+'%'},_0x53dc8c;}})}));_0x387e13=_[_0x326596('0xc')]({},_0x387e13,_0x3cd698['options']);const _0x4cd8a2={'where':_0x387e13['where']};return db[_0x326596('0x9')][_0x326596('0x21')](_0x4cd8a2)['then'](function(_0x5f4fa8){const _0x4d9982=_0x326596;return _0x2392b2['count']=_0x5f4fa8,_0x3cd698[_0x4d9982('0x2e')]['includeAll']&&(_0x387e13['include']=[{'all':!![]}]),db[_0x4d9982('0x9')]['findAll'](_0x387e13);})[_0x326596('0x13')](function(_0x29e89b){const _0xfd26f9=_0x326596;return _0x2392b2[_0xfd26f9('0x4')]=_0x29e89b,_0x2392b2;})[_0x326596('0x13')](respondWithFilteredResult(_0x3d21fc,_0x387e13))[_0x326596('0x7')](handleError(_0x3d21fc,null));},exports[_0x35956f('0xb')]=function(_0x1ef32e,_0x4c9f11){const _0x4af2c3=_0x35956f;let _0x274ff5={'raw':!![],'where':{'id':_0x1ef32e[_0x4af2c3('0x1')]['id']}};const _0x3f98ed={};return _0x3f98ed[_0x4af2c3('0x2c')]=_['keys'](db[_0x4af2c3('0x9')]['rawAttributes']),_0x3f98ed[_0x4af2c3('0x2e')]=_[_0x4af2c3('0x12')](_0x1ef32e['query']),_0x3f98ed[_0x4af2c3('0xe')]=_[_0x4af2c3('0xa')](_0x3f98ed['model'],_0x3f98ed[_0x4af2c3('0x2e')]),_0x274ff5[_0x4af2c3('0x0')]=_[_0x4af2c3('0xa')](_0x3f98ed[_0x4af2c3('0x2c')],qs[_0x4af2c3('0x32')](_0x1ef32e['query'][_0x4af2c3('0x32')])),_0x274ff5['attributes']=_0x274ff5[_0x4af2c3('0x0')][_0x4af2c3('0x10')]?_0x274ff5['attributes']:_0x3f98ed[_0x4af2c3('0x2c')],_0x1ef32e[_0x4af2c3('0x2e')][_0x4af2c3('0x24')]&&(_0x274ff5[_0x4af2c3('0x8')]=[{'all':!![]}]),_0x274ff5=_[_0x4af2c3('0xc')]({},_0x274ff5,_0x1ef32e[_0x4af2c3('0x2b')]),db[_0x4af2c3('0x9')][_0x4af2c3('0x28')](_0x274ff5)['then'](handleEntityNotFound(_0x4c9f11,null))['then'](respondWithResult(_0x4c9f11,null))[_0x4af2c3('0x7')](handleError(_0x4c9f11,null));},exports[_0x35956f('0x20')]=function(_0x479625,_0x55b78d){const _0x3a1deb=_0x35956f;return db[_0x3a1deb('0x9')][_0x3a1deb('0x20')](_0x479625[_0x3a1deb('0xf')],{})[_0x3a1deb('0x13')](respondWithResult(_0x55b78d,0xc9))[_0x3a1deb('0x7')](handleError(_0x55b78d,null));},exports[_0x35956f('0x5')]=function(_0x2c93b5,_0x40b4dc){const _0x2cd676=_0x35956f;return _0x2c93b5[_0x2cd676('0xf')]['id']&&delete _0x2c93b5[_0x2cd676('0xf')]['id'],db['SquareReport'][_0x2cd676('0x28')]({'where':{'id':_0x2c93b5['params']['id']}})[_0x2cd676('0x13')](handleEntityNotFound(_0x40b4dc,null))[_0x2cd676('0x13')](saveUpdates(_0x2c93b5[_0x2cd676('0xf')],null))[_0x2cd676('0x13')](respondWithResult(_0x40b4dc,null))[_0x2cd676('0x7')](handleError(_0x40b4dc,null));},exports['destroy']=function(_0x266749,_0x1fee70){const _0xe3775b=_0x35956f;return db[_0xe3775b('0x9')][_0xe3775b('0x28')]({'where':{'id':_0x266749[_0xe3775b('0x1')]['id']}})[_0xe3775b('0x13')](handleEntityNotFound(_0x1fee70,null))['then'](removeEntity(_0x1fee70,null))[_0xe3775b('0x7')](handleError(_0x1fee70,null));},exports[_0x35956f('0x11')]=function(_0x59486f,_0x160e52){const _0x5a1568=_0x35956f;return db[_0x5a1568('0x9')][_0x5a1568('0x11')]()[_0x5a1568('0x13')](respondWithResult(_0x160e52,null))[_0x5a1568('0x7')](handleError(_0x160e52,null));};
\ No newline at end of file