7684f4104ba3735dfb33bd330d2c12f57e6e2f5f
[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 _0x7868=['SquareProject','square_projects','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./squareProject.attributes','exports','define'];(function(_0x1a1bd2,_0x1f07e4){var _0x2fabdc=function(_0x50c293){while(--_0x50c293){_0x1a1bd2['push'](_0x1a1bd2['shift']());}};_0x2fabdc(++_0x1f07e4);}(_0x7868,0x1c0));var _0x8786=function(_0xd2ac71,_0x197ea0){_0xd2ac71=_0xd2ac71-0x0;var _0x1b151c=_0x7868[_0xd2ac71];return _0x1b151c;};'use strict';var _=require(_0x8786('0x0'));var util=require('util');var logger=require(_0x8786('0x1'))(_0x8786('0x2'));var moment=require(_0x8786('0x3'));var BPromise=require(_0x8786('0x4'));var rp=require(_0x8786('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8786('0x6'));var config=require(_0x8786('0x7'));var attributes=require(_0x8786('0x8'));module[_0x8786('0x9')]=function(_0x121ac4,_0x2c786d){return _0x121ac4[_0x8786('0xa')](_0x8786('0xb'),attributes,{'tableName':_0x8786('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe9a88d,_0x20b3ed,_0x34e86e){if(_0xe9a88d['changed']('preproduction')){_0xe9a88d[_0x8786('0xd')]=moment()[_0x8786('0xe')](_0x8786('0xf'));}if(_0xe9a88d['changed']('production')){_0xe9a88d[_0x8786('0x10')]=moment()['format'](_0x8786('0xf'));}_0x34e86e(null,_0xe9a88d);}}});};