535761f682db5a2a0f34f3e55bbb984ad716938a
[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 _0x3bae=['api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','changed','closedAt','format','util','../../config/logger'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0x3bae,0x1c0));var _0xe3ba=function(_0x20b750,_0x3f6d3f){_0x20b750=_0x20b750-0x0;var _0x57d42c=_0x3bae[_0x20b750];return _0x57d42c;};'use strict';var _=require('lodash');var util=require(_0xe3ba('0x0'));var logger=require(_0xe3ba('0x1'))(_0xe3ba('0x2'));var moment=require('moment');var BPromise=require(_0xe3ba('0x3'));var rp=require(_0xe3ba('0x4'));var fs=require('fs');var path=require(_0xe3ba('0x5'));var rimraf=require(_0xe3ba('0x6'));var config=require(_0xe3ba('0x7'));var attributes=require('./smsInteraction.attributes');module[_0xe3ba('0x8')]=function(_0x567986,_0x119f99){return _0x567986[_0xe3ba('0x9')](_0xe3ba('0xa'),attributes,{'tableName':_0xe3ba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf512a2,_0x29b374,_0x2007ca){if(_0xf512a2[_0xe3ba('0xc')]('closed')){_0xf512a2[_0xe3ba('0xd')]=moment()[_0xe3ba('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2007ca(null,_0xf512a2);}}});};