Built motion from commit da617fac.|2.6.6
[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 _0x9e92=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path','rimraf','./smsInteraction.attributes','exports','define','sms_interactions','format'];(function(_0x1ef355,_0x244bd7){var _0x2f69c9=function(_0x4af11b){while(--_0x4af11b){_0x1ef355['push'](_0x1ef355['shift']());}};_0x2f69c9(++_0x244bd7);}(_0x9e92,0x1ef));var _0x29e9=function(_0x1111c8,_0x4ec610){_0x1111c8=_0x1111c8-0x0;var _0x4db1e6=_0x9e92[_0x1111c8];return _0x4db1e6;};'use strict';var _=require(_0x29e9('0x0'));var util=require(_0x29e9('0x1'));var logger=require('../../config/logger')(_0x29e9('0x2'));var moment=require(_0x29e9('0x3'));var BPromise=require('bluebird');var rp=require(_0x29e9('0x4'));var fs=require('fs');var path=require(_0x29e9('0x5'));var rimraf=require(_0x29e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x29e9('0x7'));module[_0x29e9('0x8')]=function(_0x25c48a,_0x215a90){return _0x25c48a[_0x29e9('0x9')]('SmsInteraction',attributes,{'tableName':_0x29e9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2c795c,_0xb367eb,_0x15d291){if(_0x2c795c['changed']('closed')){_0x2c795c['closedAt']=moment()[_0x29e9('0xb')](_0x29e9('0xc'));}_0x15d291(null,_0x2c795c);}}});};