Built motion from commit 5b761a7b.|2.5.36
[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 _0xf312=['rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xf312,0x14d));var _0x2f31=function(_0x11bc26,_0x5bd22c){_0x11bc26=_0x11bc26-0x0;var _0xff15a4=_0xf312[_0x11bc26];return _0xff15a4;};'use strict';var _=require(_0x2f31('0x0'));var util=require(_0x2f31('0x1'));var logger=require(_0x2f31('0x2'))(_0x2f31('0x3'));var moment=require('moment');var BPromise=require(_0x2f31('0x4'));var rp=require(_0x2f31('0x5'));var fs=require('fs');var path=require(_0x2f31('0x6'));var rimraf=require(_0x2f31('0x7'));var config=require(_0x2f31('0x8'));var attributes=require(_0x2f31('0x9'));module[_0x2f31('0xa')]=function(_0x26a9c2,_0x101afb){return _0x26a9c2[_0x2f31('0xb')](_0x2f31('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22540f,_0x39891b,_0x24468f){if(_0x22540f[_0x2f31('0xd')](_0x2f31('0xe'))){_0x22540f['closedAt']=moment()[_0x2f31('0xf')](_0x2f31('0x10'));}_0x24468f(null,_0x22540f);}}});};