3130fbcc7ad37b806f9dd6c0789ac819459fc58e
[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 _0xac9a=['changed','closed','lodash','util','../../config/logger','api','bluebird','path','rimraf','./smsInteraction.attributes','exports','define','sms_interactions'];(function(_0x1bfc25,_0x49cde8){var _0x3efea6=function(_0xfc23e7){while(--_0xfc23e7){_0x1bfc25['push'](_0x1bfc25['shift']());}};_0x3efea6(++_0x49cde8);}(_0xac9a,0x17b));var _0xaac9=function(_0x55f5ef,_0x1b8176){_0x55f5ef=_0x55f5ef-0x0;var _0x3947e4=_0xac9a[_0x55f5ef];return _0x3947e4;};'use strict';var _=require(_0xaac9('0x0'));var util=require(_0xaac9('0x1'));var logger=require(_0xaac9('0x2'))(_0xaac9('0x3'));var moment=require('moment');var BPromise=require(_0xaac9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaac9('0x5'));var rimraf=require(_0xaac9('0x6'));var config=require('../../config/environment');var attributes=require(_0xaac9('0x7'));module[_0xaac9('0x8')]=function(_0x59d27c,_0x5caf71){return _0x59d27c[_0xaac9('0x9')]('SmsInteraction',attributes,{'tableName':_0xaac9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xc3bc5c,_0x36107d,_0x51697b){if(_0xc3bc5c[_0xaac9('0xb')](_0xaac9('0xc'))){_0xc3bc5c['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x51697b(null,_0xc3bc5c);}}});};