Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / smsInteraction / smsInteraction.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 _0xa601=['changed','closed','closedAt','format','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x3866d4,_0x1c678e){var _0x4855aa=function(_0x7ed9b3){while(--_0x7ed9b3){_0x3866d4['push'](_0x3866d4['shift']());}};_0x4855aa(++_0x1c678e);}(_0xa601,0x13c));var _0x1a60=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xa601[_0x4a9fb1];return _0x348672;};'use strict';var _=require('lodash');var util=require(_0x1a60('0x0'));var logger=require(_0x1a60('0x1'))(_0x1a60('0x2'));var moment=require(_0x1a60('0x3'));var BPromise=require(_0x1a60('0x4'));var rp=require(_0x1a60('0x5'));var fs=require('fs');var path=require(_0x1a60('0x6'));var rimraf=require(_0x1a60('0x7'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x1a60('0x8')]=function(_0x5bdf58,_0x213e91){return _0x5bdf58['define']('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42b93d,_0x3a412e,_0x324edd){if(_0x42b93d[_0x1a60('0x9')](_0x1a60('0xa'))){_0x42b93d[_0x1a60('0xb')]=moment()[_0x1a60('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x324edd(null,_0x42b93d);}}});};