c3eb752f2e68eb24696ebda9b5ab341f4f4b5998
[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 _0xfa53=['define','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xfa53,0x127));var _0x3fa5=function(_0x3a078b,_0x25bc3f){_0x3a078b=_0x3a078b-0x0;var _0x1152f1=_0xfa53[_0x3a078b];return _0x1152f1;};'use strict';var _=require('lodash');var util=require(_0x3fa5('0x0'));var logger=require(_0x3fa5('0x1'))(_0x3fa5('0x2'));var moment=require(_0x3fa5('0x3'));var BPromise=require(_0x3fa5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3fa5('0x5'));var rimraf=require(_0x3fa5('0x6'));var config=require(_0x3fa5('0x7'));var attributes=require('./squareProject.attributes');module[_0x3fa5('0x8')]=function(_0x5ec733,_0x3412f2){return _0x5ec733[_0x3fa5('0x9')]('SquareProject',attributes,{'tableName':_0x3fa5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52c401,_0x54f273,_0x50ce81){if(_0x52c401[_0x3fa5('0xb')](_0x3fa5('0xc'))){_0x52c401[_0x3fa5('0xd')]=moment()['format'](_0x3fa5('0xe'));}if(_0x52c401[_0x3fa5('0xb')](_0x3fa5('0xf'))){_0x52c401['publishedAt']=moment()['format'](_0x3fa5('0xe'));}_0x50ce81(null,_0x52c401);}}});};