91ee9961ca7d9cbf1ef28cb9d64f5ef12231278f
[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 _0x9f99=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x9f99,0x197));var _0x99f9=function(_0x232d09,_0x30a518){_0x232d09=_0x232d09-0x0;var _0x454385=_0x9f99[_0x232d09];return _0x454385;};'use strict';var _=require(_0x99f9('0x0'));var util=require(_0x99f9('0x1'));var logger=require(_0x99f9('0x2'))(_0x99f9('0x3'));var moment=require(_0x99f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x99f9('0x5'));var fs=require('fs');var path=require(_0x99f9('0x6'));var rimraf=require(_0x99f9('0x7'));var config=require(_0x99f9('0x8'));var attributes=require(_0x99f9('0x9'));module['exports']=function(_0x181d35,_0xa13858){return _0x181d35[_0x99f9('0xa')](_0x99f9('0xb'),attributes,{'tableName':_0x99f9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f2ccc,_0x40c9c7,_0x34fc8b){if(_0x4f2ccc[_0x99f9('0xd')]('closed')){_0x4f2ccc[_0x99f9('0xe')]=moment()[_0x99f9('0xf')](_0x99f9('0x10'));}_0x34fc8b(null,_0x4f2ccc);}}});};