Built motion from commit (unavailable).|2.5.12
[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 _0x27c9=['rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x5f3238,_0x3f5c5f){var _0x5bd5dd=function(_0x93ad30){while(--_0x93ad30){_0x5f3238['push'](_0x5f3238['shift']());}};_0x5bd5dd(++_0x3f5c5f);}(_0x27c9,0x1af));var _0x927c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x27c9[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x927c('0x0'));var util=require(_0x927c('0x1'));var logger=require(_0x927c('0x2'))(_0x927c('0x3'));var moment=require('moment');var BPromise=require(_0x927c('0x4'));var rp=require(_0x927c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x927c('0x6'));var config=require(_0x927c('0x7'));var attributes=require(_0x927c('0x8'));module[_0x927c('0x9')]=function(_0x338730,_0x5b09de){return _0x338730[_0x927c('0xa')](_0x927c('0xb'),attributes,{'tableName':_0x927c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5250ee,_0x40050f,_0x3d26e4){if(_0x5250ee[_0x927c('0xd')]('preproduction')){_0x5250ee[_0x927c('0xe')]=moment()[_0x927c('0xf')](_0x927c('0x10'));}if(_0x5250ee[_0x927c('0xd')](_0x927c('0x11'))){_0x5250ee[_0x927c('0x12')]=moment()[_0x927c('0xf')](_0x927c('0x10'));}_0x3d26e4(null,_0x5250ee);}}});};