Built motion from commit f7863d46.|2.5.41
[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 _0x4c6a=['lodash','util','api','bluebird','request-promise','path','exports','define','FaxInteraction','fax_interactions','closedAt','format'];(function(_0x5278db,_0x27ce48){var _0x431986=function(_0x2d83f1){while(--_0x2d83f1){_0x5278db['push'](_0x5278db['shift']());}};_0x431986(++_0x27ce48);}(_0x4c6a,0xb4));var _0xa4c6=function(_0x7ab372,_0x2d9353){_0x7ab372=_0x7ab372-0x0;var _0x14cf97=_0x4c6a[_0x7ab372];return _0x14cf97;};'use strict';var _=require(_0xa4c6('0x0'));var util=require(_0xa4c6('0x1'));var logger=require('../../config/logger')(_0xa4c6('0x2'));var moment=require('moment');var BPromise=require(_0xa4c6('0x3'));var rp=require(_0xa4c6('0x4'));var fs=require('fs');var path=require(_0xa4c6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./faxInteraction.attributes');module[_0xa4c6('0x6')]=function(_0x25881e,_0x4b9b00){return _0x25881e[_0xa4c6('0x7')](_0xa4c6('0x8'),attributes,{'tableName':_0xa4c6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3dbb86,_0x3bbcfe,_0x52e6db){if(_0x3dbb86['changed']('closed')){_0x3dbb86[_0xa4c6('0xa')]=moment()[_0xa4c6('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52e6db(null,_0x3dbb86);}}});};