Built motion from commit 753c950e.|2.5.42
[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 _0x61b4=['../../config/environment','exports','SmsInteraction','sms_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','bluebird','rimraf'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x61b4,0x104));var _0x461b=function(_0x5a58ee,_0x199e4f){_0x5a58ee=_0x5a58ee-0x0;var _0x3ff64a=_0x61b4[_0x5a58ee];return _0x3ff64a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x461b('0x0'))(_0x461b('0x1'));var moment=require('moment');var BPromise=require(_0x461b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x461b('0x3'));var config=require(_0x461b('0x4'));var attributes=require('./smsInteraction.attributes');module[_0x461b('0x5')]=function(_0x1a7857,_0x4107f3){return _0x1a7857['define'](_0x461b('0x6'),attributes,{'tableName':_0x461b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5e3281,_0x5dcaee,_0x22d099){if(_0x5e3281[_0x461b('0x8')](_0x461b('0x9'))){_0x5e3281['closedAt']=moment()[_0x461b('0xa')](_0x461b('0xb'));}_0x22d099(null,_0x5e3281);}}});};