9217a904bcc73ccb4918b02363d8c845e95c5539
[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 _0xf2cd=['rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','request-promise'];(function(_0x35b7d4,_0x5a5c43){var _0x4e8cee=function(_0x66859c){while(--_0x66859c){_0x35b7d4['push'](_0x35b7d4['shift']());}};_0x4e8cee(++_0x5a5c43);}(_0xf2cd,0x15b));var _0xdf2c=function(_0x118653,_0x50ef26){_0x118653=_0x118653-0x0;var _0xc11fa6=_0xf2cd[_0x118653];return _0xc11fa6;};'use strict';var _=require(_0xdf2c('0x0'));var util=require('util');var logger=require(_0xdf2c('0x1'))(_0xdf2c('0x2'));var moment=require(_0xdf2c('0x3'));var BPromise=require('bluebird');var rp=require(_0xdf2c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdf2c('0x5'));var config=require(_0xdf2c('0x6'));var attributes=require(_0xdf2c('0x7'));module[_0xdf2c('0x8')]=function(_0xb32c88,_0x28505a){return _0xb32c88[_0xdf2c('0x9')](_0xdf2c('0xa'),attributes,{'tableName':_0xdf2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3d9a97,_0x1a25c9,_0x35261c){if(_0x3d9a97[_0xdf2c('0xc')](_0xdf2c('0xd'))){_0x3d9a97['closedAt']=moment()[_0xdf2c('0xe')](_0xdf2c('0xf'));}_0x35261c(null,_0x3d9a97);}}});};