Built motion from commit 932cf0d0.|2.5.42
[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 _0x81e5=['../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','closedAt','format','lodash','api','moment','bluebird','path'];(function(_0x5617,_0x592343){var _0xe662da=function(_0x19b54e){while(--_0x19b54e){_0x5617['push'](_0x5617['shift']());}};_0xe662da(++_0x592343);}(_0x81e5,0x97));var _0x581e=function(_0x17aabe,_0x1812d2){_0x17aabe=_0x17aabe-0x0;var _0x5ac57e=_0x81e5[_0x17aabe];return _0x5ac57e;};'use strict';var _=require(_0x581e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x581e('0x1'));var moment=require(_0x581e('0x2'));var BPromise=require(_0x581e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x581e('0x4'));var rimraf=require('rimraf');var config=require(_0x581e('0x5'));var attributes=require(_0x581e('0x6'));module[_0x581e('0x7')]=function(_0x1a9253,_0x132ab5){return _0x1a9253[_0x581e('0x8')]('WhatsappInteraction',attributes,{'tableName':_0x581e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f8654,_0x432aa5,_0xc89bc9){if(_0x3f8654['changed']('closed')){_0x3f8654[_0x581e('0xa')]=moment()[_0x581e('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0xc89bc9(null,_0x3f8654);}}});};