5bf750aaec1eb7c31cf4d4ffb76b6bec09978bbd
[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 _0xc8b0=['changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','sms_interactions'];(function(_0x2e63e8,_0xed68f5){var _0x3fe904=function(_0x10e876){while(--_0x10e876){_0x2e63e8['push'](_0x2e63e8['shift']());}};_0x3fe904(++_0xed68f5);}(_0xc8b0,0x9e));var _0x0c8b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc8b0[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x0c8b('0x0'));var util=require(_0x0c8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0c8b('0x2'));var rp=require(_0x0c8b('0x3'));var fs=require('fs');var path=require(_0x0c8b('0x4'));var rimraf=require(_0x0c8b('0x5'));var config=require(_0x0c8b('0x6'));var attributes=require('./smsInteraction.attributes');module[_0x0c8b('0x7')]=function(_0x414839,_0x6f012a){return _0x414839[_0x0c8b('0x8')]('SmsInteraction',attributes,{'tableName':_0x0c8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x538901,_0x1a4963,_0x12fb6e){if(_0x538901[_0x0c8b('0xa')](_0x0c8b('0xb'))){_0x538901[_0x0c8b('0xc')]=moment()['format'](_0x0c8b('0xd'));}_0x12fb6e(null,_0x538901);}}});};