Built motion from commit (unavailable).|2.5.1
[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 _0x758e=['bluebird','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','format','YYYY-MM-DD\x20HH:mm:ss','changed','publishedAt','lodash','api','moment'];(function(_0x542b35,_0x3252ce){var _0x204bd1=function(_0x49d60e){while(--_0x49d60e){_0x542b35['push'](_0x542b35['shift']());}};_0x204bd1(++_0x3252ce);}(_0x758e,0x1af));var _0xe758=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x758e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xe758('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe758('0x1'));var moment=require(_0xe758('0x2'));var BPromise=require(_0xe758('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe758('0x4'));var config=require(_0xe758('0x5'));var attributes=require(_0xe758('0x6'));module[_0xe758('0x7')]=function(_0x5a2226,_0x2cdf89){return _0x5a2226[_0xe758('0x8')](_0xe758('0x9'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4c03ba,_0x454ee0,_0x55601a){if(_0x4c03ba['changed']('preproduction')){_0x4c03ba['savedAt']=moment()[_0xe758('0xa')](_0xe758('0xb'));}if(_0x4c03ba[_0xe758('0xc')]('production')){_0x4c03ba[_0xe758('0xd')]=moment()['format'](_0xe758('0xb'));}_0x55601a(null,_0x4c03ba);}}});};