fb6752f1253bcd2493806944135a195473b4c07e
[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 _0xa48a=['rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','publishedAt','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xa48a,0x150));var _0xaa48=function(_0x9f645c,_0x479db0){_0x9f645c=_0x9f645c-0x0;var _0x50ada4=_0xa48a[_0x9f645c];return _0x50ada4;};'use strict';var _=require(_0xaa48('0x0'));var util=require('util');var logger=require(_0xaa48('0x1'))(_0xaa48('0x2'));var moment=require(_0xaa48('0x3'));var BPromise=require(_0xaa48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa48('0x5'));var rimraf=require(_0xaa48('0x6'));var config=require(_0xaa48('0x7'));var attributes=require(_0xaa48('0x8'));module['exports']=function(_0x1a00d5,_0x1a4e8b){return _0x1a00d5[_0xaa48('0x9')](_0xaa48('0xa'),attributes,{'tableName':_0xaa48('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x134ffd,_0x1f90ca,_0x3086d9){if(_0x134ffd[_0xaa48('0xc')](_0xaa48('0xd'))){_0x134ffd[_0xaa48('0xe')]=moment()[_0xaa48('0xf')](_0xaa48('0x10'));}if(_0x134ffd[_0xaa48('0xc')]('production')){_0x134ffd[_0xaa48('0x11')]=moment()[_0xaa48('0xf')](_0xaa48('0x10'));}_0x3086d9(null,_0x134ffd);}}});};