30ad28a0630492ec941c11160cc97e63d8e4761c
[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 _0x53be=['WhatsappInteraction','whatsapp_interactions','closed','format','lodash','../../config/logger','moment','bluebird','rimraf','./whatsappInteraction.attributes','exports','define'];(function(_0x295b82,_0xe5f7bb){var _0x3160a3=function(_0xb41e2f){while(--_0xb41e2f){_0x295b82['push'](_0x295b82['shift']());}};_0x3160a3(++_0xe5f7bb);}(_0x53be,0xe8));var _0xe53b=function(_0x509a95,_0x42354b){_0x509a95=_0x509a95-0x0;var _0x20c19e=_0x53be[_0x509a95];return _0x20c19e;};'use strict';var _=require(_0xe53b('0x0'));var util=require('util');var logger=require(_0xe53b('0x1'))('api');var moment=require(_0xe53b('0x2'));var BPromise=require(_0xe53b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe53b('0x4'));var config=require('../../config/environment');var attributes=require(_0xe53b('0x5'));module[_0xe53b('0x6')]=function(_0x585d8d,_0x15661c){return _0x585d8d[_0xe53b('0x7')](_0xe53b('0x8'),attributes,{'tableName':_0xe53b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2bf983,_0x358194,_0x11d27d){if(_0x2bf983['changed'](_0xe53b('0xa'))){_0x2bf983['closedAt']=moment()[_0xe53b('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x11d27d(null,_0x2bf983);}}});};