1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x7765=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x7765,0x160));var _0x5776=function(_0x53e7d8,_0x58b101){_0x53e7d8=_0x53e7d8-0x0;var _0x218ef1=_0x7765[_0x53e7d8];return _0x218ef1;};'use strict';var _=require(_0x5776('0x0'));var util=require(_0x5776('0x1'));var logger=require(_0x5776('0x2'))('api');var moment=require(_0x5776('0x3'));var BPromise=require(_0x5776('0x4'));var rp=require(_0x5776('0x5'));var fs=require('fs');var path=require(_0x5776('0x6'));var rimraf=require(_0x5776('0x7'));var config=require(_0x5776('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x5776('0x9')]=function(_0x4169a1,_0x2fe58a){return _0x4169a1['define'](_0x5776('0xa'),attributes,{'tableName':_0x5776('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a0052,_0x59c6f0,_0x5de1d3){if(_0x3a0052[_0x5776('0xc')](_0x5776('0xd'))){_0x3a0052['closedAt']=moment()[_0x5776('0xe')](_0x5776('0xf'));}_0x5de1d3(null,_0x3a0052);}}});};