Built motion from commit e1760111.|2.6.18
[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 _0xcdf3=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','sms_interactions','changed','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xcdf3,0x1c3));var _0x3cdf=function(_0x56c166,_0x3b578c){_0x56c166=_0x56c166-0x0;var _0x2c7f44=_0xcdf3[_0x56c166];return _0x2c7f44;};'use strict';var _=require('lodash');var util=require(_0x3cdf('0x0'));var logger=require(_0x3cdf('0x1'))('api');var moment=require(_0x3cdf('0x2'));var BPromise=require(_0x3cdf('0x3'));var rp=require(_0x3cdf('0x4'));var fs=require('fs');var path=require(_0x3cdf('0x5'));var rimraf=require('rimraf');var config=require(_0x3cdf('0x6'));var attributes=require(_0x3cdf('0x7'));module['exports']=function(_0x5b4412,_0x5b92d6){return _0x5b4412['define']('SmsInteraction',attributes,{'tableName':_0x3cdf('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3f5233,_0x404e5e,_0x423bc1){if(_0x3f5233[_0x3cdf('0x9')]('closed')){_0x3f5233['closedAt']=moment()['format'](_0x3cdf('0xa'));}_0x423bc1(null,_0x3f5233);}}});};