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 _0x659c=['exports','define','WhatsappInteraction','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','request-promise','path','./whatsappInteraction.attributes'];(function(_0x557f5f,_0x31d8e7){var _0x196eba=function(_0x433d89){while(--_0x433d89){_0x557f5f['push'](_0x557f5f['shift']());}};_0x196eba(++_0x31d8e7);}(_0x659c,0x1aa));var _0xc659=function(_0x2b012b,_0x463e28){_0x2b012b=_0x2b012b-0x0;var _0x32c4cf=_0x659c[_0x2b012b];return _0x32c4cf;};'use strict';var _=require(_0xc659('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc659('0x1'));var moment=require(_0xc659('0x2'));var BPromise=require('bluebird');var rp=require(_0xc659('0x3'));var fs=require('fs');var path=require(_0xc659('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc659('0x5'));module[_0xc659('0x6')]=function(_0x369dc0,_0x312440){return _0x369dc0[_0xc659('0x7')](_0xc659('0x8'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x51b67f,_0x2cc93d,_0x56885a){if(_0x51b67f['changed']('closed')){_0x51b67f[_0xc659('0x9')]=moment()[_0xc659('0xa')](_0xc659('0xb'));}_0x56885a(null,_0x51b67f);}}});};