Built motion from commit (unavailable).|2.5.13
[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 _0x9b6e=['rimraf','../../config/environment','exports','SmsInteraction','sms_interactions','changed','closedAt','format','../../config/logger','api','moment','request-promise','path'];(function(_0x4d8fe3,_0xe3d4d0){var _0x24d7a9=function(_0x5a4d1e){while(--_0x5a4d1e){_0x4d8fe3['push'](_0x4d8fe3['shift']());}};_0x24d7a9(++_0xe3d4d0);}(_0x9b6e,0x181));var _0xe9b6=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x9b6e[_0x11005e];return _0x29338f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9b6('0x0'))(_0xe9b6('0x1'));var moment=require(_0xe9b6('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9b6('0x3'));var fs=require('fs');var path=require(_0xe9b6('0x4'));var rimraf=require(_0xe9b6('0x5'));var config=require(_0xe9b6('0x6'));var attributes=require('./smsInteraction.attributes');module[_0xe9b6('0x7')]=function(_0x58765d,_0x3d65a2){return _0x58765d['define'](_0xe9b6('0x8'),attributes,{'tableName':_0xe9b6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x526ba7,_0x44eaeb,_0x207f0c){if(_0x526ba7[_0xe9b6('0xa')]('closed')){_0x526ba7[_0xe9b6('0xb')]=moment()[_0xe9b6('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x207f0c(null,_0x526ba7);}}});};