Built motion from commit (unavailable).|2.5.27
[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 _0xd6ce=['bluebird','request-promise','path','./squareProject.attributes','exports','square_projects','changed','preproduction','savedAt','format','lodash','util','../../config/logger','api','moment'];(function(_0x177bc4,_0x89fcb7){var _0x1cd3b4=function(_0x5ef8c8){while(--_0x5ef8c8){_0x177bc4['push'](_0x177bc4['shift']());}};_0x1cd3b4(++_0x89fcb7);}(_0xd6ce,0x127));var _0xed6c=function(_0x137cf5,_0x7892d){_0x137cf5=_0x137cf5-0x0;var _0x5663a4=_0xd6ce[_0x137cf5];return _0x5663a4;};'use strict';var _=require(_0xed6c('0x0'));var util=require(_0xed6c('0x1'));var logger=require(_0xed6c('0x2'))(_0xed6c('0x3'));var moment=require(_0xed6c('0x4'));var BPromise=require(_0xed6c('0x5'));var rp=require(_0xed6c('0x6'));var fs=require('fs');var path=require(_0xed6c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xed6c('0x8'));module[_0xed6c('0x9')]=function(_0x1a6d96,_0x1d0912){return _0x1a6d96['define']('SquareProject',attributes,{'tableName':_0xed6c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46e2c4,_0x4fd673,_0x583dfb){if(_0x46e2c4[_0xed6c('0xb')](_0xed6c('0xc'))){_0x46e2c4[_0xed6c('0xd')]=moment()[_0xed6c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x46e2c4['changed']('production')){_0x46e2c4['publishedAt']=moment()[_0xed6c('0xe')]('YYYY-MM-DD\x20HH:mm:ss');}_0x583dfb(null,_0x46e2c4);}}});};