3cca0bf82ff97d6421436732181627074eaccfd9
[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 _0x005f=['YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','changed','preproduction','savedAt','format'];(function(_0x57330c,_0x52aa8f){var _0x21765b=function(_0x4585a3){while(--_0x4585a3){_0x57330c['push'](_0x57330c['shift']());}};_0x21765b(++_0x52aa8f);}(_0x005f,0x1de));var _0xf005=function(_0x42b2fc,_0x1f2c2e){_0x42b2fc=_0x42b2fc-0x0;var _0x474ff4=_0x005f[_0x42b2fc];return _0x474ff4;};'use strict';var _=require(_0xf005('0x0'));var util=require(_0xf005('0x1'));var logger=require(_0xf005('0x2'))(_0xf005('0x3'));var moment=require('moment');var BPromise=require(_0xf005('0x4'));var rp=require(_0xf005('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf005('0x6'));var config=require(_0xf005('0x7'));var attributes=require(_0xf005('0x8'));module[_0xf005('0x9')]=function(_0x3f9cdc,_0x18131b){return _0x3f9cdc[_0xf005('0xa')](_0xf005('0xb'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d27ba,_0x288828,_0x2a5b88){if(_0x5d27ba[_0xf005('0xc')](_0xf005('0xd'))){_0x5d27ba[_0xf005('0xe')]=moment()[_0xf005('0xf')](_0xf005('0x10'));}if(_0x5d27ba['changed'](_0xf005('0x11'))){_0x5d27ba[_0xf005('0x12')]=moment()['format'](_0xf005('0x10'));}_0x2a5b88(null,_0x5d27ba);}}});};