ebe048961f54902c64ec8f103f90f53a050a986e
[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 _0xed13=['./smsInteraction.attributes','exports','define','sms_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','request-promise','path'];(function(_0x4a091a,_0x4abeb7){var _0x3d6e70=function(_0x5f153d){while(--_0x5f153d){_0x4a091a['push'](_0x4a091a['shift']());}};_0x3d6e70(++_0x4abeb7);}(_0xed13,0x128));var _0x3ed1=function(_0x117452,_0x342d57){_0x117452=_0x117452-0x0;var _0x587545=_0xed13[_0x117452];return _0x587545;};'use strict';var _=require('lodash');var util=require(_0x3ed1('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x3ed1('0x1'));var BPromise=require('bluebird');var rp=require(_0x3ed1('0x2'));var fs=require('fs');var path=require(_0x3ed1('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3ed1('0x4'));module[_0x3ed1('0x5')]=function(_0x2a8b48,_0x3ee614){return _0x2a8b48[_0x3ed1('0x6')]('SmsInteraction',attributes,{'tableName':_0x3ed1('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e8db1,_0xf4066f,_0xb10f22){if(_0x4e8db1[_0x3ed1('0x8')]('closed')){_0x4e8db1[_0x3ed1('0x9')]=moment()[_0x3ed1('0xa')](_0x3ed1('0xb'));}_0xb10f22(null,_0x4e8db1);}}});};