Built motion from commit fe909640.|2.6.8
[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 _0xb1ed=['rimraf','../../config/environment','exports','define','whatsapp_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','request-promise','path'];(function(_0x38ee97,_0x2eb830){var _0x4f3fc6=function(_0x37fa77){while(--_0x37fa77){_0x38ee97['push'](_0x38ee97['shift']());}};_0x4f3fc6(++_0x2eb830);}(_0xb1ed,0x1f2));var _0xdb1e=function(_0x5de967,_0x515918){_0x5de967=_0x5de967-0x0;var _0x5b07a3=_0xb1ed[_0x5de967];return _0x5b07a3;};'use strict';var _=require(_0xdb1e('0x0'));var util=require(_0xdb1e('0x1'));var logger=require('../../config/logger')(_0xdb1e('0x2'));var moment=require(_0xdb1e('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb1e('0x4'));var fs=require('fs');var path=require(_0xdb1e('0x5'));var rimraf=require(_0xdb1e('0x6'));var config=require(_0xdb1e('0x7'));var attributes=require('./whatsappInteraction.attributes');module[_0xdb1e('0x8')]=function(_0x4669f5,_0x1cda07){return _0x4669f5[_0xdb1e('0x9')]('WhatsappInteraction',attributes,{'tableName':_0xdb1e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x213a40,_0x3507d2,_0x98a2f4){if(_0x213a40[_0xdb1e('0xb')](_0xdb1e('0xc'))){_0x213a40['closedAt']=moment()['format'](_0xdb1e('0xd'));}_0x98a2f4(null,_0x213a40);}}});};