Built motion from commit cf5ff673.|2.5.41
[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 _0xbb29=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x39e15b,_0x555185){var _0x4e5766=function(_0x45ef45){while(--_0x45ef45){_0x39e15b['push'](_0x39e15b['shift']());}};_0x4e5766(++_0x555185);}(_0xbb29,0x80));var _0x9bb2=function(_0x7f8c63,_0x3719b6){_0x7f8c63=_0x7f8c63-0x0;var _0x2c364d=_0xbb29[_0x7f8c63];return _0x2c364d;};'use strict';var _=require(_0x9bb2('0x0'));var util=require(_0x9bb2('0x1'));var logger=require(_0x9bb2('0x2'))(_0x9bb2('0x3'));var moment=require(_0x9bb2('0x4'));var BPromise=require('bluebird');var rp=require(_0x9bb2('0x5'));var fs=require('fs');var path=require(_0x9bb2('0x6'));var rimraf=require(_0x9bb2('0x7'));var config=require('../../config/environment');var attributes=require(_0x9bb2('0x8'));module[_0x9bb2('0x9')]=function(_0x36a096,_0x1c9fc5){return _0x36a096[_0x9bb2('0xa')](_0x9bb2('0xb'),attributes,{'tableName':_0x9bb2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5872c5,_0x14314c,_0x4fe698){if(_0x5872c5[_0x9bb2('0xd')](_0x9bb2('0xe'))){_0x5872c5['closedAt']=moment()[_0x9bb2('0xf')](_0x9bb2('0x10'));}_0x4fe698(null,_0x5872c5);}}});};