12c5c3f8ecf97225703d270e7c7020065a47ffcb
[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 _0x20f6=['format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','closed','closedAt'];(function(_0x484a7c,_0x460993){var _0x343b68=function(_0x4dd486){while(--_0x4dd486){_0x484a7c['push'](_0x484a7c['shift']());}};_0x343b68(++_0x460993);}(_0x20f6,0x9b));var _0x620f=function(_0x360164,_0x44bdbf){_0x360164=_0x360164-0x0;var _0x5f327f=_0x20f6[_0x360164];return _0x5f327f;};'use strict';var _=require(_0x620f('0x0'));var util=require(_0x620f('0x1'));var logger=require(_0x620f('0x2'))(_0x620f('0x3'));var moment=require('moment');var BPromise=require(_0x620f('0x4'));var rp=require(_0x620f('0x5'));var fs=require('fs');var path=require(_0x620f('0x6'));var rimraf=require(_0x620f('0x7'));var config=require(_0x620f('0x8'));var attributes=require(_0x620f('0x9'));module[_0x620f('0xa')]=function(_0x589e13,_0x56c091){return _0x589e13[_0x620f('0xb')](_0x620f('0xc'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x548a8a,_0x38d044,_0x17c128){if(_0x548a8a['changed'](_0x620f('0xd'))){_0x548a8a[_0x620f('0xe')]=moment()[_0x620f('0xf')](_0x620f('0x10'));}_0x17c128(null,_0x548a8a);}}});};