Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / faxInteraction / faxInteraction.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 _0xe0a9=['../../config/environment','exports','define','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','rimraf'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe0a9,0x180));var _0x9e0a=function(_0x23ec6a,_0x272cb1){_0x23ec6a=_0x23ec6a-0x0;var _0x30dbb8=_0xe0a9[_0x23ec6a];return _0x30dbb8;};'use strict';var _=require(_0x9e0a('0x0'));var util=require(_0x9e0a('0x1'));var logger=require(_0x9e0a('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9e0a('0x3'));var rp=require(_0x9e0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e0a('0x5'));var config=require(_0x9e0a('0x6'));var attributes=require('./faxInteraction.attributes');module[_0x9e0a('0x7')]=function(_0x207d72,_0x42a642){return _0x207d72[_0x9e0a('0x8')]('FaxInteraction',attributes,{'tableName':_0x9e0a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1094b1,_0x1b5586,_0x59a0f1){if(_0x1094b1['changed'](_0x9e0a('0xa'))){_0x1094b1['closedAt']=moment()[_0x9e0a('0xb')](_0x9e0a('0xc'));}_0x59a0f1(null,_0x1094b1);}}});};