Built motion from commit ded33658aad58fc8de845a8299a9db59a88cc353. Version 3.0.0...
[motion-next.git] / server / api / schedule / schedule.controller.js
index 79d65d7..c347122 100644 (file)
@@ -1 +1 @@
-const a530_0x141c=['includeAll','Schedule','count','attributes','limit','key','options','length','stack','findOne','fields','filters','order','where','status','../../config/schedule','../../components/parsers/qs','type','body','undefined','VIRTUAL','destroy','offset','create','fieldName','sequelize','Content-Range','Unable\x20to\x20retrieve\x20the\x20current\x20user','show','update','filter','intersection','query','nolimit','end','../../config/logger','like','catch','run','json','lodash','merge','error','Scheduler','then','user','sort','sendStatus','pick','role','params','model','keys','get','rawAttributes','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','api','name','findAll','include','../../mysqldb','send','map'];(function(_0x51c6bc,_0x141c57){const _0x4d5cae=function(_0x4dadce){while(--_0x4dadce){_0x51c6bc['push'](_0x51c6bc['shift']());}};_0x4d5cae(++_0x141c57);}(a530_0x141c,0xd7));const a530_0x4d5c=function(_0x51c6bc,_0x141c57){_0x51c6bc=_0x51c6bc-0x0;let _0x4d5cae=a530_0x141c[_0x51c6bc];return _0x4d5cae;};const _0x13454e=a530_0x4d5c;'use strict';const _=require(_0x13454e('0x11')),qs=require(_0x13454e('0x39')),logger=require(_0x13454e('0xc'))(_0x13454e('0x22')),db=require(_0x13454e('0x26'))['db'],{Op}=require(_0x13454e('0x2'));function respondWithStatusCode(_0x4dadce,_0x4e7199){return _0x4e7199=_0x4e7199||0xcc,function(_0x3dd99b){const _0x207c80=a530_0x4d5c;if(_0x3dd99b)return _0x4dadce[_0x207c80('0x18')](_0x4e7199);return _0x4dadce[_0x207c80('0x37')](_0x4e7199)[_0x207c80('0xb')]();};}function respondWithResult(_0x1250bc,_0x3c51db){return _0x3c51db=_0x3c51db||0xc8,function(_0x596605){const _0x377840=a530_0x4d5c;if(_0x596605)return _0x1250bc[_0x377840('0x37')](_0x3c51db)[_0x377840('0x10')](_0x596605);};}function respondWithFilteredResult(_0x2a20e1,_0x5a99e9){return function(_0x27cfa8){const _0x21000e=a530_0x4d5c;if(_0x27cfa8){const _0x522dab=_0x27cfa8[_0x21000e('0x2b')],_0xffebcc=_0x5a99e9[_0x21000e('0x3f')];let _0x37b8be=_0x5a99e9[_0x21000e('0x3f')]+_0x5a99e9['limit'],_0x2c69ea;return _0x37b8be>=_0x522dab?(_0x37b8be=_0x522dab,_0x2c69ea=0xc8):_0x2c69ea=0xce,_0x2a20e1[_0x21000e('0x37')](_0x2c69ea),_0x2a20e1['set'](_0x21000e('0x3'),_0xffebcc+'-'+_0x37b8be+'/'+_0x522dab)[_0x21000e('0x10')](_0x27cfa8);}return null;};}function saveUpdates(_0x5895da){return function(_0x10a1ad){const _0x31c348=a530_0x4d5c;if(_0x10a1ad)return _0x10a1ad[_0x31c348('0x6')](_0x5895da)[_0x31c348('0x15')](function(_0x11af59){return _0x11af59;});return null;};}function removeEntity(_0x151be9){return function(_0x592e73){const _0x5ed1bd=a530_0x4d5c;if(_0x592e73)return _0x592e73[_0x5ed1bd('0x3e')]()[_0x5ed1bd('0x15')](function(){const _0x22164c=_0x5ed1bd,_0x7c04f5=_0x592e73[_0x22164c('0x1e')]({'plain':!![]}),_0x58998e=_0x22164c('0x14');return db[_0x22164c('0x20')]['destroy']({'where':{'type':_0x58998e,'resourceId':_0x7c04f5['id']}})[_0x22164c('0x15')](function(){return _0x592e73;});})[_0x5ed1bd('0x15')](function(){const _0x75be5b=_0x5ed1bd;_0x151be9[_0x75be5b('0x37')](0xcc)[_0x75be5b('0xb')]();});};}function handleEntityNotFound(_0x530d28){return function(_0x45c029){const _0x5cdaeb=a530_0x4d5c;return!_0x45c029&&_0x530d28[_0x5cdaeb('0x18')](0x194),_0x45c029;};}function handleError(_0x3ef944,_0x57208e){return _0x57208e=_0x57208e||0x1f4,function(_0x2343fa){const _0x3ee95b=a530_0x4d5c;logger[_0x3ee95b('0x13')](_0x2343fa[_0x3ee95b('0x31')]),_0x2343fa[_0x3ee95b('0x23')]&&delete _0x2343fa[_0x3ee95b('0x23')],_0x3ef944[_0x3ee95b('0x37')](_0x57208e)[_0x3ee95b('0x27')](_0x2343fa);};}exports['index']=function(_0x325e72,_0x253917){const _0x20d0e2=_0x13454e;let _0x4d2d00={};const _0x321485={},_0x35f923={'count':0x0,'rows':[]},_0x3fd05e=_[_0x20d0e2('0x28')](db[_0x20d0e2('0x2a')][_0x20d0e2('0x1f')],function(_0x3e6363){const _0x9e30e3=_0x20d0e2;return{'name':_0x3e6363[_0x9e30e3('0x1')],'type':_0x3e6363[_0x9e30e3('0x3a')][_0x9e30e3('0x2e')]};});_0x321485[_0x20d0e2('0x1c')]=_[_0x20d0e2('0x28')](_0x3fd05e,_0x20d0e2('0x23')),_0x321485[_0x20d0e2('0x9')]=_[_0x20d0e2('0x1d')](_0x325e72[_0x20d0e2('0x9')]),_0x321485[_0x20d0e2('0x34')]=_[_0x20d0e2('0x8')](_0x321485['model'],_0x321485[_0x20d0e2('0x9')]),_0x4d2d00[_0x20d0e2('0x2c')]=_[_0x20d0e2('0x8')](_0x321485['model'],qs['fields'](_0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0x33')])),_0x4d2d00[_0x20d0e2('0x2c')]=_0x4d2d00[_0x20d0e2('0x2c')][_0x20d0e2('0x30')]?_0x4d2d00['attributes']:_0x321485[_0x20d0e2('0x1c')];typeof _0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0xa')]===_0x20d0e2('0x3c')&&(_0x4d2d00[_0x20d0e2('0x2d')]=qs[_0x20d0e2('0x2d')](_0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0x2d')]),_0x4d2d00[_0x20d0e2('0x3f')]=qs['offset'](_0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0x3f')]));_0x4d2d00[_0x20d0e2('0x35')]=qs['sort'](_0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0x17')]),_0x4d2d00[_0x20d0e2('0x36')]=qs[_0x20d0e2('0x34')](_[_0x20d0e2('0x19')](_0x325e72[_0x20d0e2('0x9')],_0x321485[_0x20d0e2('0x34')]),_0x3fd05e);_0x325e72[_0x20d0e2('0x9')][_0x20d0e2('0x7')]&&(_0x4d2d00[_0x20d0e2('0x36')]=_[_0x20d0e2('0x12')](_0x4d2d00[_0x20d0e2('0x36')],{[Op['or']]:_[_0x20d0e2('0x28')](_0x3fd05e,function(_0x4c6038){const _0x7f36db=_0x20d0e2;if(_0x4c6038[_0x7f36db('0x3a')]!==_0x7f36db('0x3d')){const _0x2c3105={};return _0x2c3105[_0x4c6038[_0x7f36db('0x23')]]={[Op[_0x7f36db('0xd')]]:'%'+_0x325e72[_0x7f36db('0x9')][_0x7f36db('0x7')]+'%'},_0x2c3105;}})}));_0x4d2d00=_[_0x20d0e2('0x12')]({},_0x4d2d00,_0x325e72[_0x20d0e2('0x2f')]);const _0x27180b={'where':_0x4d2d00[_0x20d0e2('0x36')]};return db[_0x20d0e2('0x2a')][_0x20d0e2('0x2b')](_0x27180b)[_0x20d0e2('0x15')](function(_0xe32119){const _0x5bb14d=_0x20d0e2;return _0x35f923['count']=_0xe32119,_0x325e72['query'][_0x5bb14d('0x29')]&&(_0x4d2d00[_0x5bb14d('0x25')]=[{'all':!![]}]),db[_0x5bb14d('0x2a')][_0x5bb14d('0x24')](_0x4d2d00);})[_0x20d0e2('0x15')](function(_0x278bff){return _0x35f923['rows']=_0x278bff,_0x35f923;})[_0x20d0e2('0x15')](respondWithFilteredResult(_0x253917,_0x4d2d00))[_0x20d0e2('0xe')](handleError(_0x253917,null));},exports[_0x13454e('0x5')]=function(_0x1e7722,_0x278f12){const _0x2b8692=_0x13454e;let _0x41ff48={'raw':![],'where':{'id':_0x1e7722['params']['id']}};const _0x2d5ceb={};return _0x2d5ceb['model']=_[_0x2b8692('0x1d')](db[_0x2b8692('0x2a')]['rawAttributes']),_0x2d5ceb[_0x2b8692('0x9')]=_[_0x2b8692('0x1d')](_0x1e7722[_0x2b8692('0x9')]),_0x2d5ceb[_0x2b8692('0x34')]=_['intersection'](_0x2d5ceb[_0x2b8692('0x1c')],_0x2d5ceb[_0x2b8692('0x9')]),_0x41ff48[_0x2b8692('0x2c')]=_[_0x2b8692('0x8')](_0x2d5ceb['model'],qs[_0x2b8692('0x33')](_0x1e7722[_0x2b8692('0x9')][_0x2b8692('0x33')])),_0x41ff48[_0x2b8692('0x2c')]=_0x41ff48[_0x2b8692('0x2c')][_0x2b8692('0x30')]?_0x41ff48[_0x2b8692('0x2c')]:_0x2d5ceb[_0x2b8692('0x1c')],_0x1e7722[_0x2b8692('0x9')][_0x2b8692('0x29')]&&(_0x41ff48[_0x2b8692('0x25')]=[{'all':!![]}]),_0x41ff48=_[_0x2b8692('0x12')]({},_0x41ff48,_0x1e7722[_0x2b8692('0x2f')]),db[_0x2b8692('0x2a')][_0x2b8692('0x32')](_0x41ff48)[_0x2b8692('0x15')](handleEntityNotFound(_0x278f12,null))[_0x2b8692('0x15')](respondWithResult(_0x278f12,null))[_0x2b8692('0xe')](handleError(_0x278f12,null));},exports[_0x13454e('0x0')]=function(_0x2d356a,_0x35c7f9){const _0x32556e=_0x13454e;return db[_0x32556e('0x2a')][_0x32556e('0x0')](_0x2d356a[_0x32556e('0x3b')],{})[_0x32556e('0x15')](function(_0x9e23c2){const _0x573479=_0x32556e,_0x2510be=_0x2d356a[_0x573479('0x16')][_0x573479('0x1e')]({'plain':!![]});if(!_0x2510be)throw new Error(_0x573479('0x4'));if(_0x2510be[_0x573479('0x1a')]===_0x573479('0x16')){const _0x63d591=_0x9e23c2['get']({'plain':!![]}),_0x32fc70='Scheduler';return db['UserProfileSection'][_0x573479('0x32')]({'where':{'name':_0x32fc70,'userProfileId':_0x2510be['userProfileId']},'raw':!![]})[_0x573479('0x15')](function(_0xa855b7){const _0x59da97=_0x573479;return _0xa855b7&&_0xa855b7['autoAssociation']===0x0?db[_0x59da97('0x20')][_0x59da97('0x0')]({'name':_0x63d591['name'],'resourceId':_0x63d591['id'],'type':_0xa855b7[_0x59da97('0x23')],'sectionId':_0xa855b7['id']},{})[_0x59da97('0x15')](function(){return _0x9e23c2;}):_0x9e23c2;})[_0x573479('0xe')](function(_0x47fef6){const _0x42016d=_0x573479;logger['error'](_0x42016d('0x21'),_0x47fef6);throw _0x47fef6;});}return _0x9e23c2;})[_0x32556e('0x15')](respondWithResult(_0x35c7f9,0xc9))[_0x32556e('0xe')](handleError(_0x35c7f9,null));},exports[_0x13454e('0x6')]=function(_0x51f8ae,_0x459e1d){const _0x146f32=_0x13454e;return _0x51f8ae[_0x146f32('0x3b')]['id']&&delete _0x51f8ae['body']['id'],db[_0x146f32('0x2a')][_0x146f32('0x32')]({'where':{'id':_0x51f8ae[_0x146f32('0x1b')]['id']}})['then'](handleEntityNotFound(_0x459e1d,null))['then'](saveUpdates(_0x51f8ae[_0x146f32('0x3b')],null))[_0x146f32('0x15')](respondWithResult(_0x459e1d,null))['catch'](handleError(_0x459e1d,null));},exports['destroy']=function(_0x17eeff,_0x579a69){const _0x2b85dd=_0x13454e;return db[_0x2b85dd('0x2a')][_0x2b85dd('0x32')]({'where':{'id':_0x17eeff[_0x2b85dd('0x1b')]['id']}})[_0x2b85dd('0x15')](handleEntityNotFound(_0x579a69,null))[_0x2b85dd('0x15')](removeEntity(_0x579a69,null))[_0x2b85dd('0xe')](handleError(_0x579a69,null));},exports[_0x13454e('0xf')]=function(_0x2cd895,_0x3d57f4){const _0x21bf1e=_0x13454e,_0x2bde16=require(_0x21bf1e('0x38'));return db[_0x21bf1e('0x2a')][_0x21bf1e('0x32')]({'where':{'id':_0x2cd895[_0x21bf1e('0x1b')]['id']},'raw':!![]})[_0x21bf1e('0x15')](handleEntityNotFound(_0x3d57f4,null))[_0x21bf1e('0x15')](function(){const _0x28e4b5=_0x21bf1e;_0x2bde16['run'](_0x2cd895[_0x28e4b5('0x1b')]['id']);})[_0x21bf1e('0x15')](respondWithStatusCode(_0x3d57f4,null))['catch'](handleError(_0x3d57f4,null));};
\ No newline at end of file
+const a530_0xc54d=['Scheduler','params','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','where','filter','undefined','options','merge','length','user','Content-Range','json','index','pick','run','keys','send','error','api','stack','Unable\x20to\x20retrieve\x20the\x20current\x20user','sort','lodash','map','fields','model','userProfileId','destroy','query','includeAll','set','then','rawAttributes','fieldName','intersection','end','sendStatus','findOne','offset','key','get','count','VIRTUAL','status','body','type','include','filters','sequelize','attributes','name','autoAssociation','nolimit','UserProfileResource','like','Schedule','catch','findAll','role','limit','create'];(function(_0x4f4c44,_0xc54d31){const _0x206665=function(_0x46ae9e){while(--_0x46ae9e){_0x4f4c44['push'](_0x4f4c44['shift']());}};_0x206665(++_0xc54d31);}(a530_0xc54d,0xeb));const a530_0x2066=function(_0x4f4c44,_0xc54d31){_0x4f4c44=_0x4f4c44-0x0;let _0x206665=a530_0xc54d[_0x4f4c44];return _0x206665;};const _0x1e3329=a530_0x2066;'use strict';const _=require(_0x1e3329('0x1f')),qs=require('../../components/parsers/qs'),logger=require('../../config/logger')(_0x1e3329('0x1b')),db=require('../../mysqldb')['db'],{Op}=require(_0x1e3329('0x39'));function respondWithStatusCode(_0x46ae9e,_0x43e011){return _0x43e011=_0x43e011||0xcc,function(_0x3558e6){const _0x139bd2=a530_0x2066;if(_0x3558e6)return _0x46ae9e[_0x139bd2('0x2d')](_0x43e011);return _0x46ae9e[_0x139bd2('0x34')](_0x43e011)[_0x139bd2('0x2c')]();};}function respondWithResult(_0x1903e5,_0x8dae2d){return _0x8dae2d=_0x8dae2d||0xc8,function(_0x49c9c7){const _0x33189c=a530_0x2066;if(_0x49c9c7)return _0x1903e5[_0x33189c('0x34')](_0x8dae2d)[_0x33189c('0x14')](_0x49c9c7);};}function respondWithFilteredResult(_0x32de79,_0x3427fe){return function(_0x253c0e){const _0x30e86e=a530_0x2066;if(_0x253c0e){const _0x1af3e8=_0x253c0e[_0x30e86e('0x32')],_0x3e3e69=_0x3427fe[_0x30e86e('0x2f')];let _0x3146d1=_0x3427fe[_0x30e86e('0x2f')]+_0x3427fe[_0x30e86e('0x7')],_0x103208;return _0x3146d1>=_0x1af3e8?(_0x3146d1=_0x1af3e8,_0x103208=0xc8):_0x103208=0xce,_0x32de79['status'](_0x103208),_0x32de79[_0x30e86e('0x27')](_0x30e86e('0x13'),_0x3e3e69+'-'+_0x3146d1+'/'+_0x1af3e8)['json'](_0x253c0e);}return null;};}function saveUpdates(_0x7912bb){return function(_0x272b6e){if(_0x272b6e)return _0x272b6e['update'](_0x7912bb)['then'](function(_0x52abd8){return _0x52abd8;});return null;};}function removeEntity(_0x2b0e95){return function(_0x2761da){const _0x5371ae=a530_0x2066;if(_0x2761da)return _0x2761da[_0x5371ae('0x24')]()[_0x5371ae('0x28')](function(){const _0x4e754e=_0x5371ae,_0x2b9f1f=_0x2761da[_0x4e754e('0x31')]({'plain':!![]}),_0x115232=_0x4e754e('0x9');return db[_0x4e754e('0x1')][_0x4e754e('0x24')]({'where':{'type':_0x115232,'resourceId':_0x2b9f1f['id']}})['then'](function(){return _0x2761da;});})[_0x5371ae('0x28')](function(){const _0x35bd58=_0x5371ae;_0x2b0e95[_0x35bd58('0x34')](0xcc)[_0x35bd58('0x2c')]();});};}function handleEntityNotFound(_0x4378c9){return function(_0x2bec4b){const _0x42f2f4=a530_0x2066;return!_0x2bec4b&&_0x4378c9[_0x42f2f4('0x2d')](0x194),_0x2bec4b;};}function handleError(_0x51e5ea,_0x312932){return _0x312932=_0x312932||0x1f4,function(_0xe67761){const _0x268c08=a530_0x2066;logger[_0x268c08('0x1a')](_0xe67761[_0x268c08('0x1c')]),_0xe67761[_0x268c08('0x3b')]&&delete _0xe67761['name'],_0x51e5ea[_0x268c08('0x34')](_0x312932)[_0x268c08('0x19')](_0xe67761);};}exports[_0x1e3329('0x15')]=function(_0x49a17c,_0x30632c){const _0x2f4118=_0x1e3329;let _0x4c3037={};const _0x4caed0={},_0x47d6be={'count':0x0,'rows':[]},_0x142ca7=_[_0x2f4118('0x20')](db['Schedule'][_0x2f4118('0x29')],function(_0x5ad7d5){const _0x4eda7e=_0x2f4118;return{'name':_0x5ad7d5[_0x4eda7e('0x2a')],'type':_0x5ad7d5[_0x4eda7e('0x36')][_0x4eda7e('0x30')]};});_0x4caed0[_0x2f4118('0x22')]=_[_0x2f4118('0x20')](_0x142ca7,_0x2f4118('0x3b')),_0x4caed0[_0x2f4118('0x25')]=_[_0x2f4118('0x18')](_0x49a17c['query']),_0x4caed0['filters']=_[_0x2f4118('0x2b')](_0x4caed0[_0x2f4118('0x22')],_0x4caed0[_0x2f4118('0x25')]),_0x4c3037[_0x2f4118('0x3a')]=_[_0x2f4118('0x2b')](_0x4caed0[_0x2f4118('0x22')],qs[_0x2f4118('0x21')](_0x49a17c[_0x2f4118('0x25')][_0x2f4118('0x21')])),_0x4c3037[_0x2f4118('0x3a')]=_0x4c3037[_0x2f4118('0x3a')][_0x2f4118('0x11')]?_0x4c3037[_0x2f4118('0x3a')]:_0x4caed0['model'];typeof _0x49a17c[_0x2f4118('0x25')][_0x2f4118('0x0')]===_0x2f4118('0xe')&&(_0x4c3037[_0x2f4118('0x7')]=qs['limit'](_0x49a17c[_0x2f4118('0x25')]['limit']),_0x4c3037[_0x2f4118('0x2f')]=qs[_0x2f4118('0x2f')](_0x49a17c['query'][_0x2f4118('0x2f')]));_0x4c3037['order']=qs[_0x2f4118('0x1e')](_0x49a17c['query']['sort']),_0x4c3037[_0x2f4118('0xc')]=qs[_0x2f4118('0x38')](_[_0x2f4118('0x16')](_0x49a17c[_0x2f4118('0x25')],_0x4caed0[_0x2f4118('0x38')]),_0x142ca7);_0x49a17c[_0x2f4118('0x25')][_0x2f4118('0xd')]&&(_0x4c3037[_0x2f4118('0xc')]=_[_0x2f4118('0x10')](_0x4c3037[_0x2f4118('0xc')],{[Op['or']]:_[_0x2f4118('0x20')](_0x142ca7,function(_0x2481f4){const _0x513293=_0x2f4118;if(_0x2481f4[_0x513293('0x36')]!==_0x513293('0x33')){const _0x3425ea={};return _0x3425ea[_0x2481f4[_0x513293('0x3b')]]={[Op[_0x513293('0x2')]]:'%'+_0x49a17c[_0x513293('0x25')]['filter']+'%'},_0x3425ea;}})}));_0x4c3037=_[_0x2f4118('0x10')]({},_0x4c3037,_0x49a17c['options']);const _0x56702a={'where':_0x4c3037[_0x2f4118('0xc')]};return db[_0x2f4118('0x3')]['count'](_0x56702a)[_0x2f4118('0x28')](function(_0x496216){const _0x4e7f62=_0x2f4118;return _0x47d6be[_0x4e7f62('0x32')]=_0x496216,_0x49a17c['query']['includeAll']&&(_0x4c3037[_0x4e7f62('0x37')]=[{'all':!![]}]),db['Schedule'][_0x4e7f62('0x5')](_0x4c3037);})[_0x2f4118('0x28')](function(_0x244794){return _0x47d6be['rows']=_0x244794,_0x47d6be;})[_0x2f4118('0x28')](respondWithFilteredResult(_0x30632c,_0x4c3037))[_0x2f4118('0x4')](handleError(_0x30632c,null));},exports['show']=function(_0x2e23e6,_0x1cfdb8){const _0x7116be=_0x1e3329;let _0x3d8d72={'raw':![],'where':{'id':_0x2e23e6[_0x7116be('0xa')]['id']}};const _0x13beb6={};return _0x13beb6[_0x7116be('0x22')]=_[_0x7116be('0x18')](db['Schedule'][_0x7116be('0x29')]),_0x13beb6[_0x7116be('0x25')]=_[_0x7116be('0x18')](_0x2e23e6['query']),_0x13beb6[_0x7116be('0x38')]=_[_0x7116be('0x2b')](_0x13beb6[_0x7116be('0x22')],_0x13beb6['query']),_0x3d8d72['attributes']=_[_0x7116be('0x2b')](_0x13beb6[_0x7116be('0x22')],qs[_0x7116be('0x21')](_0x2e23e6['query']['fields'])),_0x3d8d72[_0x7116be('0x3a')]=_0x3d8d72[_0x7116be('0x3a')][_0x7116be('0x11')]?_0x3d8d72[_0x7116be('0x3a')]:_0x13beb6[_0x7116be('0x22')],_0x2e23e6[_0x7116be('0x25')][_0x7116be('0x26')]&&(_0x3d8d72['include']=[{'all':!![]}]),_0x3d8d72=_[_0x7116be('0x10')]({},_0x3d8d72,_0x2e23e6[_0x7116be('0xf')]),db[_0x7116be('0x3')][_0x7116be('0x2e')](_0x3d8d72)['then'](handleEntityNotFound(_0x1cfdb8,null))[_0x7116be('0x28')](respondWithResult(_0x1cfdb8,null))[_0x7116be('0x4')](handleError(_0x1cfdb8,null));},exports[_0x1e3329('0x8')]=function(_0x55f055,_0x37e0a4){const _0x50fea8=_0x1e3329;return db['Schedule'][_0x50fea8('0x8')](_0x55f055['body'],{})['then'](function(_0x2d50ed){const _0x215ab7=_0x50fea8,_0x218cca=_0x55f055[_0x215ab7('0x12')]['get']({'plain':!![]});if(!_0x218cca)throw new Error(_0x215ab7('0x1d'));if(_0x218cca[_0x215ab7('0x6')]===_0x215ab7('0x12')){const _0x24ab5f=_0x2d50ed[_0x215ab7('0x31')]({'plain':!![]}),_0x5d75d7=_0x215ab7('0x9');return db['UserProfileSection']['findOne']({'where':{'name':_0x5d75d7,'userProfileId':_0x218cca[_0x215ab7('0x23')]},'raw':!![]})[_0x215ab7('0x28')](function(_0x2e4c75){const _0x37966b=_0x215ab7;return _0x2e4c75&&_0x2e4c75[_0x37966b('0x3c')]===0x0?db[_0x37966b('0x1')][_0x37966b('0x8')]({'name':_0x24ab5f[_0x37966b('0x3b')],'resourceId':_0x24ab5f['id'],'type':_0x2e4c75[_0x37966b('0x3b')],'sectionId':_0x2e4c75['id']},{})[_0x37966b('0x28')](function(){return _0x2d50ed;}):_0x2d50ed;})[_0x215ab7('0x4')](function(_0x5e798d){const _0x4c06b6=_0x215ab7;logger[_0x4c06b6('0x1a')](_0x4c06b6('0xb'),_0x5e798d);throw _0x5e798d;});}return _0x2d50ed;})[_0x50fea8('0x28')](respondWithResult(_0x37e0a4,0xc9))['catch'](handleError(_0x37e0a4,null));},exports['update']=function(_0x24e43e,_0x50f92c){const _0x4efe26=_0x1e3329;return _0x24e43e[_0x4efe26('0x35')]['id']&&delete _0x24e43e['body']['id'],db[_0x4efe26('0x3')][_0x4efe26('0x2e')]({'where':{'id':_0x24e43e['params']['id']}})[_0x4efe26('0x28')](handleEntityNotFound(_0x50f92c,null))[_0x4efe26('0x28')](saveUpdates(_0x24e43e[_0x4efe26('0x35')],null))[_0x4efe26('0x28')](respondWithResult(_0x50f92c,null))['catch'](handleError(_0x50f92c,null));},exports[_0x1e3329('0x24')]=function(_0x12714f,_0x4c8d29){const _0x391442=_0x1e3329;return db[_0x391442('0x3')][_0x391442('0x2e')]({'where':{'id':_0x12714f[_0x391442('0xa')]['id']}})['then'](handleEntityNotFound(_0x4c8d29,null))[_0x391442('0x28')](removeEntity(_0x4c8d29,null))['catch'](handleError(_0x4c8d29,null));},exports[_0x1e3329('0x17')]=function(_0x5a77ef,_0x474309){const _0x47b93a=_0x1e3329,_0x1b78cc=require('../../config/schedule');return db[_0x47b93a('0x3')][_0x47b93a('0x2e')]({'where':{'id':_0x5a77ef[_0x47b93a('0xa')]['id']},'raw':!![]})[_0x47b93a('0x28')](handleEntityNotFound(_0x474309,null))[_0x47b93a('0x28')](function(){const _0x38c72f=_0x47b93a;_0x1b78cc[_0x38c72f('0x17')](_0x5a77ef[_0x38c72f('0xa')]['id']);})[_0x47b93a('0x28')](respondWithStatusCode(_0x474309,null))[_0x47b93a('0x4')](handleError(_0x474309,null));};
\ No newline at end of file