Built motion from commit (unavailable).|2.5.14
[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 _0x5395=['SquareProject','square_projects','changed','preproduction','production','format','lodash','../../config/logger','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define'];(function(_0xa522f,_0x5debbc){var _0x2083b0=function(_0x288f01){while(--_0x288f01){_0xa522f['push'](_0xa522f['shift']());}};_0x2083b0(++_0x5debbc);}(_0x5395,0x150));var _0x5539=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5395[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x5539('0x0'));var util=require('util');var logger=require(_0x5539('0x1'))('api');var moment=require('moment');var BPromise=require(_0x5539('0x2'));var rp=require(_0x5539('0x3'));var fs=require('fs');var path=require(_0x5539('0x4'));var rimraf=require('rimraf');var config=require(_0x5539('0x5'));var attributes=require(_0x5539('0x6'));module[_0x5539('0x7')]=function(_0x751919,_0x99948d){return _0x751919[_0x5539('0x8')](_0x5539('0x9'),attributes,{'tableName':_0x5539('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x56b645,_0x37fb7d,_0x32af1c){if(_0x56b645[_0x5539('0xb')](_0x5539('0xc'))){_0x56b645['savedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x56b645['changed'](_0x5539('0xd'))){_0x56b645['publishedAt']=moment()[_0x5539('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x32af1c(null,_0x56b645);}}});};