7f85389b72e574fa5bd180c5c9ee0aa3f9e9832e
[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 _0x938f=['closed','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x3ebaf9,_0x5de656){var _0x4dab61=function(_0x5cf1f2){while(--_0x5cf1f2){_0x3ebaf9['push'](_0x3ebaf9['shift']());}};_0x4dab61(++_0x5de656);}(_0x938f,0xc1));var _0xf938=function(_0x259d17,_0x220710){_0x259d17=_0x259d17-0x0;var _0x407535=_0x938f[_0x259d17];return _0x407535;};'use strict';var _=require(_0xf938('0x0'));var util=require(_0xf938('0x1'));var logger=require(_0xf938('0x2'))(_0xf938('0x3'));var moment=require(_0xf938('0x4'));var BPromise=require(_0xf938('0x5'));var rp=require(_0xf938('0x6'));var fs=require('fs');var path=require(_0xf938('0x7'));var rimraf=require(_0xf938('0x8'));var config=require('../../config/environment');var attributes=require(_0xf938('0x9'));module[_0xf938('0xa')]=function(_0x753bca,_0x2774e0){return _0x753bca[_0xf938('0xb')](_0xf938('0xc'),attributes,{'tableName':_0xf938('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34d908,_0x5efda2,_0x1743c6){if(_0x34d908[_0xf938('0xe')](_0xf938('0xf'))){_0x34d908['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x1743c6(null,_0x34d908);}}});};