Built motion from commit efa66e19.|2.6.22
[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 _0x18ca=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','SquareProject','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util'];(function(_0x3d2244,_0x2680d9){var _0x554105=function(_0x33d728){while(--_0x33d728){_0x3d2244['push'](_0x3d2244['shift']());}};_0x554105(++_0x2680d9);}(_0x18ca,0x1e9));var _0xa18c=function(_0x56954b,_0x2064cd){_0x56954b=_0x56954b-0x0;var _0x496bda=_0x18ca[_0x56954b];return _0x496bda;};'use strict';var _=require('lodash');var util=require(_0xa18c('0x0'));var logger=require(_0xa18c('0x1'))('api');var moment=require(_0xa18c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa18c('0x3'));var rimraf=require(_0xa18c('0x4'));var config=require(_0xa18c('0x5'));var attributes=require('./squareProject.attributes');module[_0xa18c('0x6')]=function(_0x195e85,_0x140a0f){return _0x195e85[_0xa18c('0x7')](_0xa18c('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x40f0dc,_0x12e8d7,_0xcbc636){if(_0x40f0dc[_0xa18c('0x9')]('preproduction')){_0x40f0dc[_0xa18c('0xa')]=moment()[_0xa18c('0xb')](_0xa18c('0xc'));}if(_0x40f0dc[_0xa18c('0x9')]('production')){_0x40f0dc[_0xa18c('0xd')]=moment()[_0xa18c('0xb')](_0xa18c('0xc'));}_0xcbc636(null,_0x40f0dc);}}});};