Built motion from commit (unavailable).|2.5.28
[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 _0x394b=['moment','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','format','lodash','util','api'];(function(_0x360ad7,_0x2a1157){var _0x545a9e=function(_0x42c819){while(--_0x42c819){_0x360ad7['push'](_0x360ad7['shift']());}};_0x545a9e(++_0x2a1157);}(_0x394b,0x1aa));var _0xb394=function(_0x1263d9,_0x1ff0b2){_0x1263d9=_0x1263d9-0x0;var _0x711253=_0x394b[_0x1263d9];return _0x711253;};'use strict';var _=require(_0xb394('0x0'));var util=require(_0xb394('0x1'));var logger=require('../../config/logger')(_0xb394('0x2'));var moment=require(_0xb394('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb394('0x4'));var attributes=require(_0xb394('0x5'));module['exports']=function(_0x333b80,_0x39c6b0){return _0x333b80['define'](_0xb394('0x6'),attributes,{'tableName':_0xb394('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x300dfb,_0x1fdc6f,_0x5291ac){if(_0x300dfb[_0xb394('0x8')](_0xb394('0x9'))){_0x300dfb['closedAt']=moment()[_0xb394('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5291ac(null,_0x300dfb);}}});};