ed75ddd7b5de70881a9f479dd284f63258344421
[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 _0x33a5=['exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x5cc8,_0x1faa02){var _0x450661=function(_0x237b05){while(--_0x237b05){_0x5cc8['push'](_0x5cc8['shift']());}};_0x450661(++_0x1faa02);}(_0x33a5,0x125));var _0x533a=function(_0x11cc1c,_0x5ecd77){_0x11cc1c=_0x11cc1c-0x0;var _0x3985a4=_0x33a5[_0x11cc1c];return _0x3985a4;};'use strict';var _=require(_0x533a('0x0'));var util=require(_0x533a('0x1'));var logger=require(_0x533a('0x2'))(_0x533a('0x3'));var moment=require(_0x533a('0x4'));var BPromise=require(_0x533a('0x5'));var rp=require(_0x533a('0x6'));var fs=require('fs');var path=require(_0x533a('0x7'));var rimraf=require(_0x533a('0x8'));var config=require(_0x533a('0x9'));var attributes=require(_0x533a('0xa'));module[_0x533a('0xb')]=function(_0x1bacf2,_0x4ea14d){return _0x1bacf2[_0x533a('0xc')](_0x533a('0xd'),attributes,{'tableName':_0x533a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4d3c5d,_0x545b92,_0x211605){if(_0x4d3c5d[_0x533a('0xf')](_0x533a('0x10'))){_0x4d3c5d['closedAt']=moment()[_0x533a('0x11')](_0x533a('0x12'));}_0x211605(null,_0x4d3c5d);}}});};