24733ad9d04d14e7181dcc84d77ff36f872a1e6e
[motion2.git] / server / api / smsInteraction / smsInteraction.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 _0xb798=['SmsInteraction','sms_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','moment','request-promise','path','./smsInteraction.attributes','exports','define'];(function(_0x218972,_0x1f9794){var _0x1bb1a8=function(_0x3fb962){while(--_0x3fb962){_0x218972['push'](_0x218972['shift']());}};_0x1bb1a8(++_0x1f9794);}(_0xb798,0x199));var _0x8b79=function(_0x4ff831,_0x2846ad){_0x4ff831=_0x4ff831-0x0;var _0x586e93=_0xb798[_0x4ff831];return _0x586e93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b79('0x0'))('api');var moment=require(_0x8b79('0x1'));var BPromise=require('bluebird');var rp=require(_0x8b79('0x2'));var fs=require('fs');var path=require(_0x8b79('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8b79('0x4'));module[_0x8b79('0x5')]=function(_0xb5b391,_0x192037){return _0xb5b391[_0x8b79('0x6')](_0x8b79('0x7'),attributes,{'tableName':_0x8b79('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c7325,_0x191344,_0x48b421){if(_0x3c7325[_0x8b79('0x9')](_0x8b79('0xa'))){_0x3c7325[_0x8b79('0xb')]=moment()['format'](_0x8b79('0xc'));}_0x48b421(null,_0x3c7325);}}});};