Built motion from commit da617fac.|2.6.6
[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 _0x9f7b=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x18a8d1,_0x4302c4){var _0x3ebf19=function(_0x134653){while(--_0x134653){_0x18a8d1['push'](_0x18a8d1['shift']());}};_0x3ebf19(++_0x4302c4);}(_0x9f7b,0x15e));var _0xb9f7=function(_0x48bb68,_0x4e80c9){_0x48bb68=_0x48bb68-0x0;var _0x20638a=_0x9f7b[_0x48bb68];return _0x20638a;};'use strict';var _=require(_0xb9f7('0x0'));var util=require(_0xb9f7('0x1'));var logger=require(_0xb9f7('0x2'))(_0xb9f7('0x3'));var moment=require(_0xb9f7('0x4'));var BPromise=require(_0xb9f7('0x5'));var rp=require(_0xb9f7('0x6'));var fs=require('fs');var path=require(_0xb9f7('0x7'));var rimraf=require(_0xb9f7('0x8'));var config=require(_0xb9f7('0x9'));var attributes=require(_0xb9f7('0xa'));module[_0xb9f7('0xb')]=function(_0x57f659,_0x646fe9){return _0x57f659[_0xb9f7('0xc')](_0xb9f7('0xd'),attributes,{'tableName':_0xb9f7('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xac6e20,_0x35ef3e,_0x2a004e){if(_0xac6e20[_0xb9f7('0xf')]('closed')){_0xac6e20[_0xb9f7('0x10')]=moment()[_0xb9f7('0x11')](_0xb9f7('0x12'));}_0x2a004e(null,_0xac6e20);}}});};