7ff58458935d836369bb6beb835255ecfed1abd3
[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 _0xfa60=['path','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed','closed','format','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x371b36,_0x8606f7){var _0x449638=function(_0x4ed4eb){while(--_0x4ed4eb){_0x371b36['push'](_0x371b36['shift']());}};_0x449638(++_0x8606f7);}(_0xfa60,0x8a));var _0x0fa6=function(_0x54772e,_0x4d7260){_0x54772e=_0x54772e-0x0;var _0x4f08ec=_0xfa60[_0x54772e];return _0x4f08ec;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0fa6('0x0'))(_0x0fa6('0x1'));var moment=require(_0x0fa6('0x2'));var BPromise=require(_0x0fa6('0x3'));var rp=require(_0x0fa6('0x4'));var fs=require('fs');var path=require(_0x0fa6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0fa6('0x6'));module[_0x0fa6('0x7')]=function(_0x255eae,_0x518e69){return _0x255eae['define'](_0x0fa6('0x8'),attributes,{'tableName':_0x0fa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x55d564,_0x30ca74,_0x3211f7){if(_0x55d564[_0x0fa6('0xa')](_0x0fa6('0xb'))){_0x55d564['closedAt']=moment()[_0x0fa6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3211f7(null,_0x55d564);}}});};