Built motion from commit 0900f080.|2.5.45
[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 _0xd3d4=['moment','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x12d3c4,_0x54f685){var _0x30d6d5=function(_0x5af7d4){while(--_0x5af7d4){_0x12d3c4['push'](_0x12d3c4['shift']());}};_0x30d6d5(++_0x54f685);}(_0xd3d4,0x1bc));var _0x4d3d=function(_0x37b35d,_0x32f217){_0x37b35d=_0x37b35d-0x0;var _0x13e692=_0xd3d4[_0x37b35d];return _0x13e692;};'use strict';var _=require(_0x4d3d('0x0'));var util=require(_0x4d3d('0x1'));var logger=require(_0x4d3d('0x2'))(_0x4d3d('0x3'));var moment=require(_0x4d3d('0x4'));var BPromise=require('bluebird');var rp=require(_0x4d3d('0x5'));var fs=require('fs');var path=require(_0x4d3d('0x6'));var rimraf=require(_0x4d3d('0x7'));var config=require(_0x4d3d('0x8'));var attributes=require('./whatsappInteraction.attributes');module[_0x4d3d('0x9')]=function(_0x23e00a,_0x1bea75){return _0x23e00a['define'](_0x4d3d('0xa'),attributes,{'tableName':_0x4d3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x315bfa,_0x5014bf,_0x526ff3){if(_0x315bfa[_0x4d3d('0xc')](_0x4d3d('0xd'))){_0x315bfa['closedAt']=moment()[_0x4d3d('0xe')](_0x4d3d('0xf'));}_0x526ff3(null,_0x315bfa);}}});};