846698fa56b604b656d984fc6814d50bb49a48b4
[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 _0xdfb7=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','define','SquareProject','changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','util'];(function(_0x300f57,_0x38bc92){var _0x369a46=function(_0x3ce60e){while(--_0x3ce60e){_0x300f57['push'](_0x300f57['shift']());}};_0x369a46(++_0x38bc92);}(_0xdfb7,0x11c));var _0x7dfb=function(_0xc2f176,_0x2aedfe){_0xc2f176=_0xc2f176-0x0;var _0x235fdf=_0xdfb7[_0xc2f176];return _0x235fdf;};'use strict';var _=require('lodash');var util=require(_0x7dfb('0x0'));var logger=require(_0x7dfb('0x1'))(_0x7dfb('0x2'));var moment=require('moment');var BPromise=require(_0x7dfb('0x3'));var rp=require(_0x7dfb('0x4'));var fs=require('fs');var path=require(_0x7dfb('0x5'));var rimraf=require('rimraf');var config=require(_0x7dfb('0x6'));var attributes=require(_0x7dfb('0x7'));module['exports']=function(_0x14d0bc,_0x5e10a0){return _0x14d0bc[_0x7dfb('0x8')](_0x7dfb('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x359c2f,_0x3d6be5,_0x35f029){if(_0x359c2f[_0x7dfb('0xa')]('preproduction')){_0x359c2f[_0x7dfb('0xb')]=moment()[_0x7dfb('0xc')](_0x7dfb('0xd'));}if(_0x359c2f[_0x7dfb('0xa')]('production')){_0x359c2f[_0x7dfb('0xe')]=moment()[_0x7dfb('0xc')](_0x7dfb('0xd'));}_0x35f029(null,_0x359c2f);}}});};