891acb0efeb822902c6026ffcd19ec439e5ef2f7
[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 _0x6213=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x19403e,_0xff8da6){var _0x14cc23=function(_0xa75aad){while(--_0xa75aad){_0x19403e['push'](_0x19403e['shift']());}};_0x14cc23(++_0xff8da6);}(_0x6213,0xf7));var _0x3621=function(_0x40e496,_0x317080){_0x40e496=_0x40e496-0x0;var _0x2a0f09=_0x6213[_0x40e496];return _0x2a0f09;};'use strict';var _=require(_0x3621('0x0'));var util=require(_0x3621('0x1'));var logger=require(_0x3621('0x2'))(_0x3621('0x3'));var moment=require(_0x3621('0x4'));var BPromise=require('bluebird');var rp=require(_0x3621('0x5'));var fs=require('fs');var path=require(_0x3621('0x6'));var rimraf=require(_0x3621('0x7'));var config=require(_0x3621('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x3621('0x9')]=function(_0x437d81,_0x42232b){return _0x437d81[_0x3621('0xa')](_0x3621('0xb'),attributes,{'tableName':_0x3621('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x261dba,_0x5c458d,_0x648e19){if(_0x261dba[_0x3621('0xd')](_0x3621('0xe'))){_0x261dba[_0x3621('0xf')]=moment()[_0x3621('0x10')](_0x3621('0x11'));}_0x648e19(null,_0x261dba);}}});};