5d04f700cbb13f8a8eb202e64b6e1e7bb555e2f4
[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 _0x81a7=['rimraf','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','util','../../config/logger','api'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x81a7,0x1e1));var _0x781a=function(_0xa645c0,_0x2d0bbb){_0xa645c0=_0xa645c0-0x0;var _0x1d6704=_0x81a7[_0xa645c0];return _0x1d6704;};'use strict';var _=require('lodash');var util=require(_0x781a('0x0'));var logger=require(_0x781a('0x1'))(_0x781a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x781a('0x3'));var config=require('../../config/environment');var attributes=require(_0x781a('0x4'));module[_0x781a('0x5')]=function(_0xa0fffa,_0x1f35c7){return _0xa0fffa['define'](_0x781a('0x6'),attributes,{'tableName':_0x781a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x25eeff,_0x331428,_0x24268e){if(_0x25eeff[_0x781a('0x8')](_0x781a('0x9'))){_0x25eeff[_0x781a('0xa')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x24268e(null,_0x25eeff);}}});};