25ad78439d54252f11d3fce54bf589169343b557
[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 _0x1eb1=['lodash','util','../../config/logger','api','moment','request-promise','path','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1eb1,0xe1));var _0x11eb=function(_0x2b0167,_0x507236){_0x2b0167=_0x2b0167-0x0;var _0xc06cb0=_0x1eb1[_0x2b0167];return _0xc06cb0;};'use strict';var _=require(_0x11eb('0x0'));var util=require(_0x11eb('0x1'));var logger=require(_0x11eb('0x2'))(_0x11eb('0x3'));var moment=require(_0x11eb('0x4'));var BPromise=require('bluebird');var rp=require(_0x11eb('0x5'));var fs=require('fs');var path=require(_0x11eb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x11eb('0x7'));module[_0x11eb('0x8')]=function(_0x49d274,_0x4fffe6){return _0x49d274[_0x11eb('0x9')](_0x11eb('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2370ac,_0x43cce9,_0xae708d){if(_0x2370ac[_0x11eb('0xb')]('closed')){_0x2370ac[_0x11eb('0xc')]=moment()[_0x11eb('0xd')](_0x11eb('0xe'));}_0xae708d(null,_0x2370ac);}}});};