b9ae312042bf13b0e1a03b20bdf9f19158c311f5
[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 _0x88e3=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','closed','format','lodash','util','../../config/logger','api'];(function(_0x3e7d35,_0x1fe5f6){var _0x559261=function(_0x2fdde8){while(--_0x2fdde8){_0x3e7d35['push'](_0x3e7d35['shift']());}};_0x559261(++_0x1fe5f6);}(_0x88e3,0x183));var _0x388e=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0x88e3[_0x34a14d];return _0x2015f2;};'use strict';var _=require(_0x388e('0x0'));var util=require(_0x388e('0x1'));var logger=require(_0x388e('0x2'))(_0x388e('0x3'));var moment=require(_0x388e('0x4'));var BPromise=require(_0x388e('0x5'));var rp=require(_0x388e('0x6'));var fs=require('fs');var path=require(_0x388e('0x7'));var rimraf=require(_0x388e('0x8'));var config=require(_0x388e('0x9'));var attributes=require(_0x388e('0xa'));module[_0x388e('0xb')]=function(_0x43d8b5,_0x5d01ba){return _0x43d8b5[_0x388e('0xc')]('WhatsappInteraction',attributes,{'tableName':_0x388e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2ac35b,_0x4e5a3a,_0x52998a){if(_0x2ac35b[_0x388e('0xe')](_0x388e('0xf'))){_0x2ac35b['closedAt']=moment()[_0x388e('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52998a(null,_0x2ac35b);}}});};