Built motion from commit e1760111.|2.6.18
[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 _0x9c4a=['api','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x9c4a,0x1b9));var _0xa9c4=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x9c4a[_0x391c55];return _0xa434e0;};'use strict';var _=require(_0xa9c4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa9c4('0x1'));var moment=require('moment');var BPromise=require(_0xa9c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa9c4('0x3'));var rimraf=require(_0xa9c4('0x4'));var config=require(_0xa9c4('0x5'));var attributes=require(_0xa9c4('0x6'));module['exports']=function(_0xc7b768,_0x2725fd){return _0xc7b768[_0xa9c4('0x7')](_0xa9c4('0x8'),attributes,{'tableName':_0xa9c4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x247c97,_0x2416e0,_0x3df9b1){if(_0x247c97[_0xa9c4('0xa')](_0xa9c4('0xb'))){_0x247c97['closedAt']=moment()[_0xa9c4('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3df9b1(null,_0x247c97);}}});};