1f45b745e46e7a69330c8ccbb393e7cce657a94b
[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 _0xdf65=['whatsapp_interactions','changed','closed','closedAt','format','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction'];(function(_0x225e24,_0x478574){var _0x526038=function(_0xfe2533){while(--_0xfe2533){_0x225e24['push'](_0x225e24['shift']());}};_0x526038(++_0x478574);}(_0xdf65,0x6e));var _0x5df6=function(_0x2529ce,_0x32822f){_0x2529ce=_0x2529ce-0x0;var _0x487133=_0xdf65[_0x2529ce];return _0x487133;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5df6('0x0'))(_0x5df6('0x1'));var moment=require('moment');var BPromise=require(_0x5df6('0x2'));var rp=require(_0x5df6('0x3'));var fs=require('fs');var path=require(_0x5df6('0x4'));var rimraf=require('rimraf');var config=require(_0x5df6('0x5'));var attributes=require(_0x5df6('0x6'));module[_0x5df6('0x7')]=function(_0x117d80,_0x31667e){return _0x117d80[_0x5df6('0x8')](_0x5df6('0x9'),attributes,{'tableName':_0x5df6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x205182,_0x4d5fff,_0x564a15){if(_0x205182[_0x5df6('0xb')](_0x5df6('0xc'))){_0x205182[_0x5df6('0xd')]=moment()[_0x5df6('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x564a15(null,_0x205182);}}});};