2a59c8162afda9613009fa661241b8db6461cd08
[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 _0x0e8e=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','define','SmsInteraction','sms_interactions','changed','closedAt'];(function(_0x21b037,_0x1f310a){var _0x20556c=function(_0x1855a9){while(--_0x1855a9){_0x21b037['push'](_0x21b037['shift']());}};_0x20556c(++_0x1f310a);}(_0x0e8e,0x1c1));var _0xe0e8=function(_0x5581ec,_0x27182c){_0x5581ec=_0x5581ec-0x0;var _0x43249b=_0x0e8e[_0x5581ec];return _0x43249b;};'use strict';var _=require(_0xe0e8('0x0'));var util=require(_0xe0e8('0x1'));var logger=require('../../config/logger')(_0xe0e8('0x2'));var moment=require(_0xe0e8('0x3'));var BPromise=require(_0xe0e8('0x4'));var rp=require(_0xe0e8('0x5'));var fs=require('fs');var path=require(_0xe0e8('0x6'));var rimraf=require(_0xe0e8('0x7'));var config=require(_0xe0e8('0x8'));var attributes=require(_0xe0e8('0x9'));module['exports']=function(_0xd94114,_0x13a055){return _0xd94114[_0xe0e8('0xa')](_0xe0e8('0xb'),attributes,{'tableName':_0xe0e8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48459c,_0x5166d9,_0x4cb7d4){if(_0x48459c[_0xe0e8('0xd')]('closed')){_0x48459c[_0xe0e8('0xe')]=moment()['format'](_0xe0e8('0xf'));}_0x4cb7d4(null,_0x48459c);}}});};