Built motion from commit (unavailable).|2.5.4
[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 _0xd49d=['exports','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes'];(function(_0x1b9ae4,_0x28740d){var _0x327cdf=function(_0x4e0f1e){while(--_0x4e0f1e){_0x1b9ae4['push'](_0x1b9ae4['shift']());}};_0x327cdf(++_0x28740d);}(_0xd49d,0x197));var _0xdd49=function(_0xa4e067,_0x3431ce){_0xa4e067=_0xa4e067-0x0;var _0x3f664a=_0xd49d[_0xa4e067];return _0x3f664a;};'use strict';var _=require(_0xdd49('0x0'));var util=require(_0xdd49('0x1'));var logger=require(_0xdd49('0x2'))(_0xdd49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdd49('0x4'));var fs=require('fs');var path=require(_0xdd49('0x5'));var rimraf=require(_0xdd49('0x6'));var config=require(_0xdd49('0x7'));var attributes=require(_0xdd49('0x8'));module[_0xdd49('0x9')]=function(_0x4ec99e,_0x2866df){return _0x4ec99e['define'](_0xdd49('0xa'),attributes,{'tableName':_0xdd49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x28e2c0,_0x148cf0,_0x2b7747){if(_0x28e2c0[_0xdd49('0xc')](_0xdd49('0xd'))){_0x28e2c0['closedAt']=moment()[_0xdd49('0xe')](_0xdd49('0xf'));}_0x2b7747(null,_0x28e2c0);}}});};