Built motion from commit 25580385.|2.6.2
[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 _0x34be=['../../config/environment','exports','FaxInteraction','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','util','rimraf'];(function(_0x2783e9,_0x330637){var _0x40b07b=function(_0x33d46a){while(--_0x33d46a){_0x2783e9['push'](_0x2783e9['shift']());}};_0x40b07b(++_0x330637);}(_0x34be,0x139));var _0xe34b=function(_0x481af3,_0x483fac){_0x481af3=_0x481af3-0x0;var _0x3354ea=_0x34be[_0x481af3];return _0x3354ea;};'use strict';var _=require('lodash');var util=require(_0xe34b('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe34b('0x1'));var config=require(_0xe34b('0x2'));var attributes=require('./faxInteraction.attributes');module[_0xe34b('0x3')]=function(_0x5f4c78,_0x2c7e9d){return _0x5f4c78['define'](_0xe34b('0x4'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bcd66,_0x267b8f,_0x14a9c9){if(_0x3bcd66[_0xe34b('0x5')](_0xe34b('0x6'))){_0x3bcd66[_0xe34b('0x7')]=moment()['format'](_0xe34b('0x8'));}_0x14a9c9(null,_0x3bcd66);}}});};