Built motion from commit 449495f6.|2.6.27
[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 _0x1f4f=['exports','define','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./smsInteraction.attributes'];(function(_0x33ce13,_0x3ac5b3){var _0x22dada=function(_0x202568){while(--_0x202568){_0x33ce13['push'](_0x33ce13['shift']());}};_0x22dada(++_0x3ac5b3);}(_0x1f4f,0x7f));var _0xf1f4=function(_0x554c93,_0x33c4e8){_0x554c93=_0x554c93-0x0;var _0x1602bd=_0x1f4f[_0x554c93];return _0x1602bd;};'use strict';var _=require(_0xf1f4('0x0'));var util=require(_0xf1f4('0x1'));var logger=require('../../config/logger')(_0xf1f4('0x2'));var moment=require(_0xf1f4('0x3'));var BPromise=require(_0xf1f4('0x4'));var rp=require(_0xf1f4('0x5'));var fs=require('fs');var path=require(_0xf1f4('0x6'));var rimraf=require(_0xf1f4('0x7'));var config=require('../../config/environment');var attributes=require(_0xf1f4('0x8'));module[_0xf1f4('0x9')]=function(_0x1f5993,_0x3ebc68){return _0x1f5993[_0xf1f4('0xa')](_0xf1f4('0xb'),attributes,{'tableName':_0xf1f4('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4118e7,_0x375e5c,_0x24b6ea){if(_0x4118e7[_0xf1f4('0xd')](_0xf1f4('0xe'))){_0x4118e7['closedAt']=moment()[_0xf1f4('0xf')](_0xf1f4('0x10'));}_0x24b6ea(null,_0x4118e7);}}});};