dc23dd37e79b3a9d25d3a4c1ecf2fda88737732a
[motion2.git] / server / api / squareProject / squareProject.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 _0xf2cd=['../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util'];(function(_0x4e65d6,_0x44a8cf){var _0x1c7317=function(_0x16bb2d){while(--_0x16bb2d){_0x4e65d6['push'](_0x4e65d6['shift']());}};_0x1c7317(++_0x44a8cf);}(_0xf2cd,0xd7));var _0xdf2c=function(_0x4843f9,_0x4af459){_0x4843f9=_0x4843f9-0x0;var _0x193c6a=_0xf2cd[_0x4843f9];return _0x193c6a;};'use strict';var _=require('lodash');var util=require(_0xdf2c('0x0'));var logger=require(_0xdf2c('0x1'))('api');var moment=require(_0xdf2c('0x2'));var BPromise=require('bluebird');var rp=require(_0xdf2c('0x3'));var fs=require('fs');var path=require(_0xdf2c('0x4'));var rimraf=require(_0xdf2c('0x5'));var config=require(_0xdf2c('0x6'));var attributes=require(_0xdf2c('0x7'));module[_0xdf2c('0x8')]=function(_0x3705b9,_0x576268){return _0x3705b9[_0xdf2c('0x9')](_0xdf2c('0xa'),attributes,{'tableName':_0xdf2c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6c9782,_0x200de8,_0x522965){if(_0x6c9782[_0xdf2c('0xc')]('preproduction')){_0x6c9782[_0xdf2c('0xd')]=moment()[_0xdf2c('0xe')](_0xdf2c('0xf'));}if(_0x6c9782['changed'](_0xdf2c('0x10'))){_0x6c9782[_0xdf2c('0x11')]=moment()[_0xdf2c('0xe')](_0xdf2c('0xf'));}_0x522965(null,_0x6c9782);}}});};