Commit cfba9e81 authored by Vijay Sreenivas's avatar Vijay Sreenivas

Innovation Changes

parent 1b996ed5
Pipeline #3478 failed with stages
in 2 seconds
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation;
import java.io.File;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.PropertySource;
import org.togglz.core.manager.EnumBasedFeatureProvider;
import org.togglz.core.repository.StateRepository;
import org.togglz.core.repository.file.FileBasedStateRepository;
import org.togglz.core.spi.FeatureProvider;
import org.togglz.core.user.NoOpUserProvider;
import org.togglz.core.user.UserProvider;
import com.altimetrik.playground.innovation.feature.Features;
import com.altimetrik.playground.innovation.properties.ErrorProperties;
import com.altimetrik.playground.innovation.properties.ServiceProperties;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@ServletComponentScan
@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
@EnableHystrixDashboard
@PropertySource(value = { "classpath:db-config.properties", "classpath:service.properties" })
@EnableConfigurationProperties({ ServiceProperties.class, ErrorProperties.class })
public class PlaygroundInnovationApplication {
public static void main(String[] args) {
SpringApplication.run(PlaygroundInnovationApplication.class, args);
}
@Bean
public FeatureProvider featureProvider() {
return new EnumBasedFeatureProvider(Features.class);
}
@Bean
public UserProvider userProvider() {
return new NoOpUserProvider();
}
@Bean
public StateRepository getStateRepository() {
return new FileBasedStateRepository(new File("src/main/resources/features.properties"), 10_000);
}
@Bean
public Gson gson() {
return new GsonBuilder().serializeNulls().create();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.annotation;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import com.altimetrik.playground.innovation.constants.ActionTypeEnum;
import com.altimetrik.playground.innovation.constants.RoleTypeEnum;
/**
* Custom annotation which is used to tag a web service to specify the roles
* information which is used for validation by the RolesInterceptor.
*
* @author skondapalli.
*/
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface RolesAllowed {
RoleTypeEnum[] roles();
ActionTypeEnum action();
String description() default "";
}
......@@ -11,7 +11,7 @@ package com.altimetrik.playground.innovation.bean;
import lombok.Data;
@Data
public class BaseRequestBean {
public class BaseRequestBean {
public BaseRequestBean() {
super();
......
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.io.Serializable;
import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import com.altimetrik.playground.innovation.constants.ArtifactTypeEnum;
import lombok.Data;
@Data
public class PgIdeaArtifact implements Serializable {
private static final long serialVersionUID = -8931921342171547040L;
private String id;
@NotBlank
private String linkName;
@NotNull
private ArtifactTypeEnum artifactType;
@NotBlank
private String linkUrl;
private String fileName;
private String createdBy;
private Date createdOn;
public PgIdeaArtifact(String id, String linkName, ArtifactTypeEnum artifactType, String linkUrl, String fileName, String createdBy, Date createdOn) {
super();
this.id = id;
this.linkName = linkName;
this.artifactType = artifactType;
this.linkUrl = linkUrl;
this.fileName = fileName;
this.createdBy = createdBy;
this.createdOn = createdOn;
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaArtifactListResponse extends ResponseModel {
private static final long serialVersionUID = -916706158688154611L;
private String ideaId;
private List<PgIdeaArtifact> result;
public PgIdeaArtifactListResponse() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.List;
import lombok.Data;
@Data
public class PgIdeaCategoryListResponse extends ResponseModel {
private List<PgIdeaCategoryResponse> result;
public PgIdeaCategoryListResponse() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaCategoryRequest extends BaseRequestBean {
private static final long serialVersionUID = 644473128186417688L;
private String categoryName;
private List<PgMentorResponse> mentors;
private List<PgReviewer> reviewers;
public PgIdeaCategoryRequest() {
super();
}
public PgIdeaCategoryRequest(String categoryName) {
super();
this.categoryName = categoryName;
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.Date;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaCategoryResponse extends ResponseModel {
private static final long serialVersionUID = 644473128186417688L;
private String categoryId;
private String categoryName;
private List<PgMentorResponse> mentors;
private List<PgReviewer> reviewers;
private String createdBy;
private Date createdDate;
public PgIdeaCategoryResponse() {
super();
}
public PgIdeaCategoryResponse(String categoryId, String categoryName) {
super();
this.categoryId = categoryId;
this.categoryName = categoryName;
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import javax.validation.constraints.NotBlank;
import com.altimetrik.playground.innovation.constants.IdeaStatusEnum;
import com.altimetrik.playground.innovation.constants.IdeaTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaRequest extends BaseRequestBean {
private IdeaTypeEnum ideaType;
@NotBlank
private String title;
private String description;
private String businessRelevance;
private String ideaCategoryId;
private Boolean competenceCenter;
private IdeaStatusEnum status;
private Boolean published;
private Boolean locked;
private String businessDomain;
private String technologyDomain;
private String techStack;
private String novelty;
private String claims;
private String completeness;
private Boolean disclosed;
private String accessLevel;
public PgIdeaRequest() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.Date;
import com.altimetrik.playground.innovation.constants.IdeaStatusEnum;
import com.altimetrik.playground.innovation.constants.IdeaTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaResponse extends ResponseModel {
private static final long serialVersionUID = -4426625885342889037L;
private String businessRelevance;
private String description;
private String ideaCategoryId;
private IdeaTypeEnum ideaType;
private Boolean competenceCenter;
private IdeaStatusEnum ideaStatus;
private Boolean published;
private Boolean locked;
private String businessDomain;
private String technologyDomain;
private String novelty;
private String claims;
private String completeness;
private String techStack;
private String title;
private Date createdOn;
private String createdById;
private String ideaId;
private String l0ReviewerId;
private Boolean disclosed;
private String accessLevel;
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import com.altimetrik.playground.innovation.constants.RoleTypeEnum;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestModeEnum;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestStatusEnum;
import lombok.Getter;
import lombok.Setter;
@Setter
@Getter
public class PgIdeaReviewer {
private Long teamMemberId;
private RoleTypeEnum roleType;
private TeamMemberRequestModeEnum teamMemberRequestMode = TeamMemberRequestModeEnum.STANDARD;
private TeamMemberRequestStatusEnum teamMemberRequestStatus;
private String approvedBy;
private String teamMemberName;
private String emailId;
public PgIdeaReviewer() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaSearchRequest extends BaseRequestBean {
private String search;
private Boolean mine;
private Integer offset;
private Integer limit;
private String[] ids;
public PgIdeaSearchRequest() {
super();
}
public PgIdeaSearchRequest(String search, boolean mine, int offset, int limit) {
super();
this.search = search;
this.mine = mine;
this.offset = offset;
this.limit = limit;
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaSearchResponse extends ResponseModel {
private static final long serialVersionUID = 2980698181408879679L;
private List<PgIdeaResponse> result;
public PgIdeaSearchResponse() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import com.altimetrik.playground.innovation.constants.IdeaStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaStatusChangeRequest extends BaseRequestBean {
private String message;
private IdeaStatusEnum level;
private boolean approved;
public PgIdeaStatusChangeRequest() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import javax.validation.constraints.NotBlank;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestModeEnum;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaTeamInviteRequest extends BaseRequestBean {
private String id;
@NotBlank
private String role;
private TeamMemberRequestModeEnum type;
private TeamMemberRequestStatusEnum teamMemberRequestStatus;
@NotBlank
private String userId;
public PgIdeaTeamInviteRequest() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.List;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaTeamListResponse extends ResponseModel {
private static final long serialVersionUID = 6278872172251374523L;
private List<PgIdeaTeamResponse> result;
public PgIdeaTeamListResponse() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.util.Date;
import com.altimetrik.playground.innovation.constants.RoleTypeEnum;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestModeEnum;
import com.altimetrik.playground.innovation.constants.TeamMemberRequestStatusEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgIdeaTeamResponse extends BaseResponse {
private static final long serialVersionUID = -8642234932548387988L;
private String id;
private RoleTypeEnum role;
private TeamMemberRequestModeEnum mode;
private TeamMemberRequestStatusEnum teamMemberRequestStatus;
private String userId;
private String createdBy;
private Date createdDate;
private String lastModifiedBy;
public PgIdeaTeamResponse() {
super();
}
}
/*******************************************************************************
* Copyright (C) Altimetrik 2018. All rights reserved.
*
* This software is the confidential and proprietary information
* of Altimetrik. You shall not disclose such Confidential Information
* and shall use it only in accordance with the terms and conditions
* entered into with Altimetrik.
******************************************************************************/
package com.altimetrik.playground.innovation.bean;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class PgMentorResponse implements Serializable {
private static final long serialVersionUID = -7228617477712740719L;
private Long mentorId;
private String mentorName;
private Long categoryId;
public PgMentorResponse() {
super();
}