Built motion from commit 994c64e1.|2.6.1
[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 _0x8f55=['define','WhatsappInteraction','whatsapp_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','moment','bluebird','path','../../config/environment','./whatsappInteraction.attributes'];(function(_0x4d8d34,_0x329802){var _0x2a97a8=function(_0x43d35d){while(--_0x43d35d){_0x4d8d34['push'](_0x4d8d34['shift']());}};_0x2a97a8(++_0x329802);}(_0x8f55,0x1e8));var _0x58f5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8f55[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x58f5('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x58f5('0x1'));var BPromise=require(_0x58f5('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58f5('0x3'));var rimraf=require('rimraf');var config=require(_0x58f5('0x4'));var attributes=require(_0x58f5('0x5'));module['exports']=function(_0xb8a2a1,_0x208d01){return _0xb8a2a1[_0x58f5('0x6')](_0x58f5('0x7'),attributes,{'tableName':_0x58f5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58f2a9,_0x2054a3,_0xcf920c){if(_0x58f2a9['changed'](_0x58f5('0x9'))){_0x58f2a9[_0x58f5('0xa')]=moment()[_0x58f5('0xb')](_0x58f5('0xc'));}_0xcf920c(null,_0x58f2a9);}}});};