Built motion from commit (unavailable).|2.5.31
[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 _0x23be=['closedAt','format','lodash','util','moment','bluebird','path','rimraf','../../config/environment','define','WhatsappInteraction','whatsapp_interactions','changed','closed'];(function(_0x57cfd7,_0x269137){var _0x18cacc=function(_0x38f6eb){while(--_0x38f6eb){_0x57cfd7['push'](_0x57cfd7['shift']());}};_0x18cacc(++_0x269137);}(_0x23be,0x1b4));var _0xe23b=function(_0x5230b7,_0x3a0911){_0x5230b7=_0x5230b7-0x0;var _0x59c1f4=_0x23be[_0x5230b7];return _0x59c1f4;};'use strict';var _=require(_0xe23b('0x0'));var util=require(_0xe23b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe23b('0x2'));var BPromise=require(_0xe23b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe23b('0x4'));var rimraf=require(_0xe23b('0x5'));var config=require(_0xe23b('0x6'));var attributes=require('./whatsappInteraction.attributes');module['exports']=function(_0x1d6797,_0x582cd3){return _0x1d6797[_0xe23b('0x7')](_0xe23b('0x8'),attributes,{'tableName':_0xe23b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4ffcd1,_0x1b0600,_0x4554fb){if(_0x4ffcd1[_0xe23b('0xa')](_0xe23b('0xb'))){_0x4ffcd1[_0xe23b('0xc')]=moment()[_0xe23b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4554fb(null,_0x4ffcd1);}}});};