Built motion from commit 9e1399f3.|2.5.37
[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 _0x207d=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','request-promise','rimraf','./whatsappInteraction.attributes','define','whatsapp_interactions','changed'];(function(_0x298527,_0x542f83){var _0x3264f3=function(_0x4d05c7){while(--_0x4d05c7){_0x298527['push'](_0x298527['shift']());}};_0x3264f3(++_0x542f83);}(_0x207d,0x189));var _0xd207=function(_0x47ee28,_0x254880){_0x47ee28=_0x47ee28-0x0;var _0xd7f35a=_0x207d[_0x47ee28];return _0xd7f35a;};'use strict';var _=require(_0xd207('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xd207('0x1'));var moment=require(_0xd207('0x2'));var BPromise=require(_0xd207('0x3'));var rp=require(_0xd207('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd207('0x5'));var config=require('../../config/environment');var attributes=require(_0xd207('0x6'));module['exports']=function(_0x1bef25,_0x2ecf02){return _0x1bef25[_0xd207('0x7')]('WhatsappInteraction',attributes,{'tableName':_0xd207('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x7fd277,_0x4de2aa,_0x397b47){if(_0x7fd277[_0xd207('0x9')]('closed')){_0x7fd277[_0xd207('0xa')]=moment()[_0xd207('0xb')](_0xd207('0xc'));}_0x397b47(null,_0x7fd277);}}});};