Built motion from commit f7863d46.|2.5.41
[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 _0x0b39=['moment','request-promise','path','rimraf','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0b39,0x1bc));var _0x90b3=function(_0x5397e2,_0x505991){_0x5397e2=_0x5397e2-0x0;var _0x939177=_0x0b39[_0x5397e2];return _0x939177;};'use strict';var _=require(_0x90b3('0x0'));var util=require(_0x90b3('0x1'));var logger=require(_0x90b3('0x2'))(_0x90b3('0x3'));var moment=require(_0x90b3('0x4'));var BPromise=require('bluebird');var rp=require(_0x90b3('0x5'));var fs=require('fs');var path=require(_0x90b3('0x6'));var rimraf=require(_0x90b3('0x7'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x90b3('0x8')]=function(_0x59a4ef,_0xe7d7cc){return _0x59a4ef['define'](_0x90b3('0x9'),attributes,{'tableName':_0x90b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1f125d,_0x169a4b,_0x4c217e){if(_0x1f125d[_0x90b3('0xb')](_0x90b3('0xc'))){_0x1f125d[_0x90b3('0xd')]=moment()[_0x90b3('0xe')](_0x90b3('0xf'));}_0x4c217e(null,_0x1f125d);}}});};