34f0aa5c198e431e92d2f638f4e26e261c7c3a23
[motion2.git] / server / api / faxInteraction / faxInteraction.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 _0x0799=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format'];(function(_0x348682,_0x289cbc){var _0x1abf3a=function(_0x7d05c0){while(--_0x7d05c0){_0x348682['push'](_0x348682['shift']());}};_0x1abf3a(++_0x289cbc);}(_0x0799,0x151));var _0x9079=function(_0x1a37e3,_0x5db8f6){_0x1a37e3=_0x1a37e3-0x0;var _0x4db78a=_0x0799[_0x1a37e3];return _0x4db78a;};'use strict';var _=require(_0x9079('0x0'));var util=require(_0x9079('0x1'));var logger=require(_0x9079('0x2'))('api');var moment=require('moment');var BPromise=require(_0x9079('0x3'));var rp=require(_0x9079('0x4'));var fs=require('fs');var path=require(_0x9079('0x5'));var rimraf=require(_0x9079('0x6'));var config=require('../../config/environment');var attributes=require(_0x9079('0x7'));module[_0x9079('0x8')]=function(_0x8c4151,_0xd748b1){return _0x8c4151[_0x9079('0x9')](_0x9079('0xa'),attributes,{'tableName':_0x9079('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe40965,_0x3c7ff9,_0x4abd33){if(_0xe40965[_0x9079('0xc')](_0x9079('0xd'))){_0xe40965['closedAt']=moment()[_0x9079('0xe')](_0x9079('0xf'));}_0x4abd33(null,_0xe40965);}}});};