Built motion from commit (unavailable).|2.4.17
[motion2.git] / server / api / faxMessage / faxMessage.model.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 _0x47e1=['fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','bluebird','request-promise','../../config/environment','./faxMessage.attributes','exports','define'];(function(_0x271662,_0x57aa50){var _0x4ee69d=function(_0x4afb07){while(--_0x4afb07){_0x271662['push'](_0x271662['shift']());}};_0x4ee69d(++_0x57aa50);}(_0x47e1,0x131));var _0x147e=function(_0x342caa,_0x14f9f8){_0x342caa=_0x342caa-0x0;var _0x11f5d0=_0x47e1[_0x342caa];return _0x11f5d0;};'use strict';var _=require(_0x147e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x147e('0x1'));var rp=require(_0x147e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x147e('0x3'));var attributes=require(_0x147e('0x4'));module[_0x147e('0x5')]=function(_0x112059,_0x99d9c1){return _0x112059[_0x147e('0x6')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x147e('0x7'),'fields':[_0x147e('0x8')],'type':_0x147e('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xfc5b60,_0x4a8876,_0x3651a3){var _0x154652=_0x112059[_0x147e('0xa')];var _0x3e850f=_0xfc5b60[_0x147e('0xb')]({'plain':!![]});if(_0x3e850f[_0x147e('0xc')][_0x147e('0xd')]()==='in'||_0x3e850f[_0x147e('0xc')][_0x147e('0xd')]()===_0x147e('0xe')&&!_0x3e850f[_0x147e('0xf')]&&!_[_0x147e('0x10')](_0x3e850f[_0x147e('0x11')])){_0x154652['FaxInteraction'][_0x147e('0x12')]({'where':{'id':_0x3e850f['FaxInteractionId']}})[_0x147e('0x13')](function(_0x4ed0ac){if(_0x4ed0ac){_0x4ed0ac[_0x147e('0x14')]({'lastMsgAt':_0x3e850f[_0x147e('0x15')],'lastMsgDirection':_0x3e850f[_0x147e('0xc')]['toLowerCase']()});}})[_0x147e('0x16')](function(_0x51a066){console[_0x147e('0x17')](_0x51a066);});}_0x3651a3();}},'charset':_0x147e('0x18'),'collate':_0x147e('0x19')});};