Built motion from commit bab6f49e.|2.6.17
[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 _0x1691=['define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5d64ac,_0x46e6fa){var _0x2f5c48=function(_0x5b3a85){while(--_0x5b3a85){_0x5d64ac['push'](_0x5d64ac['shift']());}};_0x2f5c48(++_0x46e6fa);}(_0x1691,0x1c8));var _0x1169=function(_0x41af7c,_0x51a65b){_0x41af7c=_0x41af7c-0x0;var _0x567636=_0x1691[_0x41af7c];return _0x567636;};'use strict';var _=require('lodash');var util=require(_0x1169('0x0'));var logger=require(_0x1169('0x1'))(_0x1169('0x2'));var moment=require('moment');var BPromise=require(_0x1169('0x3'));var rp=require(_0x1169('0x4'));var fs=require('fs');var path=require(_0x1169('0x5'));var rimraf=require(_0x1169('0x6'));var config=require(_0x1169('0x7'));var attributes=require('./smsInteraction.attributes');module['exports']=function(_0x401c7e,_0x17afde){return _0x401c7e[_0x1169('0x8')](_0x1169('0x9'),attributes,{'tableName':_0x1169('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x18b3c2,_0x234741,_0xc28121){if(_0x18b3c2[_0x1169('0xb')](_0x1169('0xc'))){_0x18b3c2[_0x1169('0xd')]=moment()[_0x1169('0xe')](_0x1169('0xf'));}_0xc28121(null,_0x18b3c2);}}});};