Built motion from commit 994c64e1.|2.6.1
[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 _0x15e7=['../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x15e7,0x13a));var _0x715e=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x15e7[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x715e('0x0'));var util=require(_0x715e('0x1'));var logger=require(_0x715e('0x2'))(_0x715e('0x3'));var moment=require(_0x715e('0x4'));var BPromise=require(_0x715e('0x5'));var rp=require(_0x715e('0x6'));var fs=require('fs');var path=require(_0x715e('0x7'));var rimraf=require(_0x715e('0x8'));var config=require(_0x715e('0x9'));var attributes=require(_0x715e('0xa'));module[_0x715e('0xb')]=function(_0x5bb3bc,_0x48da66){return _0x5bb3bc['define'](_0x715e('0xc'),attributes,{'tableName':_0x715e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x376d93,_0x23a0d2,_0x36e98d){if(_0x376d93[_0x715e('0xe')]('closed')){_0x376d93['closedAt']=moment()[_0x715e('0xf')](_0x715e('0x10'));}_0x36e98d(null,_0x376d93);}}});};