9a019d970e3d64d1bcb2a4011dec019d6ad2c8a9
[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 _0x0f04=['api','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0xc1a5a0,_0x4e0a4c){var _0x49dd42=function(_0x26f9c9){while(--_0x26f9c9){_0xc1a5a0['push'](_0xc1a5a0['shift']());}};_0x49dd42(++_0x4e0a4c);}(_0x0f04,0x1de));var _0x40f0=function(_0x4f91ee,_0x18dc9e){_0x4f91ee=_0x4f91ee-0x0;var _0x5dfbe7=_0x0f04[_0x4f91ee];return _0x5dfbe7;};'use strict';var _=require('lodash');var util=require(_0x40f0('0x0'));var logger=require(_0x40f0('0x1'))(_0x40f0('0x2'));var moment=require(_0x40f0('0x3'));var BPromise=require(_0x40f0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x40f0('0x5'));var rimraf=require('rimraf');var config=require(_0x40f0('0x6'));var attributes=require(_0x40f0('0x7'));module[_0x40f0('0x8')]=function(_0x4c695c,_0x5fb4fa){return _0x4c695c[_0x40f0('0x9')](_0x40f0('0xa'),attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x54e2bb,_0x1061ea,_0x1d1579){if(_0x54e2bb['changed'](_0x40f0('0xb'))){_0x54e2bb[_0x40f0('0xc')]=moment()[_0x40f0('0xd')](_0x40f0('0xe'));}_0x1d1579(null,_0x54e2bb);}}});};