3fad6d43ea2254e8f4985c09d32b8f288ed00bcf
[motion2.git] / server / api / whatsappInteraction / whatsappInteraction.model.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x612f=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xb6c3a7,_0x5a3390){var _0x311f0f=function(_0x49101b){while(--_0x49101b){_0xb6c3a7['push'](_0xb6c3a7['shift']());}};_0x311f0f(++_0x5a3390);}(_0x612f,0xab));var _0xf612=function(_0xa0f0fe,_0x147d88){_0xa0f0fe=_0xa0f0fe-0x0;var _0x824abf=_0x612f[_0xa0f0fe];return _0x824abf;};'use strict';var _=require(_0xf612('0x0'));var util=require(_0xf612('0x1'));var logger=require(_0xf612('0x2'))(_0xf612('0x3'));var moment=require(_0xf612('0x4'));var BPromise=require(_0xf612('0x5'));var rp=require(_0xf612('0x6'));var fs=require('fs');var path=require(_0xf612('0x7'));var rimraf=require('rimraf');var config=require(_0xf612('0x8'));var attributes=require(_0xf612('0x9'));module[_0xf612('0xa')]=function(_0x4ce88c,_0xe0459c){return _0x4ce88c[_0xf612('0xb')](_0xf612('0xc'),attributes,{'tableName':_0xf612('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x425a62,_0x9276e8,_0x400606){if(_0x425a62[_0xf612('0xe')](_0xf612('0xf'))){_0x425a62[_0xf612('0x10')]=moment()[_0xf612('0x11')](_0xf612('0x12'));}_0x400606(null,_0x425a62);}}});};