90629df2c3158b857ab749974800b28c37c75bf1
[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 _0x52db=['path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise'];(function(_0x867c03,_0x5f532d){var _0x760969=function(_0xd23675){while(--_0xd23675){_0x867c03['push'](_0x867c03['shift']());}};_0x760969(++_0x5f532d);}(_0x52db,0xe9));var _0xb52d=function(_0x494c47,_0x238d36){_0x494c47=_0x494c47-0x0;var _0x30db84=_0x52db[_0x494c47];return _0x30db84;};'use strict';var _=require(_0xb52d('0x0'));var util=require(_0xb52d('0x1'));var logger=require(_0xb52d('0x2'))(_0xb52d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb52d('0x4'));var fs=require('fs');var path=require(_0xb52d('0x5'));var rimraf=require(_0xb52d('0x6'));var config=require(_0xb52d('0x7'));var attributes=require(_0xb52d('0x8'));module[_0xb52d('0x9')]=function(_0x5e1250,_0x476ae9){return _0x5e1250['define'](_0xb52d('0xa'),attributes,{'tableName':_0xb52d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x474533,_0x33758c,_0x4b7178){if(_0x474533[_0xb52d('0xc')](_0xb52d('0xd'))){_0x474533[_0xb52d('0xe')]=moment()[_0xb52d('0xf')](_0xb52d('0x10'));}_0x4b7178(null,_0x474533);}}});};