b3060a65fbfbd43b329f98487484332233e395fe
[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 _0xab95=['bluebird','request-promise','path','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment'];(function(_0x4810ee,_0x2b6c3b){var _0x4b8e33=function(_0x124336){while(--_0x124336){_0x4810ee['push'](_0x4810ee['shift']());}};_0x4b8e33(++_0x2b6c3b);}(_0xab95,0xaf));var _0x5ab9=function(_0x4fadb3,_0x609f0b){_0x4fadb3=_0x4fadb3-0x0;var _0x384a7e=_0xab95[_0x4fadb3];return _0x384a7e;};'use strict';var _=require(_0x5ab9('0x0'));var util=require(_0x5ab9('0x1'));var logger=require(_0x5ab9('0x2'))(_0x5ab9('0x3'));var moment=require(_0x5ab9('0x4'));var BPromise=require(_0x5ab9('0x5'));var rp=require(_0x5ab9('0x6'));var fs=require('fs');var path=require(_0x5ab9('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5ab9('0x8'));module[_0x5ab9('0x9')]=function(_0x8f739e,_0x46af13){return _0x8f739e[_0x5ab9('0xa')](_0x5ab9('0xb'),attributes,{'tableName':_0x5ab9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x483c3d,_0x3a91fc,_0x3018ae){if(_0x483c3d[_0x5ab9('0xd')](_0x5ab9('0xe'))){_0x483c3d[_0x5ab9('0xf')]=moment()[_0x5ab9('0x10')](_0x5ab9('0x11'));}_0x3018ae(null,_0x483c3d);}}});};