43faa724d5bcdd68d5ed5ba8cef2e7556cd4fb3d
[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 _0x98ad=['lodash','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','changed','closed','format'];(function(_0x8bcb91,_0x593bd8){var _0x1c5bf8=function(_0x28decf){while(--_0x28decf){_0x8bcb91['push'](_0x8bcb91['shift']());}};_0x1c5bf8(++_0x593bd8);}(_0x98ad,0x15e));var _0xd98a=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x98ad[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xd98a('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd98a('0x1'));var moment=require(_0xd98a('0x2'));var BPromise=require(_0xd98a('0x3'));var rp=require(_0xd98a('0x4'));var fs=require('fs');var path=require(_0xd98a('0x5'));var rimraf=require('rimraf');var config=require(_0xd98a('0x6'));var attributes=require(_0xd98a('0x7'));module[_0xd98a('0x8')]=function(_0x2cf72c,_0x3d892){return _0x2cf72c[_0xd98a('0x9')](_0xd98a('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4e7b1e,_0x1d6ca9,_0xfd2111){if(_0x4e7b1e[_0xd98a('0xb')](_0xd98a('0xc'))){_0x4e7b1e['closedAt']=moment()[_0xd98a('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0xfd2111(null,_0x4e7b1e);}}});};