Built motion from commit da24aabd.|2.6.20
[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 _0xb024=['square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','publishedAt','format','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject'];(function(_0x303506,_0x31a0e9){var _0x45d789=function(_0x1ecfb9){while(--_0x1ecfb9){_0x303506['push'](_0x303506['shift']());}};_0x45d789(++_0x31a0e9);}(_0xb024,0x15d));var _0x4b02=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xb024[_0x1cc8fe];return _0x230054;};'use strict';var _=require('lodash');var util=require(_0x4b02('0x0'));var logger=require('../../config/logger')(_0x4b02('0x1'));var moment=require(_0x4b02('0x2'));var BPromise=require(_0x4b02('0x3'));var rp=require(_0x4b02('0x4'));var fs=require('fs');var path=require(_0x4b02('0x5'));var rimraf=require(_0x4b02('0x6'));var config=require(_0x4b02('0x7'));var attributes=require(_0x4b02('0x8'));module[_0x4b02('0x9')]=function(_0x5e66c0,_0x4be644){return _0x5e66c0[_0x4b02('0xa')](_0x4b02('0xb'),attributes,{'tableName':_0x4b02('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3da234,_0x587082,_0x33301b){if(_0x3da234[_0x4b02('0xd')](_0x4b02('0xe'))){_0x3da234[_0x4b02('0xf')]=moment()['format'](_0x4b02('0x10'));}if(_0x3da234[_0x4b02('0xd')]('production')){_0x3da234[_0x4b02('0x11')]=moment()[_0x4b02('0x12')](_0x4b02('0x10'));}_0x33301b(null,_0x3da234);}}});};