b6f990402cd3783b7af371cc1db484198fc22b28
[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 _0xf27d=['lodash','../../config/logger','moment','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f7dee,_0x23bea2){var _0x2bae94=function(_0x2105d6){while(--_0x2105d6){_0x3f7dee['push'](_0x3f7dee['shift']());}};_0x2bae94(++_0x23bea2);}(_0xf27d,0xc3));var _0xdf27=function(_0x14a611,_0x544d30){_0x14a611=_0x14a611-0x0;var _0x594f23=_0xf27d[_0x14a611];return _0x594f23;};'use strict';var _=require(_0xdf27('0x0'));var util=require('util');var logger=require(_0xdf27('0x1'))('api');var moment=require(_0xdf27('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf27('0x3'));var rimraf=require(_0xdf27('0x4'));var config=require(_0xdf27('0x5'));var attributes=require(_0xdf27('0x6'));module[_0xdf27('0x7')]=function(_0xea5213,_0x550b91){return _0xea5213[_0xdf27('0x8')](_0xdf27('0x9'),attributes,{'tableName':_0xdf27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x158754,_0x5e5530,_0x4b0041){if(_0x158754[_0xdf27('0xb')](_0xdf27('0xc'))){_0x158754['closedAt']=moment()[_0xdf27('0xd')](_0xdf27('0xe'));}_0x4b0041(null,_0x158754);}}});};