5cf793affc8a4be9ca60dd7f5be0212dcf308496
[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 _0x16ce=['bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x17fc60,_0x4d39bc){var _0x4a37cb=function(_0x16e2f7){while(--_0x16e2f7){_0x17fc60['push'](_0x17fc60['shift']());}};_0x4a37cb(++_0x4d39bc);}(_0x16ce,0x1a5));var _0xe16c=function(_0x3a7d23,_0xe43dc2){_0x3a7d23=_0x3a7d23-0x0;var _0x4cae4d=_0x16ce[_0x3a7d23];return _0x4cae4d;};'use strict';var _=require(_0xe16c('0x0'));var util=require(_0xe16c('0x1'));var logger=require('../../config/logger')(_0xe16c('0x2'));var moment=require(_0xe16c('0x3'));var BPromise=require(_0xe16c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe16c('0x5'));var rimraf=require(_0xe16c('0x6'));var config=require(_0xe16c('0x7'));var attributes=require(_0xe16c('0x8'));module[_0xe16c('0x9')]=function(_0x2cc9c1,_0x1fab75){return _0x2cc9c1[_0xe16c('0xa')](_0xe16c('0xb'),attributes,{'tableName':_0xe16c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9c9a6c,_0x463947,_0x2456ae){if(_0x9c9a6c[_0xe16c('0xd')](_0xe16c('0xe'))){_0x9c9a6c['closedAt']=moment()[_0xe16c('0xf')](_0xe16c('0x10'));}_0x2456ae(null,_0x9c9a6c);}}});};