f141f9844bfb10ae25df36be318950878a7d09a9
[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 _0xdc96=['whatsapp_interactions','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','request-promise','rimraf','./whatsappInteraction.attributes','define','WhatsappInteraction'];(function(_0x40e7e6,_0x3911b8){var _0x361981=function(_0xe1e631){while(--_0xe1e631){_0x40e7e6['push'](_0x40e7e6['shift']());}};_0x361981(++_0x3911b8);}(_0xdc96,0xe8));var _0x6dc9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xdc96[_0x4b7895];return _0x264180;};'use strict';var _=require(_0x6dc9('0x0'));var util=require('util');var logger=require(_0x6dc9('0x1'))(_0x6dc9('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6dc9('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dc9('0x4'));var config=require('../../config/environment');var attributes=require(_0x6dc9('0x5'));module['exports']=function(_0x3f8ebf,_0x3a42eb){return _0x3f8ebf[_0x6dc9('0x6')](_0x6dc9('0x7'),attributes,{'tableName':_0x6dc9('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24b95c,_0x13c826,_0x2c3ba3){if(_0x24b95c['changed']('closed')){_0x24b95c[_0x6dc9('0x9')]=moment()[_0x6dc9('0xa')](_0x6dc9('0xb'));}_0x2c3ba3(null,_0x24b95c);}}});};