Built motion from commit (unavailable).|2.5.26
[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 _0x01ba=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','closed','format','lodash'];(function(_0x540b73,_0x53809c){var _0x1490bb=function(_0x5b9636){while(--_0x5b9636){_0x540b73['push'](_0x540b73['shift']());}};_0x1490bb(++_0x53809c);}(_0x01ba,0x1df));var _0xa01b=function(_0x1374f2,_0x4d530c){_0x1374f2=_0x1374f2-0x0;var _0x239f48=_0x01ba[_0x1374f2];return _0x239f48;};'use strict';var _=require(_0xa01b('0x0'));var util=require(_0xa01b('0x1'));var logger=require(_0xa01b('0x2'))(_0xa01b('0x3'));var moment=require(_0xa01b('0x4'));var BPromise=require(_0xa01b('0x5'));var rp=require(_0xa01b('0x6'));var fs=require('fs');var path=require(_0xa01b('0x7'));var rimraf=require(_0xa01b('0x8'));var config=require(_0xa01b('0x9'));var attributes=require(_0xa01b('0xa'));module[_0xa01b('0xb')]=function(_0x3133d4,_0x53eb44){return _0x3133d4['define'](_0xa01b('0xc'),attributes,{'tableName':_0xa01b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2950ae,_0x2c8641,_0x5004d3){if(_0x2950ae['changed'](_0xa01b('0xe'))){_0x2950ae['closedAt']=moment()[_0xa01b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5004d3(null,_0x2950ae);}}});};