Built motion from commit e6806ed6.|2.6.0
[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 _0x5973=['changed','closed','format','lodash','util','api','moment','request-promise','path','./whatsappInteraction.attributes','exports','define','whatsapp_interactions'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0x5973,0xb9));var _0x3597=function(_0x386658,_0x49f7c5){_0x386658=_0x386658-0x0;var _0x146125=_0x5973[_0x386658];return _0x146125;};'use strict';var _=require(_0x3597('0x0'));var util=require(_0x3597('0x1'));var logger=require('../../config/logger')(_0x3597('0x2'));var moment=require(_0x3597('0x3'));var BPromise=require('bluebird');var rp=require(_0x3597('0x4'));var fs=require('fs');var path=require(_0x3597('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3597('0x6'));module[_0x3597('0x7')]=function(_0x55d0b2,_0x241b5d){return _0x55d0b2[_0x3597('0x8')]('WhatsappInteraction',attributes,{'tableName':_0x3597('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x38d15b,_0x4fd7d5,_0x2d66c7){if(_0x38d15b[_0x3597('0xa')](_0x3597('0xb'))){_0x38d15b['closedAt']=moment()[_0x3597('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d66c7(null,_0x38d15b);}}});};