f48201177023b70659a40ae299e15fc4f5c683fb
[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 _0x7028=['SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','moment','request-promise','./squareProject.attributes','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7028,0xad));var _0x8702=function(_0x11946c,_0x12152c){_0x11946c=_0x11946c-0x0;var _0x383935=_0x7028[_0x11946c];return _0x383935;};'use strict';var _=require(_0x8702('0x0'));var util=require(_0x8702('0x1'));var logger=require(_0x8702('0x2'))('api');var moment=require(_0x8702('0x3'));var BPromise=require('bluebird');var rp=require(_0x8702('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8702('0x5'));module[_0x8702('0x6')]=function(_0x381929,_0x3ebb0c){return _0x381929['define'](_0x8702('0x7'),attributes,{'tableName':_0x8702('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x343fac,_0x127cc9,_0x3101b2){if(_0x343fac[_0x8702('0x9')]('preproduction')){_0x343fac[_0x8702('0xa')]=moment()[_0x8702('0xb')](_0x8702('0xc'));}if(_0x343fac[_0x8702('0x9')](_0x8702('0xd'))){_0x343fac[_0x8702('0xe')]=moment()[_0x8702('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3101b2(null,_0x343fac);}}});};