831badff44b82013eab8ffa0e7ea320be1cb0533
[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 _0xb08a=['bluebird','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger','api'];(function(_0x375493,_0x3f3b8f){var _0x49512f=function(_0x1595a4){while(--_0x1595a4){_0x375493['push'](_0x375493['shift']());}};_0x49512f(++_0x3f3b8f);}(_0xb08a,0x89));var _0xab08=function(_0x1505e5,_0x5cc291){_0x1505e5=_0x1505e5-0x0;var _0x5b1dcd=_0xb08a[_0x1505e5];return _0x5b1dcd;};'use strict';var _=require('lodash');var util=require(_0xab08('0x0'));var logger=require(_0xab08('0x1'))(_0xab08('0x2'));var moment=require('moment');var BPromise=require(_0xab08('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xab08('0x4'));var attributes=require(_0xab08('0x5'));module[_0xab08('0x6')]=function(_0x4cd2c9,_0x182e17){return _0x4cd2c9['define'](_0xab08('0x7'),attributes,{'tableName':_0xab08('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x777a83,_0x32f5fe,_0x41475f){if(_0x777a83[_0xab08('0x9')](_0xab08('0xa'))){_0x777a83[_0xab08('0xb')]=moment()[_0xab08('0xc')](_0xab08('0xd'));}_0x41475f(null,_0x777a83);}}});};