Built motion from commit (unavailable).|2.5.31
[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 _0xfb28=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger'];(function(_0x1e6b86,_0x2be164){var _0x1abe9d=function(_0x5569f0){while(--_0x5569f0){_0x1e6b86['push'](_0x1e6b86['shift']());}};_0x1abe9d(++_0x2be164);}(_0xfb28,0x195));var _0x8fb2=function(_0x2246bf,_0x19dfa9){_0x2246bf=_0x2246bf-0x0;var _0x3e1ded=_0xfb28[_0x2246bf];return _0x3e1ded;};'use strict';var _=require(_0x8fb2('0x0'));var util=require(_0x8fb2('0x1'));var logger=require(_0x8fb2('0x2'))(_0x8fb2('0x3'));var moment=require(_0x8fb2('0x4'));var BPromise=require(_0x8fb2('0x5'));var rp=require(_0x8fb2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8fb2('0x7'));var config=require(_0x8fb2('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x8fb2('0x9')]=function(_0x54298b,_0x571f57){return _0x54298b[_0x8fb2('0xa')](_0x8fb2('0xb'),attributes,{'tableName':_0x8fb2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57b51c,_0x40ce08,_0x33ffd0){if(_0x57b51c['changed'](_0x8fb2('0xd'))){_0x57b51c[_0x8fb2('0xe')]=moment()[_0x8fb2('0xf')](_0x8fb2('0x10'));}_0x33ffd0(null,_0x57b51c);}}});};