4c0009f034f91b1e72092aa60e04056d24d9e271
[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 _0xfb15=['WhatsappInteraction','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define'];(function(_0x30f59e,_0x2ff9a1){var _0xa43aff=function(_0x3baef1){while(--_0x3baef1){_0x30f59e['push'](_0x30f59e['shift']());}};_0xa43aff(++_0x2ff9a1);}(_0xfb15,0xf4));var _0x5fb1=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xfb15[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x5fb1('0x0'));var util=require(_0x5fb1('0x1'));var logger=require(_0x5fb1('0x2'))(_0x5fb1('0x3'));var moment=require(_0x5fb1('0x4'));var BPromise=require(_0x5fb1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fb1('0x6'));var rimraf=require(_0x5fb1('0x7'));var config=require(_0x5fb1('0x8'));var attributes=require(_0x5fb1('0x9'));module['exports']=function(_0x11a8e8,_0x43aed4){return _0x11a8e8[_0x5fb1('0xa')](_0x5fb1('0xb'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3dd54a,_0x471a2f,_0x48c833){if(_0x3dd54a['changed'](_0x5fb1('0xc'))){_0x3dd54a['closedAt']=moment()[_0x5fb1('0xd')](_0x5fb1('0xe'));}_0x48c833(null,_0x3dd54a);}}});};