Built motion from commit 9d7072cc.|2.5.39
[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 _0x4f01=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird'];(function(_0xf80b3,_0x25d5f3){var _0x10c489=function(_0x3c5aee){while(--_0x3c5aee){_0xf80b3['push'](_0xf80b3['shift']());}};_0x10c489(++_0x25d5f3);}(_0x4f01,0xe5));var _0x14f0=function(_0x50fa61,_0x5b88b8){_0x50fa61=_0x50fa61-0x0;var _0x150584=_0x4f01[_0x50fa61];return _0x150584;};'use strict';var _=require('lodash');var util=require(_0x14f0('0x0'));var logger=require(_0x14f0('0x1'))(_0x14f0('0x2'));var moment=require(_0x14f0('0x3'));var BPromise=require(_0x14f0('0x4'));var rp=require(_0x14f0('0x5'));var fs=require('fs');var path=require(_0x14f0('0x6'));var rimraf=require(_0x14f0('0x7'));var config=require(_0x14f0('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x14f0('0x9')]=function(_0x36bc10,_0x5c4969){return _0x36bc10[_0x14f0('0xa')](_0x14f0('0xb'),attributes,{'tableName':_0x14f0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf71652,_0x3c434c,_0x2444dc){if(_0xf71652[_0x14f0('0xd')](_0x14f0('0xe'))){_0xf71652[_0x14f0('0xf')]=moment()[_0x14f0('0x10')](_0x14f0('0x11'));}_0x2444dc(null,_0xf71652);}}});};