2727c9ab446bd9b7279bbbb6f25d00f1ddee204a
[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 _0xbcd1=['moment','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xbcd1,0x16b));var _0x1bcd=function(_0x82b73d,_0x17a49b){_0x82b73d=_0x82b73d-0x0;var _0x250450=_0xbcd1[_0x82b73d];return _0x250450;};'use strict';var _=require(_0x1bcd('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1bcd('0x1'));var BPromise=require('bluebird');var rp=require(_0x1bcd('0x2'));var fs=require('fs');var path=require(_0x1bcd('0x3'));var rimraf=require('rimraf');var config=require(_0x1bcd('0x4'));var attributes=require(_0x1bcd('0x5'));module[_0x1bcd('0x6')]=function(_0x32fe9b,_0x3184c4){return _0x32fe9b['define'](_0x1bcd('0x7'),attributes,{'tableName':_0x1bcd('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x35a224,_0x87c4cd,_0x40a233){if(_0x35a224[_0x1bcd('0x9')](_0x1bcd('0xa'))){_0x35a224[_0x1bcd('0xb')]=moment()[_0x1bcd('0xc')](_0x1bcd('0xd'));}_0x40a233(null,_0x35a224);}}});};