Built motion from commit (unavailable).|2.5.2
[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 _0xdd88=['YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','closed','format'];(function(_0x26b7dc,_0x2a6524){var _0x31da0a=function(_0x2e0453){while(--_0x2e0453){_0x26b7dc['push'](_0x26b7dc['shift']());}};_0x31da0a(++_0x2a6524);}(_0xdd88,0x97));var _0x8dd8=function(_0x5e3337,_0x5993fc){_0x5e3337=_0x5e3337-0x0;var _0x6bb8a6=_0xdd88[_0x5e3337];return _0x6bb8a6;};'use strict';var _=require('lodash');var util=require(_0x8dd8('0x0'));var logger=require(_0x8dd8('0x1'))(_0x8dd8('0x2'));var moment=require(_0x8dd8('0x3'));var BPromise=require(_0x8dd8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8dd8('0x5'));var rimraf=require(_0x8dd8('0x6'));var config=require(_0x8dd8('0x7'));var attributes=require(_0x8dd8('0x8'));module['exports']=function(_0x4c067b,_0x5e2dd8){return _0x4c067b[_0x8dd8('0x9')](_0x8dd8('0xa'),attributes,{'tableName':_0x8dd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x566108,_0x1b12c1,_0x209cdf){if(_0x566108['changed'](_0x8dd8('0xc'))){_0x566108['closedAt']=moment()[_0x8dd8('0xd')](_0x8dd8('0xe'));}_0x209cdf(null,_0x566108);}}});};