Built motion from commit b0a9a629.|2.6.33
[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 _0xbc5f=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xbc5f,0x140));var _0xfbc5=function(_0x2dee0c,_0x306288){_0x2dee0c=_0x2dee0c-0x0;var _0x5cbdeb=_0xbc5f[_0x2dee0c];return _0x5cbdeb;};'use strict';var _=require(_0xfbc5('0x0'));var util=require(_0xfbc5('0x1'));var logger=require(_0xfbc5('0x2'))(_0xfbc5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfbc5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfbc5('0x5'));var config=require(_0xfbc5('0x6'));var attributes=require(_0xfbc5('0x7'));module[_0xfbc5('0x8')]=function(_0x11d6ba,_0x2d89cf){return _0x11d6ba[_0xfbc5('0x9')](_0xfbc5('0xa'),attributes,{'tableName':_0xfbc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f891b,_0x5914db,_0x3668df){if(_0x3f891b[_0xfbc5('0xc')](_0xfbc5('0xd'))){_0x3f891b['closedAt']=moment()[_0xfbc5('0xe')](_0xfbc5('0xf'));}_0x3668df(null,_0x3f891b);}}});};