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 _0xfb0e=['path','exports','define','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','bluebird'];(function(_0x2dbcb2,_0x5729cd){var _0x4f3b0f=function(_0x34a78a){while(--_0x34a78a){_0x2dbcb2['push'](_0x2dbcb2['shift']());}};_0x4f3b0f(++_0x5729cd);}(_0xfb0e,0x1e8));var _0xefb0=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0xfb0e[_0x587fb5];return _0x551105;};'use strict';var _=require('lodash');var util=require(_0xefb0('0x0'));var logger=require('../../config/logger')(_0xefb0('0x1'));var moment=require(_0xefb0('0x2'));var BPromise=require(_0xefb0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xefb0('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0xefb0('0x5')]=function(_0x2fcfdb,_0x30ed5b){return _0x2fcfdb[_0xefb0('0x6')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x536618,_0x5e1bae,_0x144b3b){if(_0x536618[_0xefb0('0x7')](_0xefb0('0x8'))){_0x536618[_0xefb0('0x9')]=moment()[_0xefb0('0xa')](_0xefb0('0xb'));}_0x144b3b(null,_0x536618);}}});};