Built motion from commit (unavailable).|2.4.18
[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 _0x6df1=['../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','changed','closed','closedAt','format','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x3fd165,_0x5e2e2f){var _0x50f970=function(_0x3bc1f7){while(--_0x3bc1f7){_0x3fd165['push'](_0x3fd165['shift']());}};_0x50f970(++_0x5e2e2f);}(_0x6df1,0x90));var _0x16df=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x6df1[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x16df('0x0'));var logger=require('../../config/logger')(_0x16df('0x1'));var moment=require(_0x16df('0x2'));var BPromise=require(_0x16df('0x3'));var rp=require(_0x16df('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x16df('0x5'));var config=require(_0x16df('0x6'));var attributes=require(_0x16df('0x7'));module[_0x16df('0x8')]=function(_0x295b28,_0x72f658){return _0x295b28[_0x16df('0x9')](_0x16df('0xa'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1df6b8,_0x48c41b,_0x4ba349){if(_0x1df6b8[_0x16df('0xb')](_0x16df('0xc'))){_0x1df6b8[_0x16df('0xd')]=moment()[_0x16df('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4ba349(null,_0x1df6b8);}}});};