dee01262756f2c26820c6d7d06f2dc95e6ecf850
[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 _0x6ecd=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','format'];(function(_0x5465e4,_0x4b5f03){var _0x13b690=function(_0x514227){while(--_0x514227){_0x5465e4['push'](_0x5465e4['shift']());}};_0x13b690(++_0x4b5f03);}(_0x6ecd,0xfd));var _0xd6ec=function(_0x16696b,_0x48be0e){_0x16696b=_0x16696b-0x0;var _0x3e8d45=_0x6ecd[_0x16696b];return _0x3e8d45;};'use strict';var _=require(_0xd6ec('0x0'));var util=require('util');var logger=require(_0xd6ec('0x1'))(_0xd6ec('0x2'));var moment=require(_0xd6ec('0x3'));var BPromise=require(_0xd6ec('0x4'));var rp=require(_0xd6ec('0x5'));var fs=require('fs');var path=require(_0xd6ec('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd6ec('0x7'));module['exports']=function(_0x698961,_0x1c3e33){return _0x698961[_0xd6ec('0x8')](_0xd6ec('0x9'),attributes,{'tableName':_0xd6ec('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x30dede,_0x485732,_0x18bd27){if(_0x30dede[_0xd6ec('0xb')]('closed')){_0x30dede['closedAt']=moment()[_0xd6ec('0xc')](_0xd6ec('0xd'));}_0x18bd27(null,_0x30dede);}}});};