Built motion from commit 47436d59.|2.6.7
[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 _0xd06e=['changed','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x28bfba,_0x1de29a){var _0x3647da=function(_0x2a02de){while(--_0x2a02de){_0x28bfba['push'](_0x28bfba['shift']());}};_0x3647da(++_0x1de29a);}(_0xd06e,0x16b));var _0xed06=function(_0xf6756b,_0x476acd){_0xf6756b=_0xf6756b-0x0;var _0x20c398=_0xd06e[_0xf6756b];return _0x20c398;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xed06('0x0'))(_0xed06('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xed06('0x2'));var fs=require('fs');var path=require(_0xed06('0x3'));var rimraf=require(_0xed06('0x4'));var config=require(_0xed06('0x5'));var attributes=require(_0xed06('0x6'));module[_0xed06('0x7')]=function(_0x39c2ec,_0x58ea69){return _0x39c2ec[_0xed06('0x8')](_0xed06('0x9'),attributes,{'tableName':_0xed06('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48d478,_0x44cf44,_0x50ef9e){if(_0x48d478[_0xed06('0xb')]('preproduction')){_0x48d478[_0xed06('0xc')]=moment()[_0xed06('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x48d478[_0xed06('0xb')](_0xed06('0xe'))){_0x48d478[_0xed06('0xf')]=moment()[_0xed06('0xd')](_0xed06('0x10'));}_0x50ef9e(null,_0x48d478);}}});};