Built motion from commit 9d7072cc.|2.5.39
[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 _0x4d41=['moment','bluebird','path','rimraf','../../config/environment','./squareProject.attributes','square_projects','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','util','../../config/logger'];(function(_0x1ece77,_0x1291e2){var _0x5973b3=function(_0x2d3a99){while(--_0x2d3a99){_0x1ece77['push'](_0x1ece77['shift']());}};_0x5973b3(++_0x1291e2);}(_0x4d41,0x1c5));var _0x14d4=function(_0xd307d9,_0x50e8e0){_0xd307d9=_0xd307d9-0x0;var _0x209bf8=_0x4d41[_0xd307d9];return _0x209bf8;};'use strict';var _=require('lodash');var util=require(_0x14d4('0x0'));var logger=require(_0x14d4('0x1'))('api');var moment=require(_0x14d4('0x2'));var BPromise=require(_0x14d4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x14d4('0x4'));var rimraf=require(_0x14d4('0x5'));var config=require(_0x14d4('0x6'));var attributes=require(_0x14d4('0x7'));module['exports']=function(_0x18dd46,_0x428135){return _0x18dd46['define']('SquareProject',attributes,{'tableName':_0x14d4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x34390b,_0x1fde67,_0x5b994a){if(_0x34390b[_0x14d4('0x9')](_0x14d4('0xa'))){_0x34390b[_0x14d4('0xb')]=moment()['format'](_0x14d4('0xc'));}if(_0x34390b[_0x14d4('0x9')]('production')){_0x34390b['publishedAt']=moment()['format'](_0x14d4('0xc'));}_0x5b994a(null,_0x34390b);}}});};