Built motion from commit 43538d75.|2.5.35
[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 _0xb4e9=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0xef4cf0,_0x16c9c3){var _0x497ad2=function(_0xce63d4){while(--_0xce63d4){_0xef4cf0['push'](_0xef4cf0['shift']());}};_0x497ad2(++_0x16c9c3);}(_0xb4e9,0xdf));var _0x9b4e=function(_0x3f4414,_0x3258ae){_0x3f4414=_0x3f4414-0x0;var _0x1d7e34=_0xb4e9[_0x3f4414];return _0x1d7e34;};'use strict';var _=require(_0x9b4e('0x0'));var util=require(_0x9b4e('0x1'));var logger=require(_0x9b4e('0x2'))(_0x9b4e('0x3'));var moment=require(_0x9b4e('0x4'));var BPromise=require('bluebird');var rp=require(_0x9b4e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b4e('0x6'));var config=require(_0x9b4e('0x7'));var attributes=require('./smsInteraction.attributes');module[_0x9b4e('0x8')]=function(_0x4db16e,_0x1f80a3){return _0x4db16e[_0x9b4e('0x9')]('SmsInteraction',attributes,{'tableName':_0x9b4e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58cc3e,_0x131d0f,_0x50cac1){if(_0x58cc3e['changed'](_0x9b4e('0xb'))){_0x58cc3e[_0x9b4e('0xc')]=moment()[_0x9b4e('0xd')](_0x9b4e('0xe'));}_0x50cac1(null,_0x58cc3e);}}});};