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 _0xdc0e=['exports','define','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x553a87,_0x1d621f){var _0x12d1e6=function(_0x41ae48){while(--_0x41ae48){_0x553a87['push'](_0x553a87['shift']());}};_0x12d1e6(++_0x1d621f);}(_0xdc0e,0xf7));var _0xedc0=function(_0x34fe22,_0x4b0faa){_0x34fe22=_0x34fe22-0x0;var _0x126030=_0xdc0e[_0x34fe22];return _0x126030;};'use strict';var _=require(_0xedc0('0x0'));var util=require(_0xedc0('0x1'));var logger=require(_0xedc0('0x2'))('api');var moment=require(_0xedc0('0x3'));var BPromise=require(_0xedc0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xedc0('0x5'));var rimraf=require(_0xedc0('0x6'));var config=require(_0xedc0('0x7'));var attributes=require(_0xedc0('0x8'));module[_0xedc0('0x9')]=function(_0x45a61a,_0x5f868f){return _0x45a61a[_0xedc0('0xa')](_0xedc0('0xb'),attributes,{'tableName':_0xedc0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46cef2,_0x50dbf6,_0x47ba00){if(_0x46cef2[_0xedc0('0xd')]('closed')){_0x46cef2['closedAt']=moment()[_0xedc0('0xe')](_0xedc0('0xf'));}_0x47ba00(null,_0x46cef2);}}});};