b6fcd339cf5083c2c43f7126a0d6502cfe7d5ff1
[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 _0xf7d0=['lodash','moment','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt'];(function(_0x2673c1,_0x489c00){var _0x46bde=function(_0x3c7b08){while(--_0x3c7b08){_0x2673c1['push'](_0x2673c1['shift']());}};_0x46bde(++_0x489c00);}(_0xf7d0,0x177));var _0x0f7d=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xf7d0[_0xf6e75d];return _0x27514d;};'use strict';var _=require(_0x0f7d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x0f7d('0x1'));var BPromise=require('bluebird');var rp=require(_0x0f7d('0x2'));var fs=require('fs');var path=require(_0x0f7d('0x3'));var rimraf=require('rimraf');var config=require(_0x0f7d('0x4'));var attributes=require(_0x0f7d('0x5'));module['exports']=function(_0x13b009,_0x1fa158){return _0x13b009[_0x0f7d('0x6')](_0x0f7d('0x7'),attributes,{'tableName':_0x0f7d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x11d898,_0x48e438,_0x56f0c3){if(_0x11d898[_0x0f7d('0x9')]('preproduction')){_0x11d898[_0x0f7d('0xa')]=moment()[_0x0f7d('0xb')](_0x0f7d('0xc'));}if(_0x11d898[_0x0f7d('0x9')](_0x0f7d('0xd'))){_0x11d898[_0x0f7d('0xe')]=moment()[_0x0f7d('0xb')](_0x0f7d('0xc'));}_0x56f0c3(null,_0x11d898);}}});};