Built motion from commit 85328c08.|2.5.50
[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 _0x1fed=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x51f48a,_0x54b9f3){var _0x5055ab=function(_0x31478f){while(--_0x31478f){_0x51f48a['push'](_0x51f48a['shift']());}};_0x5055ab(++_0x54b9f3);}(_0x1fed,0x1d3));var _0xd1fe=function(_0x23165a,_0x19d021){_0x23165a=_0x23165a-0x0;var _0x40c6c4=_0x1fed[_0x23165a];return _0x40c6c4;};'use strict';var _=require(_0xd1fe('0x0'));var util=require('util');var logger=require(_0xd1fe('0x1'))(_0xd1fe('0x2'));var moment=require(_0xd1fe('0x3'));var BPromise=require(_0xd1fe('0x4'));var rp=require(_0xd1fe('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd1fe('0x6'));var attributes=require('./whatsappInteraction.attributes');module[_0xd1fe('0x7')]=function(_0x352f93,_0x4f194d){return _0x352f93['define']('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x187285,_0xa14551,_0x3c6115){if(_0x187285[_0xd1fe('0x8')](_0xd1fe('0x9'))){_0x187285['closedAt']=moment()[_0xd1fe('0xa')](_0xd1fe('0xb'));}_0x3c6115(null,_0x187285);}}});};