Built motion from commit 87cd5f02.|2.5.48
[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 _0x4894=['exports','WhatsappInteraction','whatsapp_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./whatsappInteraction.attributes'];(function(_0x1ff1fc,_0x26aef2){var _0x246829=function(_0x3a59fe){while(--_0x3a59fe){_0x1ff1fc['push'](_0x1ff1fc['shift']());}};_0x246829(++_0x26aef2);}(_0x4894,0x13a));var _0x4489=function(_0x22dc3e,_0x20da39){_0x22dc3e=_0x22dc3e-0x0;var _0x18505a=_0x4894[_0x22dc3e];return _0x18505a;};'use strict';var _=require(_0x4489('0x0'));var util=require(_0x4489('0x1'));var logger=require(_0x4489('0x2'))(_0x4489('0x3'));var moment=require('moment');var BPromise=require(_0x4489('0x4'));var rp=require(_0x4489('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4489('0x6'));var attributes=require(_0x4489('0x7'));module[_0x4489('0x8')]=function(_0x448ab1,_0x47ef50){return _0x448ab1['define'](_0x4489('0x9'),attributes,{'tableName':_0x4489('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4f9c84,_0x27c463,_0x58f236){if(_0x4f9c84[_0x4489('0xb')](_0x4489('0xc'))){_0x4f9c84['closedAt']=moment()['format'](_0x4489('0xd'));}_0x58f236(null,_0x4f9c84);}}});};