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 _0x4940=['WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define'];(function(_0x1ab180,_0x382b2c){var _0xfb2c2d=function(_0x1c5fd3){while(--_0x1c5fd3){_0x1ab180['push'](_0x1ab180['shift']());}};_0xfb2c2d(++_0x382b2c);}(_0x4940,0xe3));var _0x0494=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x4940[_0x209941];return _0x1e8729;};'use strict';var _=require(_0x0494('0x0'));var util=require(_0x0494('0x1'));var logger=require(_0x0494('0x2'))('api');var moment=require(_0x0494('0x3'));var BPromise=require('bluebird');var rp=require(_0x0494('0x4'));var fs=require('fs');var path=require(_0x0494('0x5'));var rimraf=require(_0x0494('0x6'));var config=require(_0x0494('0x7'));var attributes=require(_0x0494('0x8'));module[_0x0494('0x9')]=function(_0x1efc89,_0x137087){return _0x1efc89[_0x0494('0xa')](_0x0494('0xb'),attributes,{'tableName':_0x0494('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17be27,_0x218e00,_0x118e36){if(_0x17be27[_0x0494('0xd')](_0x0494('0xe'))){_0x17be27['closedAt']=moment()[_0x0494('0xf')](_0x0494('0x10'));}_0x118e36(null,_0x17be27);}}});};