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 _0xe633=['bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','moment'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0xe633,0x1a1));var _0x3e63=function(_0xd89e85,_0x3338f1){_0xd89e85=_0xd89e85-0x0;var _0xf2a572=_0xe633[_0xd89e85];return _0xf2a572;};'use strict';var _=require('lodash');var util=require(_0x3e63('0x0'));var logger=require(_0x3e63('0x1'))('api');var moment=require(_0x3e63('0x2'));var BPromise=require(_0x3e63('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e63('0x4'));var rimraf=require('rimraf');var config=require(_0x3e63('0x5'));var attributes=require(_0x3e63('0x6'));module[_0x3e63('0x7')]=function(_0x4f5fab,_0x4e3c37){return _0x4f5fab['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x76db75,_0x1a7b5e,_0x1e0be1){if(_0x76db75['changed'](_0x3e63('0x8'))){_0x76db75[_0x3e63('0x9')]=moment()[_0x3e63('0xa')](_0x3e63('0xb'));}_0x1e0be1(null,_0x76db75);}}});};