71e06bb78b2f47198281a0e3363b2ee244db1c62
[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 _0xd43e=['format','bluebird','request-promise','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt'];(function(_0x584268,_0x316063){var _0xe262a8=function(_0x190a3c){while(--_0x190a3c){_0x584268['push'](_0x584268['shift']());}};_0xe262a8(++_0x316063);}(_0xd43e,0xc7));var _0xed43=function(_0x472276,_0xa37f3b){_0x472276=_0x472276-0x0;var _0xdd2b80=_0xd43e[_0x472276];return _0xdd2b80;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xed43('0x0'));var rp=require(_0xed43('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0xed43('0x2'));var config=require('../../config/environment');var attributes=require(_0xed43('0x3'));module['exports']=function(_0x5bcea,_0xc0e3b6){return _0x5bcea[_0xed43('0x4')](_0xed43('0x5'),attributes,{'tableName':_0xed43('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3173a3,_0x31afff,_0x208e8f){if(_0x3173a3[_0xed43('0x7')](_0xed43('0x8'))){_0x3173a3[_0xed43('0x9')]=moment()[_0xed43('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x208e8f(null,_0x3173a3);}}});};