28f043b3dba9cb77557bca9d6103d6b9c11a1212
[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 _0x8216=['YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','../../config/logger','api','bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','savedAt','format'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x8216,0x111));var _0x6821=function(_0x21126c,_0x59c317){_0x21126c=_0x21126c-0x0;var _0x4a71f5=_0x8216[_0x21126c];return _0x4a71f5;};'use strict';var _=require(_0x6821('0x0'));var util=require('util');var logger=require(_0x6821('0x1'))(_0x6821('0x2'));var moment=require('moment');var BPromise=require(_0x6821('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6821('0x4'));var config=require(_0x6821('0x5'));var attributes=require(_0x6821('0x6'));module[_0x6821('0x7')]=function(_0x2de2f0,_0x493f81){return _0x2de2f0[_0x6821('0x8')](_0x6821('0x9'),attributes,{'tableName':_0x6821('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4cc51b,_0x5001fe,_0x22e087){if(_0x4cc51b[_0x6821('0xb')](_0x6821('0xc'))){_0x4cc51b[_0x6821('0xd')]=moment()[_0x6821('0xe')](_0x6821('0xf'));}if(_0x4cc51b[_0x6821('0xb')](_0x6821('0x10'))){_0x4cc51b[_0x6821('0x11')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x22e087(null,_0x4cc51b);}}});};