84633b65fbe759ae2d8bda5ff3e0d3cd8d11a580
[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 _0x6a3e=['request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','changed','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0x429a68,_0x545c8b){var _0x51b02=function(_0x254940){while(--_0x254940){_0x429a68['push'](_0x429a68['shift']());}};_0x51b02(++_0x545c8b);}(_0x6a3e,0x1ea));var _0xe6a3=function(_0x5158bc,_0x440325){_0x5158bc=_0x5158bc-0x0;var _0x3b1c6f=_0x6a3e[_0x5158bc];return _0x3b1c6f;};'use strict';var _=require('lodash');var util=require(_0xe6a3('0x0'));var logger=require(_0xe6a3('0x1'))(_0xe6a3('0x2'));var moment=require(_0xe6a3('0x3'));var BPromise=require(_0xe6a3('0x4'));var rp=require(_0xe6a3('0x5'));var fs=require('fs');var path=require(_0xe6a3('0x6'));var rimraf=require(_0xe6a3('0x7'));var config=require(_0xe6a3('0x8'));var attributes=require('./smsInteraction.attributes');module[_0xe6a3('0x9')]=function(_0x4104a9,_0x42f8cc){return _0x4104a9[_0xe6a3('0xa')](_0xe6a3('0xb'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x36c380,_0x3eee72,_0x57366c){if(_0x36c380[_0xe6a3('0xc')]('closed')){_0x36c380['closedAt']=moment()[_0xe6a3('0xd')](_0xe6a3('0xe'));}_0x57366c(null,_0x36c380);}}});};