Built motion from commit (unavailable).|2.5.24
[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 _0xd24f=['define','SmsInteraction','sms_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','path','./smsInteraction.attributes','exports'];(function(_0x36bb21,_0x4c6b88){var _0x48b61d=function(_0x5c58d8){while(--_0x5c58d8){_0x36bb21['push'](_0x36bb21['shift']());}};_0x48b61d(++_0x4c6b88);}(_0xd24f,0x16e));var _0xfd24=function(_0x3c4322,_0x145a37){_0x3c4322=_0x3c4322-0x0;var _0x225310=_0xd24f[_0x3c4322];return _0x225310;};'use strict';var _=require(_0xfd24('0x0'));var util=require(_0xfd24('0x1'));var logger=require(_0xfd24('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd24('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfd24('0x4'));module[_0xfd24('0x5')]=function(_0x17d388,_0x1447d9){return _0x17d388[_0xfd24('0x6')](_0xfd24('0x7'),attributes,{'tableName':_0xfd24('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53123f,_0x62e0c,_0x28006b){if(_0x53123f[_0xfd24('0x9')](_0xfd24('0xa'))){_0x53123f['closedAt']=moment()['format'](_0xfd24('0xb'));}_0x28006b(null,_0x53123f);}}});};