Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / api / mailInteraction / mailInteraction.model.js
index e6f427e..a2a707b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf4c=['fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions'];(function(_0x1511ba,_0x4481e4){var _0x3128af=function(_0x1aabea){while(--_0x1aabea){_0x1511ba['push'](_0x1511ba['shift']());}};_0x3128af(++_0x4481e4);}(_0xaf4c,0x1ed));var _0xcaf4=function(_0xd39dad,_0x3bdd7b){_0xd39dad=_0xd39dad-0x0;var _0x49752d=_0xaf4c[_0xd39dad];return _0x49752d;};'use strict';var _=require('lodash');var util=require(_0xcaf4('0x0'));var logger=require(_0xcaf4('0x1'))('api');var moment=require(_0xcaf4('0x2'));var BPromise=require(_0xcaf4('0x3'));var rp=require(_0xcaf4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcaf4('0x5'));var config=require(_0xcaf4('0x6'));var attributes=require(_0xcaf4('0x7'));module['exports']=function(_0x21ad95,_0x548527){return _0x21ad95[_0xcaf4('0x8')](_0xcaf4('0x9'),attributes,{'tableName':_0xcaf4('0xa'),'paranoid':![],'indexes':[{'name':_0xcaf4('0xb'),'fields':[_0xcaf4('0xc'),'to'],'type':_0xcaf4('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x47b86a,_0x5af977,_0x2191f5){if(_0x47b86a[_0xcaf4('0xe')]){_0x47b86a[_0xcaf4('0xf')]=moment()[_0xcaf4('0x10')](_0xcaf4('0x11'));}if(_0x47b86a[_0xcaf4('0x12')]){_0x47b86a[_0xcaf4('0x13')]=moment()[_0xcaf4('0x10')](_0xcaf4('0x11'));}_0x2191f5(null,_0x5af977);},'beforeUpdate':function(_0x503353,_0x4092b9,_0x41486c){if(_0x503353['changed'](_0xcaf4('0xe'))){_0x503353[_0xcaf4('0xf')]=_0x503353[_0xcaf4('0xe')]?moment()['format'](_0xcaf4('0x11')):null;}if(_0x503353[_0xcaf4('0x14')]('closed')){_0x503353[_0xcaf4('0x13')]=moment()['format'](_0xcaf4('0x11'));_0x503353[_0xcaf4('0xe')]=null;_0x503353[_0xcaf4('0xf')]=null;}_0x41486c(null,_0x503353);},'afterUpdate':function(_0x1ec93e,_0x1380f9,_0x3bfcc5){var _0x4d2817=_0x21ad95[_0xcaf4('0x15')];var _0x488bac=_0x1ec93e[_0xcaf4('0x16')]({'plain':!![]});if(_0x488bac['closed']){return _0x4d2817[_0xcaf4('0x17')][_0xcaf4('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x488bac['id']}})[_0xcaf4('0x19')](function(){_0x3bfcc5();})['catch'](function(_0x585d18){_0x3bfcc5(_0x585d18);});}else{_0x3bfcc5();}}},'charset':_0xcaf4('0x1a'),'collate':_0xcaf4('0x1b')});};
\ No newline at end of file
+var _0x652b=['substatus','substatusAt','models','get','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','MailInteraction','fti_mail_interactions','subject','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed'];(function(_0x4b3b4e,_0x288dbb){var _0x5551ca=function(_0x24cc71){while(--_0x24cc71){_0x4b3b4e['push'](_0x4b3b4e['shift']());}};_0x5551ca(++_0x288dbb);}(_0x652b,0x68));var _0xb652=function(_0x5c2a2b,_0x22c94e){_0x5c2a2b=_0x5c2a2b-0x0;var _0x19921f=_0x652b[_0x5c2a2b];return _0x19921f;};'use strict';var _=require(_0xb652('0x0'));var util=require(_0xb652('0x1'));var logger=require(_0xb652('0x2'))('api');var moment=require(_0xb652('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb652('0x4'));var rimraf=require(_0xb652('0x5'));var config=require(_0xb652('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x43f467,_0x491ce7){return _0x43f467['define'](_0xb652('0x7'),attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xb652('0x8'),'fields':[_0xb652('0x9'),'to'],'type':_0xb652('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2a7fad,_0x2f06f0,_0x374775){if(_0x2a7fad['substatus']){_0x2a7fad['substatusAt']=moment()[_0xb652('0xb')](_0xb652('0xc'));}if(_0x2a7fad[_0xb652('0xd')]){_0x2a7fad[_0xb652('0xe')]=moment()['format'](_0xb652('0xc'));}_0x374775(null,_0x2f06f0);},'beforeUpdate':function(_0x4352b2,_0x167c15,_0x54c2e2){if(_0x4352b2[_0xb652('0xf')](_0xb652('0x10'))){_0x4352b2['substatusAt']=_0x4352b2['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x4352b2[_0xb652('0xf')]('closed')){_0x4352b2[_0xb652('0xe')]=moment()[_0xb652('0xb')](_0xb652('0xc'));_0x4352b2['substatus']=null;_0x4352b2[_0xb652('0x11')]=null;}_0x54c2e2(null,_0x4352b2);},'afterUpdate':function(_0x3621a4,_0x2d4c1d,_0x477340){var _0x4ba393=_0x43f467[_0xb652('0x12')];var _0x289911=_0x3621a4[_0xb652('0x13')]({'plain':!![]});if(_0x289911[_0xb652('0xd')]){return _0x4ba393['MailMessage'][_0xb652('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x289911['id']}})['then'](function(){_0x477340();})[_0xb652('0x15')](function(_0x313d97){_0x477340(_0x313d97);});}else{_0x477340();}}},'charset':_0xb652('0x16'),'collate':_0xb652('0x17')});};
\ No newline at end of file