Built motion from commit da24aabd.|2.6.20
[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 _0xb329=['moment','bluebird','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x343c0f,_0x5944a3){var _0x2cfca4=function(_0x3ffbff){while(--_0x3ffbff){_0x343c0f['push'](_0x343c0f['shift']());}};_0x2cfca4(++_0x5944a3);}(_0xb329,0x119));var _0x9b32=function(_0x254b22,_0x27159f){_0x254b22=_0x254b22-0x0;var _0x1279db=_0xb329[_0x254b22];return _0x1279db;};'use strict';var _=require(_0x9b32('0x0'));var util=require(_0x9b32('0x1'));var logger=require(_0x9b32('0x2'))(_0x9b32('0x3'));var moment=require(_0x9b32('0x4'));var BPromise=require(_0x9b32('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9b32('0x6'));var config=require('../../config/environment');var attributes=require(_0x9b32('0x7'));module[_0x9b32('0x8')]=function(_0x204f96,_0x246734){return _0x204f96[_0x9b32('0x9')](_0x9b32('0xa'),attributes,{'tableName':_0x9b32('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5f1263,_0x5c2d55,_0x2f3067){if(_0x5f1263[_0x9b32('0xc')]('closed')){_0x5f1263['closedAt']=moment()[_0x9b32('0xd')](_0x9b32('0xe'));}_0x2f3067(null,_0x5f1263);}}});};