457d2e919131223962129ec82386ffd513d76385
[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 _0x6959=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x347149,_0x441f01){var _0x298638=function(_0x2ebd99){while(--_0x2ebd99){_0x347149['push'](_0x347149['shift']());}};_0x298638(++_0x441f01);}(_0x6959,0x9a));var _0x9695=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6959[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x9695('0x0'));var logger=require(_0x9695('0x1'))(_0x9695('0x2'));var moment=require('moment');var BPromise=require(_0x9695('0x3'));var rp=require(_0x9695('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9695('0x5'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x9695('0x6')]=function(_0x373e36,_0x271062){return _0x373e36['define'](_0x9695('0x7'),attributes,{'tableName':_0x9695('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x363be5,_0x499fa1,_0x39bc20){if(_0x363be5[_0x9695('0x9')](_0x9695('0xa'))){_0x363be5[_0x9695('0xb')]=moment()[_0x9695('0xc')](_0x9695('0xd'));}_0x39bc20(null,_0x363be5);}}});};