Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / analyticFieldReport / analyticFieldReport.controller.js
index 75212de..e23f01b 100644 (file)
@@ -1 +1 @@
-const a17_0x9e4a=['json','end','fields','error','map','index','order','model','body','then','rawAttributes','bulkCreate','nolimit','destroy','findOne','includeAll','sendStatus','../../config/logger','stack','CustomReportId','update','VIRTUAL','keys','length','AnalyticCustomReport','pick','merge','api','type','transaction','count','filters','where','query','sequelize','limit','intersection','rows','../../mysqldb','filter','findAll','sort','catch','fieldName','send','name','params','create','offset','show','addFields','options','include','attributes','lodash','AnalyticFieldReport','set'];(function(_0x57c2f7,_0x9e4a7a){const _0xa1f01b=function(_0x345d45){while(--_0x345d45){_0x57c2f7['push'](_0x57c2f7['shift']());}};_0xa1f01b(++_0x9e4a7a);}(a17_0x9e4a,0x1e3));const a17_0xa1f0=function(_0x57c2f7,_0x9e4a7a){_0x57c2f7=_0x57c2f7-0x0;let _0xa1f01b=a17_0x9e4a[_0x57c2f7];return _0xa1f01b;};const _0x4c0d8c=a17_0xa1f0;'use strict';const _=require(_0x4c0d8c('0x1b')),qs=require('../../components/parsers/qs'),logger=require(_0x4c0d8c('0x2f'))(_0x4c0d8c('0x0')),db=require(_0x4c0d8c('0xb'))['db'],{Op}=require(_0x4c0d8c('0x7'));function respondWithResult(_0x345d45,_0x13dc22){return _0x13dc22=_0x13dc22||0xc8,function(_0x52f555){const _0x268eaf=a17_0xa1f0;if(_0x52f555)return _0x345d45['status'](_0x13dc22)[_0x268eaf('0x1e')](_0x52f555);};}function respondWithFilteredResult(_0x1b23aa,_0x581fd0){return function(_0x4b0cbf){const _0x1cd5ca=a17_0xa1f0;if(_0x4b0cbf){const _0x3bdbfb=_0x4b0cbf[_0x1cd5ca('0x3')],_0x14eade=_0x581fd0[_0x1cd5ca('0x15')];let _0x20f53b=_0x581fd0[_0x1cd5ca('0x15')]+_0x581fd0['limit'],_0x5f024b;return _0x20f53b>=_0x3bdbfb?(_0x20f53b=_0x3bdbfb,_0x5f024b=0xc8):_0x5f024b=0xce,_0x1b23aa['status'](_0x5f024b),_0x1b23aa[_0x1cd5ca('0x1d')]('Content-Range',_0x14eade+'-'+_0x20f53b+'/'+_0x3bdbfb)[_0x1cd5ca('0x1e')](_0x4b0cbf);}return null;};}function saveUpdates(_0x3c14d9){return function(_0x1c5026){const _0x102b89=a17_0xa1f0;if(_0x1c5026)return _0x1c5026[_0x102b89('0x32')](_0x3c14d9)[_0x102b89('0x27')](function(_0x2b3415){return _0x2b3415;});return null;};}function removeEntity(_0x145f86){return function(_0x3b9fa5){const _0x41bf2c=a17_0xa1f0;if(_0x3b9fa5)return _0x3b9fa5['destroy']()[_0x41bf2c('0x27')](function(){const _0x8affdb=_0x41bf2c;_0x145f86['status'](0xcc)[_0x8affdb('0x1f')]();});};}function handleEntityNotFound(_0xa43f2a){return function(_0x39b22c){const _0x1c9b9e=a17_0xa1f0;return!_0x39b22c&&_0xa43f2a[_0x1c9b9e('0x2e')](0x194),_0x39b22c;};}function handleError(_0x138ae9,_0x31f0f9){return _0x31f0f9=_0x31f0f9||0x1f4,function(_0x29a6e5){const _0x8acdaf=a17_0xa1f0;logger[_0x8acdaf('0x21')](_0x29a6e5[_0x8acdaf('0x30')]),_0x29a6e5['name']&&delete _0x29a6e5[_0x8acdaf('0x12')],_0x138ae9['status'](_0x31f0f9)[_0x8acdaf('0x11')](_0x29a6e5);};}exports[_0x4c0d8c('0x23')]=function(_0x3b9634,_0x3812c2){const _0x2157a4=_0x4c0d8c;let _0x263c94={};const _0x2d8369={},_0x223461={'count':0x0,'rows':[]},_0x261cac=_[_0x2157a4('0x22')](db[_0x2157a4('0x1c')][_0x2157a4('0x28')],function(_0x5450ea){const _0x483a80=_0x2157a4;return{'name':_0x5450ea[_0x483a80('0x10')],'type':_0x5450ea[_0x483a80('0x1')]['key']};});_0x2d8369[_0x2157a4('0x25')]=_[_0x2157a4('0x22')](_0x261cac,_0x2157a4('0x12')),_0x2d8369[_0x2157a4('0x6')]=_['keys'](_0x3b9634['query']),_0x2d8369[_0x2157a4('0x4')]=_[_0x2157a4('0x9')](_0x2d8369[_0x2157a4('0x25')],_0x2d8369['query']),_0x263c94[_0x2157a4('0x1a')]=_[_0x2157a4('0x9')](_0x2d8369['model'],qs[_0x2157a4('0x20')](_0x3b9634[_0x2157a4('0x6')][_0x2157a4('0x20')])),_0x263c94[_0x2157a4('0x1a')]=_0x263c94[_0x2157a4('0x1a')][_0x2157a4('0x35')]?_0x263c94[_0x2157a4('0x1a')]:_0x2d8369[_0x2157a4('0x25')];typeof _0x3b9634[_0x2157a4('0x6')][_0x2157a4('0x2a')]==='undefined'&&(_0x263c94[_0x2157a4('0x8')]=qs['limit'](_0x3b9634['query'][_0x2157a4('0x8')]),_0x263c94['offset']=qs[_0x2157a4('0x15')](_0x3b9634[_0x2157a4('0x6')][_0x2157a4('0x15')]));_0x263c94[_0x2157a4('0x24')]=qs[_0x2157a4('0xe')](_0x3b9634[_0x2157a4('0x6')][_0x2157a4('0xe')]),_0x263c94[_0x2157a4('0x5')]=qs[_0x2157a4('0x4')](_[_0x2157a4('0x37')](_0x3b9634[_0x2157a4('0x6')],_0x2d8369[_0x2157a4('0x4')]),_0x261cac);_0x3b9634[_0x2157a4('0x6')][_0x2157a4('0xc')]&&(_0x263c94[_0x2157a4('0x5')]=_[_0x2157a4('0x38')](_0x263c94[_0x2157a4('0x5')],{[Op['or']]:_[_0x2157a4('0x22')](_0x261cac,function(_0x262467){const _0x278c01=_0x2157a4;if(_0x262467[_0x278c01('0x1')]!==_0x278c01('0x33')){const _0x526443={};return _0x526443[_0x262467['name']]={[Op['like']]:'%'+_0x3b9634[_0x278c01('0x6')][_0x278c01('0xc')]+'%'},_0x526443;}})}));_0x263c94=_['merge']({},_0x263c94,_0x3b9634[_0x2157a4('0x18')]);const _0x4c5f8b={'where':_0x263c94[_0x2157a4('0x5')]};return db[_0x2157a4('0x1c')][_0x2157a4('0x3')](_0x4c5f8b)[_0x2157a4('0x27')](function(_0x1294d9){const _0x2d720b=_0x2157a4;return _0x223461['count']=_0x1294d9,_0x3b9634[_0x2d720b('0x6')]['includeAll']&&(_0x263c94[_0x2d720b('0x19')]=[{'all':!![]}]),db['AnalyticFieldReport']['findAll'](_0x263c94);})['then'](function(_0x3b47e8){const _0xdd33f3=_0x2157a4;return _0x223461[_0xdd33f3('0xa')]=_0x3b47e8,_0x223461;})[_0x2157a4('0x27')](respondWithFilteredResult(_0x3812c2,_0x263c94))[_0x2157a4('0xf')](handleError(_0x3812c2,null));},exports[_0x4c0d8c('0x16')]=function(_0x530a3c,_0x56d8e3){const _0x22c4c9=_0x4c0d8c;let _0x1abdff={'raw':![],'where':{'id':_0x530a3c[_0x22c4c9('0x13')]['id']}};const _0xe1a7dd={};return _0xe1a7dd[_0x22c4c9('0x25')]=_[_0x22c4c9('0x34')](db[_0x22c4c9('0x1c')]['rawAttributes']),_0xe1a7dd[_0x22c4c9('0x6')]=_[_0x22c4c9('0x34')](_0x530a3c[_0x22c4c9('0x6')]),_0xe1a7dd[_0x22c4c9('0x4')]=_[_0x22c4c9('0x9')](_0xe1a7dd[_0x22c4c9('0x25')],_0xe1a7dd[_0x22c4c9('0x6')]),_0x1abdff['attributes']=_[_0x22c4c9('0x9')](_0xe1a7dd['model'],qs['fields'](_0x530a3c['query'][_0x22c4c9('0x20')])),_0x1abdff[_0x22c4c9('0x1a')]=_0x1abdff[_0x22c4c9('0x1a')][_0x22c4c9('0x35')]?_0x1abdff[_0x22c4c9('0x1a')]:_0xe1a7dd[_0x22c4c9('0x25')],_0x530a3c[_0x22c4c9('0x6')][_0x22c4c9('0x2d')]&&(_0x1abdff[_0x22c4c9('0x19')]=[{'all':!![]}]),_0x1abdff=_['merge']({},_0x1abdff,_0x530a3c['options']),db[_0x22c4c9('0x1c')][_0x22c4c9('0x2c')](_0x1abdff)['then'](handleEntityNotFound(_0x56d8e3,null))[_0x22c4c9('0x27')](respondWithResult(_0x56d8e3,null))['catch'](handleError(_0x56d8e3,null));},exports[_0x4c0d8c('0x14')]=function(_0x98a158,_0x1d58de){const _0x21c160=_0x4c0d8c;return db[_0x21c160('0x1c')][_0x21c160('0x14')](_0x98a158['body'],{})[_0x21c160('0x27')](respondWithResult(_0x1d58de,0xc9))[_0x21c160('0xf')](handleError(_0x1d58de,null));},exports[_0x4c0d8c('0x29')]=function(_0xea20f5,_0x1e17e8){const _0x49b701=_0x4c0d8c;return db[_0x49b701('0x1c')][_0x49b701('0x29')](_0xea20f5[_0x49b701('0x26')],{'raw':![],'individualHooks':!![]})[_0x49b701('0x27')](respondWithResult(_0x1e17e8,0xc9))[_0x49b701('0xf')](handleError(_0x1e17e8,null));},exports['update']=function(_0x3b3a36,_0x44afca){const _0xc612ba=_0x4c0d8c;return _0x3b3a36['body']['id']&&delete _0x3b3a36['body']['id'],db[_0xc612ba('0x1c')][_0xc612ba('0x2c')]({'where':{'id':_0x3b3a36[_0xc612ba('0x13')]['id']}})['then'](handleEntityNotFound(_0x44afca,null))['then'](saveUpdates(_0x3b3a36[_0xc612ba('0x26')],null))[_0xc612ba('0x27')](respondWithResult(_0x44afca,null))[_0xc612ba('0xf')](handleError(_0x44afca,null));},exports['destroy']=function(_0x336c6d,_0xb915f0){const _0xa4a333=_0x4c0d8c;return db['AnalyticFieldReport'][_0xa4a333('0x2c')]({'where':{'id':_0x336c6d[_0xa4a333('0x13')]['id']}})[_0xa4a333('0x27')](handleEntityNotFound(_0xb915f0,null))[_0xa4a333('0x27')](removeEntity(_0xb915f0,null))['catch'](handleError(_0xb915f0,null));},exports['bulkDestroy']=function(_0x8adf8b,_0x44439d){const _0x24157e=_0x4c0d8c;return db[_0x24157e('0x1c')]['destroy']({'where':{'id':_0x8adf8b[_0x24157e('0x6')]['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x44439d,0xcc))['catch'](handleError(_0x44439d,null));},exports[_0x4c0d8c('0x17')]=function(_0x122eb1,_0x238993){const _0x677a47=_0x4c0d8c;return db[_0x677a47('0x36')]['findOne']({'where':{'id':_0x122eb1[_0x677a47('0x13')]['id']}})['then'](handleEntityNotFound(_0x238993,null))[_0x677a47('0x27')](function(_0x38667f){const _0x1373aa=_0x677a47;if(_0x38667f)return db['sequelize'][_0x1373aa('0x2')](function(_0x508c59){const _0x1780ae=_0x1373aa;return db['AnalyticFieldReport'][_0x1780ae('0x2b')]({'where':{'CustomReportId':_0x122eb1[_0x1780ae('0x13')]['id']},'transaction':_0x508c59})[_0x1780ae('0x27')](function(){const _0x2dafd4=_0x1780ae,_0x4a9236=_[_0x2dafd4('0x22')](_0x122eb1[_0x2dafd4('0x26')],function(_0x2c1469){const _0x3f19ad=_0x2dafd4;return delete _0x2c1469['id'],_0x2c1469[_0x3f19ad('0x31')]=_0x122eb1[_0x3f19ad('0x13')]['id'],_0x2c1469;});return db[_0x2dafd4('0x1c')][_0x2dafd4('0x29')](_0x4a9236,{'transaction':_0x508c59});});})[_0x1373aa('0x27')](function(){const _0x3218c8=_0x1373aa;return db[_0x3218c8('0x1c')][_0x3218c8('0xd')]({'where':{'CustomReportId':_0x122eb1[_0x3218c8('0x13')]['id']}});});})[_0x677a47('0x27')](respondWithResult(_0x238993,null))[_0x677a47('0xf')](handleError(_0x238993,null));};
\ No newline at end of file
+const a17_0x5c67=['index','api','options','update','undefined','AnalyticFieldReport','AnalyticCustomReport','show','map','body','type','fieldName','intersection','bulkDestroy','status','count','include','includeAll','sequelize','rawAttributes','stack','ids','where','rows','send','lodash','query','model','catch','params','then','fields','merge','offset','filters','end','filter','../../mysqldb','sendStatus','bulkCreate','../../components/parsers/qs','findAll','attributes','limit','keys','json','create','set','destroy','findOne','sort','transaction','length','Content-Range','addFields','name','like'];(function(_0xa4cb82,_0x5c677d){const _0x473c29=function(_0xeea592){while(--_0xeea592){_0xa4cb82['push'](_0xa4cb82['shift']());}};_0x473c29(++_0x5c677d);}(a17_0x5c67,0xe6));const a17_0x473c=function(_0xa4cb82,_0x5c677d){_0xa4cb82=_0xa4cb82-0x0;let _0x473c29=a17_0x5c67[_0xa4cb82];return _0x473c29;};const _0x468e38=a17_0x473c;'use strict';const _=require(_0x468e38('0x17')),qs=require(_0x468e38('0x26')),logger=require('../../config/logger')(_0x468e38('0x38')),db=require(_0x468e38('0x23'))['db'],{Op}=require(_0x468e38('0x10'));function respondWithResult(_0xeea592,_0x5d5903){return _0x5d5903=_0x5d5903||0xc8,function(_0x2b84bb){const _0x1fdb3c=a17_0x473c;if(_0x2b84bb)return _0xeea592[_0x1fdb3c('0xc')](_0x5d5903)[_0x1fdb3c('0x2b')](_0x2b84bb);};}function respondWithFilteredResult(_0x38538c,_0x4243c0){return function(_0x1971dc){const _0x355a34=a17_0x473c;if(_0x1971dc){const _0x57be12=_0x1971dc[_0x355a34('0xd')],_0x41d7d1=_0x4243c0[_0x355a34('0x1f')];let _0xfdef8d=_0x4243c0[_0x355a34('0x1f')]+_0x4243c0['limit'],_0x317545;return _0xfdef8d>=_0x57be12?(_0xfdef8d=_0x57be12,_0x317545=0xc8):_0x317545=0xce,_0x38538c[_0x355a34('0xc')](_0x317545),_0x38538c[_0x355a34('0x2d')](_0x355a34('0x33'),_0x41d7d1+'-'+_0xfdef8d+'/'+_0x57be12)['json'](_0x1971dc);}return null;};}function saveUpdates(_0x31fcc9){return function(_0x1a9cf4){const _0x30a5c5=a17_0x473c;if(_0x1a9cf4)return _0x1a9cf4[_0x30a5c5('0x1')](_0x31fcc9)['then'](function(_0xbe683d){return _0xbe683d;});return null;};}function removeEntity(_0x573027){return function(_0x5c6773){const _0x12aca1=a17_0x473c;if(_0x5c6773)return _0x5c6773[_0x12aca1('0x2e')]()[_0x12aca1('0x1c')](function(){const _0x16ae95=_0x12aca1;_0x573027[_0x16ae95('0xc')](0xcc)[_0x16ae95('0x21')]();});};}function handleEntityNotFound(_0x57c6df){return function(_0x55bad4){const _0xb5265f=a17_0x473c;return!_0x55bad4&&_0x57c6df[_0xb5265f('0x24')](0x194),_0x55bad4;};}function handleError(_0x552d07,_0x4ade29){return _0x4ade29=_0x4ade29||0x1f4,function(_0x5e0413){const _0x1640d1=a17_0x473c;logger['error'](_0x5e0413[_0x1640d1('0x12')]),_0x5e0413[_0x1640d1('0x35')]&&delete _0x5e0413[_0x1640d1('0x35')],_0x552d07[_0x1640d1('0xc')](_0x4ade29)[_0x1640d1('0x16')](_0x5e0413);};}exports[_0x468e38('0x37')]=function(_0x5c7950,_0x5a1572){const _0x3bd802=_0x468e38;let _0x2ab309={};const _0x466707={},_0x2e1600={'count':0x0,'rows':[]},_0x52392c=_['map'](db[_0x3bd802('0x3')][_0x3bd802('0x11')],function(_0x5e1e68){const _0x23d5bd=_0x3bd802;return{'name':_0x5e1e68[_0x23d5bd('0x9')],'type':_0x5e1e68[_0x23d5bd('0x8')]['key']};});_0x466707['model']=_[_0x3bd802('0x6')](_0x52392c,_0x3bd802('0x35')),_0x466707[_0x3bd802('0x18')]=_['keys'](_0x5c7950[_0x3bd802('0x18')]),_0x466707[_0x3bd802('0x20')]=_[_0x3bd802('0xa')](_0x466707[_0x3bd802('0x19')],_0x466707['query']),_0x2ab309['attributes']=_[_0x3bd802('0xa')](_0x466707[_0x3bd802('0x19')],qs[_0x3bd802('0x1d')](_0x5c7950[_0x3bd802('0x18')][_0x3bd802('0x1d')])),_0x2ab309[_0x3bd802('0x28')]=_0x2ab309[_0x3bd802('0x28')][_0x3bd802('0x32')]?_0x2ab309[_0x3bd802('0x28')]:_0x466707[_0x3bd802('0x19')];typeof _0x5c7950['query']['nolimit']===_0x3bd802('0x2')&&(_0x2ab309[_0x3bd802('0x29')]=qs[_0x3bd802('0x29')](_0x5c7950[_0x3bd802('0x18')][_0x3bd802('0x29')]),_0x2ab309[_0x3bd802('0x1f')]=qs['offset'](_0x5c7950[_0x3bd802('0x18')][_0x3bd802('0x1f')]));_0x2ab309['order']=qs['sort'](_0x5c7950[_0x3bd802('0x18')][_0x3bd802('0x30')]),_0x2ab309[_0x3bd802('0x14')]=qs['filters'](_['pick'](_0x5c7950['query'],_0x466707['filters']),_0x52392c);_0x5c7950['query'][_0x3bd802('0x22')]&&(_0x2ab309['where']=_['merge'](_0x2ab309[_0x3bd802('0x14')],{[Op['or']]:_['map'](_0x52392c,function(_0x30f8e7){const _0x18d35a=_0x3bd802;if(_0x30f8e7['type']!=='VIRTUAL'){const _0xe52cba={};return _0xe52cba[_0x30f8e7[_0x18d35a('0x35')]]={[Op[_0x18d35a('0x36')]]:'%'+_0x5c7950[_0x18d35a('0x18')][_0x18d35a('0x22')]+'%'},_0xe52cba;}})}));_0x2ab309=_[_0x3bd802('0x1e')]({},_0x2ab309,_0x5c7950[_0x3bd802('0x0')]);const _0x24fb20={'where':_0x2ab309[_0x3bd802('0x14')]};return db[_0x3bd802('0x3')]['count'](_0x24fb20)[_0x3bd802('0x1c')](function(_0x5b72c6){const _0x42651e=_0x3bd802;return _0x2e1600[_0x42651e('0xd')]=_0x5b72c6,_0x5c7950[_0x42651e('0x18')][_0x42651e('0xf')]&&(_0x2ab309['include']=[{'all':!![]}]),db['AnalyticFieldReport'][_0x42651e('0x27')](_0x2ab309);})[_0x3bd802('0x1c')](function(_0x150d7d){const _0x1f0861=_0x3bd802;return _0x2e1600[_0x1f0861('0x15')]=_0x150d7d,_0x2e1600;})[_0x3bd802('0x1c')](respondWithFilteredResult(_0x5a1572,_0x2ab309))['catch'](handleError(_0x5a1572,null));},exports[_0x468e38('0x5')]=function(_0x37bd6f,_0x2d5d2a){const _0x52356b=_0x468e38;let _0x3c704d={'raw':![],'where':{'id':_0x37bd6f[_0x52356b('0x1b')]['id']}};const _0x5762f0={};return _0x5762f0[_0x52356b('0x19')]=_[_0x52356b('0x2a')](db['AnalyticFieldReport']['rawAttributes']),_0x5762f0[_0x52356b('0x18')]=_[_0x52356b('0x2a')](_0x37bd6f[_0x52356b('0x18')]),_0x5762f0[_0x52356b('0x20')]=_['intersection'](_0x5762f0['model'],_0x5762f0[_0x52356b('0x18')]),_0x3c704d['attributes']=_[_0x52356b('0xa')](_0x5762f0[_0x52356b('0x19')],qs['fields'](_0x37bd6f[_0x52356b('0x18')][_0x52356b('0x1d')])),_0x3c704d[_0x52356b('0x28')]=_0x3c704d['attributes'][_0x52356b('0x32')]?_0x3c704d[_0x52356b('0x28')]:_0x5762f0[_0x52356b('0x19')],_0x37bd6f['query'][_0x52356b('0xf')]&&(_0x3c704d[_0x52356b('0xe')]=[{'all':!![]}]),_0x3c704d=_[_0x52356b('0x1e')]({},_0x3c704d,_0x37bd6f[_0x52356b('0x0')]),db['AnalyticFieldReport'][_0x52356b('0x2f')](_0x3c704d)[_0x52356b('0x1c')](handleEntityNotFound(_0x2d5d2a,null))[_0x52356b('0x1c')](respondWithResult(_0x2d5d2a,null))['catch'](handleError(_0x2d5d2a,null));},exports[_0x468e38('0x2c')]=function(_0x52e3ba,_0x369094){const _0x53a46d=_0x468e38;return db[_0x53a46d('0x3')][_0x53a46d('0x2c')](_0x52e3ba[_0x53a46d('0x7')],{})[_0x53a46d('0x1c')](respondWithResult(_0x369094,0xc9))['catch'](handleError(_0x369094,null));},exports[_0x468e38('0x25')]=function(_0x5309f1,_0x15d231){const _0x57dd23=_0x468e38;return db[_0x57dd23('0x3')][_0x57dd23('0x25')](_0x5309f1[_0x57dd23('0x7')],{'raw':![],'individualHooks':!![]})[_0x57dd23('0x1c')](respondWithResult(_0x15d231,0xc9))['catch'](handleError(_0x15d231,null));},exports[_0x468e38('0x1')]=function(_0x1333bb,_0x4fd18a){const _0x58d3e5=_0x468e38;return _0x1333bb['body']['id']&&delete _0x1333bb[_0x58d3e5('0x7')]['id'],db[_0x58d3e5('0x3')][_0x58d3e5('0x2f')]({'where':{'id':_0x1333bb[_0x58d3e5('0x1b')]['id']}})['then'](handleEntityNotFound(_0x4fd18a,null))[_0x58d3e5('0x1c')](saveUpdates(_0x1333bb['body'],null))['then'](respondWithResult(_0x4fd18a,null))[_0x58d3e5('0x1a')](handleError(_0x4fd18a,null));},exports[_0x468e38('0x2e')]=function(_0x22323f,_0x12db3c){const _0x32c6a3=_0x468e38;return db[_0x32c6a3('0x3')][_0x32c6a3('0x2f')]({'where':{'id':_0x22323f[_0x32c6a3('0x1b')]['id']}})[_0x32c6a3('0x1c')](handleEntityNotFound(_0x12db3c,null))[_0x32c6a3('0x1c')](removeEntity(_0x12db3c,null))[_0x32c6a3('0x1a')](handleError(_0x12db3c,null));},exports[_0x468e38('0xb')]=function(_0x2a697e,_0x48e309){const _0x558b2c=_0x468e38;return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x2a697e[_0x558b2c('0x18')][_0x558b2c('0x13')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x48e309,0xcc))[_0x558b2c('0x1a')](handleError(_0x48e309,null));},exports[_0x468e38('0x34')]=function(_0x300917,_0x269cac){const _0x4ff430=_0x468e38;return db[_0x4ff430('0x4')]['findOne']({'where':{'id':_0x300917[_0x4ff430('0x1b')]['id']}})[_0x4ff430('0x1c')](handleEntityNotFound(_0x269cac,null))[_0x4ff430('0x1c')](function(_0x1ba207){const _0x5ae9e8=_0x4ff430;if(_0x1ba207)return db[_0x5ae9e8('0x10')][_0x5ae9e8('0x31')](function(_0x1f1179){const _0x46c711=_0x5ae9e8;return db[_0x46c711('0x3')][_0x46c711('0x2e')]({'where':{'CustomReportId':_0x300917['params']['id']},'transaction':_0x1f1179})[_0x46c711('0x1c')](function(){const _0x18597e=_0x46c711,_0x220755=_[_0x18597e('0x6')](_0x300917['body'],function(_0x1411fe){const _0x514dd2=_0x18597e;return delete _0x1411fe['id'],_0x1411fe['CustomReportId']=_0x300917[_0x514dd2('0x1b')]['id'],_0x1411fe;});return db['AnalyticFieldReport']['bulkCreate'](_0x220755,{'transaction':_0x1f1179});});})[_0x5ae9e8('0x1c')](function(){const _0x11652d=_0x5ae9e8;return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x300917[_0x11652d('0x1b')]['id']}});});})[_0x4ff430('0x1c')](respondWithResult(_0x269cac,null))[_0x4ff430('0x1a')](handleError(_0x269cac,null));};
\ No newline at end of file