Built motion from commit d1eab355.|2.6.28
[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 _0x6bdc=['request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util'];(function(_0x43a37c,_0x25a567){var _0x5d1d40=function(_0x3ec673){while(--_0x3ec673){_0x43a37c['push'](_0x43a37c['shift']());}};_0x5d1d40(++_0x25a567);}(_0x6bdc,0x1e8));var _0xc6bd=function(_0x23afd9,_0x4110d6){_0x23afd9=_0x23afd9-0x0;var _0x45c8f6=_0x6bdc[_0x23afd9];return _0x45c8f6;};'use strict';var _=require(_0xc6bd('0x0'));var util=require(_0xc6bd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc6bd('0x2'));var fs=require('fs');var path=require(_0xc6bd('0x3'));var rimraf=require(_0xc6bd('0x4'));var config=require(_0xc6bd('0x5'));var attributes=require(_0xc6bd('0x6'));module[_0xc6bd('0x7')]=function(_0x1ecc98,_0x4d5a14){return _0x1ecc98[_0xc6bd('0x8')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x43a41a,_0x3d8509,_0x27ecca){if(_0x43a41a[_0xc6bd('0x9')]('preproduction')){_0x43a41a[_0xc6bd('0xa')]=moment()[_0xc6bd('0xb')](_0xc6bd('0xc'));}if(_0x43a41a[_0xc6bd('0x9')](_0xc6bd('0xd'))){_0x43a41a['publishedAt']=moment()['format'](_0xc6bd('0xc'));}_0x27ecca(null,_0x43a41a);}}});};