239148500e7fa06a7ae1496c9e252e8917cea978
[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 _0x7af9=['whatsapp_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','request-promise','rimraf','./whatsappInteraction.attributes','WhatsappInteraction'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0x7af9,0x7c));var _0x97af=function(_0x49cdf5,_0x2423f6){_0x49cdf5=_0x49cdf5-0x0;var _0x3461d3=_0x7af9[_0x49cdf5];return _0x3461d3;};'use strict';var _=require(_0x97af('0x0'));var util=require(_0x97af('0x1'));var logger=require(_0x97af('0x2'))(_0x97af('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x97af('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x97af('0x5'));var config=require('../../config/environment');var attributes=require(_0x97af('0x6'));module['exports']=function(_0x19a1a6,_0x31e3f6){return _0x19a1a6['define'](_0x97af('0x7'),attributes,{'tableName':_0x97af('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ac404,_0x8ef8c9,_0x112321){if(_0x1ac404['changed'](_0x97af('0x9'))){_0x1ac404[_0x97af('0xa')]=moment()['format'](_0x97af('0xb'));}_0x112321(null,_0x1ac404);}}});};