fd27a95457c7d6126a0617fa38e31f61ebad196c
[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 _0x9b6b=['bluebird','request-promise','path','rimraf','../../config/environment','exports','WhatsappInteraction','closedAt','format','../../config/logger'];(function(_0x2c45c9,_0x221849){var _0x4701e9=function(_0xc1c85b){while(--_0xc1c85b){_0x2c45c9['push'](_0x2c45c9['shift']());}};_0x4701e9(++_0x221849);}(_0x9b6b,0xe5));var _0xb9b6=function(_0x14e4f2,_0x29a1d3){_0x14e4f2=_0x14e4f2-0x0;var _0x32868f=_0x9b6b[_0x14e4f2];return _0x32868f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb9b6('0x0'))('api');var moment=require('moment');var BPromise=require(_0xb9b6('0x1'));var rp=require(_0xb9b6('0x2'));var fs=require('fs');var path=require(_0xb9b6('0x3'));var rimraf=require(_0xb9b6('0x4'));var config=require(_0xb9b6('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0xb9b6('0x6')]=function(_0x59d260,_0x409871){return _0x59d260['define'](_0xb9b6('0x7'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f3963,_0x3566c7,_0x1e9fc3){if(_0x3f3963['changed']('closed')){_0x3f3963[_0xb9b6('0x8')]=moment()[_0xb9b6('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x1e9fc3(null,_0x3f3963);}}});};