75a18ba5ca91a552ccf0e2a521cc3c9f13d18c21
[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 _0x1de5=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closed','closedAt'];(function(_0x2ef22c,_0x5350de){var _0x3fc2ac=function(_0xcd41c6){while(--_0xcd41c6){_0x2ef22c['push'](_0x2ef22c['shift']());}};_0x3fc2ac(++_0x5350de);}(_0x1de5,0x13d));var _0x51de=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1de5[_0xda464c];return _0x19e222;};'use strict';var _=require(_0x51de('0x0'));var util=require(_0x51de('0x1'));var logger=require(_0x51de('0x2'))(_0x51de('0x3'));var moment=require(_0x51de('0x4'));var BPromise=require(_0x51de('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x51de('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x51de('0x7'));module['exports']=function(_0x29204f,_0x399a04){return _0x29204f[_0x51de('0x8')](_0x51de('0x9'),attributes,{'tableName':_0x51de('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e57ef,_0xd44509,_0x37b91c){if(_0x3e57ef['changed'](_0x51de('0xb'))){_0x3e57ef[_0x51de('0xc')]=moment()[_0x51de('0xd')](_0x51de('0xe'));}_0x37b91c(null,_0x3e57ef);}}});};