Unverified Commit 9c72a6c3 authored by Christopher Guindon's avatar Christopher Guindon Committed by GitHub
Browse files

Updates to the /working_groups resource #167 (#204)

* Updates to the /working_groups resource #167

Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* remove org doc id for science
Signed-off-by: Christopher Guindon's avatarChristopher Guindon <chris.guindon@eclipse-foundation.org>

* Update the Working Group object structure in the API

* Fix imports, update openapi spec to reflect new WG structure

* Update documentation for Working Group service and related resources

* updated front end to work with new wg data

* Fix integrity of the list in the working group import object
Co-authored-by: Martin Lowe's avatarMartin Lowe <martin.lowe@eclipse-foundation.org>
Co-authored-by: Zhou Fang's avatarZhou Fang <zhou.fang@eclipse-foundation.org>
parent 4c493ace
......@@ -771,26 +771,66 @@ components:
WorkingGroup:
type: object
properties:
documentID:
$ref: '#/components/schemas/ObjectID'
name:
alias:
type: string
description: internal alias for the working group
title:
type: string
description: Public-facing or official name of the working group
status:
type: string
description: Current status of the working group (e.g. incubating, active, archived)
logo:
type: string
description: image link for the working groups logo
description:
type: string
description: Short description of the working group
resources:
type: object
properties:
charter:
type: string
description: Link to the charter for the current working group
contact_form:
type: string
description: URL link to the contact form
members:
type: string
description: URL to the members list for the given working group
participation_agreements:
type: object
properties:
individual:
$ref: '#/components/schemas/WorkingGroupParticipationAgreement'
organization:
$ref: '#/components/schemas/WorkingGroupParticipationAgreement'
sponsorship:
type: string
description: link to the sponsorship agreement document
website:
type: string
description: the URL for the homepage of this working group
levels:
type: array
items:
type: object
description: Definition of the participation level for the working group, including its relation code
properties:
relation:
type: string
description: code representing the relation, used internally when using common relation types
description:
type: string
description: the label for the participation level
WorkingGroupParticipationAgreement:
type: object
description: The ID of the working group relationship to be formed
properties:
document_id:
$ref: '#/components/schemas/ObjectID'
level:
type: string
price:
pdf:
type: string
revenue_top:
type: number
revenue_bottom:
type: number
company_size:
type: number
description: Link to the PDF version of the participation agreement
ConstraintViolations:
type: array
......
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
/**
* Copyright (c) 2021 Eclipse Foundation
*
......@@ -11,81 +22,136 @@
*/
package org.eclipsefoundation.react.model;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
/**
* Definition representing data about a working group, including the core information about the group, links to
* resources for the group, and available participation levels.
*
* @author Martin Lowe
*
*/
public class WorkingGroup {
private String documentID;
private String name;
private String alias;
private String title;
private String status;
private String logo;
private String description;
private WorkingGroupResources resources;
private List<WorkingGroupParticipationLevel> levels;
public WorkingGroup(String documentID, String name, List<WorkingGroupParticipationLevel> levels) {
this.documentID = documentID;
this.name = name;
this.levels = levels;
/**
* @return the alias
*/
public String getAlias() {
return alias;
}
public WorkingGroup() {
/**
* @param alias the alias to set
*/
public void setAlias(String alias) {
this.alias = alias;
}
public WorkingGroup(String documentID, String name) {
this.documentID = documentID;
this.name = name;
/**
* @return the title
*/
public String getTitle() {
return title;
}
public String getDocumentID() {
return this.documentID;
/**
* @param title the title to set
*/
public void setTitle(String title) {
this.title = title;
}
public void setDocumentID(String documentID) {
this.documentID = documentID;
/**
* @return the status
*/
public String getStatus() {
return status;
}
public String getName() {
return this.name;
/**
* @param status the status to set
*/
public void setStatus(String status) {
this.status = status;
}
public void setName(String name) {
this.name = name;
/**
* @return the logo
*/
public String getLogo() {
return logo;
}
public List<WorkingGroupParticipationLevel> getLevels() {
return this.levels;
/**
* @param logo the logo to set
*/
public void setLogo(String logo) {
this.logo = logo;
}
public void setLevels(List<WorkingGroupParticipationLevel> levels) {
this.levels = levels;
/**
* @return the description
*/
public String getDescription() {
return description;
}
public WorkingGroup documentID(String documentID) {
setDocumentID(documentID);
return this;
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
public WorkingGroup name(String name) {
setName(name);
return this;
/**
* @return the resources
*/
public WorkingGroupResources getResources() {
return resources;
}
public WorkingGroup levels(List<WorkingGroupParticipationLevel> levels) {
setLevels(levels);
return this;
/**
* @param resources the resources to set
*/
public void setResources(WorkingGroupResources resources) {
this.resources = resources;
}
@Override
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof WorkingGroup)) {
return false;
public List<WorkingGroupParticipationLevel> getLevels() {
return new ArrayList<>(this.levels);
}
WorkingGroup workingGroup = (WorkingGroup) o;
return Objects.equals(documentID, workingGroup.documentID) && Objects.equals(name, workingGroup.name);
public void setLevels(List<WorkingGroupParticipationLevel> levels) {
this.levels = new ArrayList<>(levels);
}
@Override
public int hashCode() {
return Objects.hash(documentID, name);
return Objects.hash(alias, description, levels, logo, resources, status, title);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroup other = (WorkingGroup) obj;
return Objects.equals(alias, other.alias) && Objects.equals(description, other.description)
&& Objects.equals(levels, other.levels) && Objects.equals(logo, other.logo)
&& Objects.equals(resources, other.resources) && Objects.equals(status, other.status)
&& Objects.equals(title, other.title);
}
}
......@@ -11,7 +11,7 @@
*/
package org.eclipsefoundation.react.model;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
......@@ -19,25 +19,25 @@ import java.util.Objects;
*
* @author Martin Lowe <martin.lowe@eclipse-foundation.org>
*/
public class WorkingGroupList {
private List<WorkingGroup> workingGroups;
public class WorkingGroupMap {
private Map<String, WorkingGroup> workingGroups;
public WorkingGroupList() {
public WorkingGroupMap() {
}
public WorkingGroupList(List<WorkingGroup> workingGroups) {
public WorkingGroupMap(Map<String, WorkingGroup> workingGroups) {
this.workingGroups = workingGroups;
}
public List<WorkingGroup> getWorkingGroups() {
public Map<String, WorkingGroup> getWorkingGroups() {
return this.workingGroups;
}
public void setWorkingGroups(List<WorkingGroup> workingGroups) {
public void setWorkingGroups(Map<String, WorkingGroup> workingGroups) {
this.workingGroups = workingGroups;
}
public WorkingGroupList workingGroups(List<WorkingGroup> workingGroups) {
public WorkingGroupMap workingGroups(Map<String, WorkingGroup> workingGroups) {
setWorkingGroups(workingGroups);
return this;
}
......@@ -46,10 +46,10 @@ public class WorkingGroupList {
public boolean equals(Object o) {
if (o == this)
return true;
if (!(o instanceof WorkingGroupList)) {
if (!(o instanceof WorkingGroupMap)) {
return false;
}
WorkingGroupList workingGroupList = (WorkingGroupList) o;
WorkingGroupMap workingGroupList = (WorkingGroupMap) o;
return Objects.equals(workingGroups, workingGroupList.workingGroups);
}
......
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipsefoundation.react.model;
import java.util.Objects;
import javax.json.bind.annotation.JsonbProperty;
/**
* Defines a PDF version of a blank participation agreement, as well as the document ID for the document within the
* Eclipse databases.
*
* @author Martin Lowe
*
*/
public class WorkingGroupParticipationAgreement {
@JsonbProperty("document_id")
private String documentId;
private String pdf;
/**
* @return the documentId
*/
public String getDocumentId() {
return documentId;
}
/**
* @param documentId the documentId to set
*/
public void setDocumentId(String documentId) {
this.documentId = documentId;
}
/**
* @return the pdf
*/
public String getPdf() {
return pdf;
}
/**
* @param pdf the pdf to set
*/
public void setPdf(String pdf) {
this.pdf = pdf;
}
@Override
public int hashCode() {
return Objects.hash(documentId, pdf);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroupParticipationAgreement other = (WorkingGroupParticipationAgreement) obj;
return Objects.equals(documentId, other.documentId) && Objects.equals(pdf, other.pdf);
}
}
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.eclipsefoundation.react.model;
import java.util.Objects;
/**
* Represents the available participation agreements for a working group
*
* @author Martin Lowe
*
*/
public class WorkingGroupParticipationAgreements {
private WorkingGroupParticipationAgreement individual;
private WorkingGroupParticipationAgreement organization;
/**
* @return the individual
*/
public WorkingGroupParticipationAgreement getIndividual() {
return individual;
}
/**
* @param individual the individual to set
*/
public void setIndividual(WorkingGroupParticipationAgreement individual) {
this.individual = individual;
}
/**
* @return the organization
*/
public WorkingGroupParticipationAgreement getOrganization() {
return organization;
}
/**
* @param organization the organization to set
*/
public void setOrganization(WorkingGroupParticipationAgreement organization) {
this.organization = organization;
}
@Override
public int hashCode() {
return Objects.hash(individual, organization);
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroupParticipationAgreements other = (WorkingGroupParticipationAgreements) obj;
return Objects.equals(individual, other.individual) && Objects.equals(organization, other.organization);
}
}
......@@ -11,61 +11,55 @@
*/
package org.eclipsefoundation.react.model;
public class WorkingGroupParticipationLevel {
private String documentID;
private String level;
private String price;
private int revenueTop;
private int revenueBottom;
private Integer companySize;
public String getDocumentID() {
return this.documentID;
}
public void setDocumentID(String documentID) {
this.documentID = documentID;
}
public String getLevel() {
return this.level;
}
public void setLevel(String level) {
this.level = level;
}
public String getPrice() {
return this.price;
}
public void setPrice(String price) {
this.price = price;
}
import java.util.Objects;
public class WorkingGroupParticipationLevel {
private String relation;
private String description;
public int getRevenueTop() {
return this.revenueTop;
/**
* @return the relation
*/
public String getRelation() {
return relation;
}
public void setRevenueTop(int revenueTop) {
this.revenueTop = revenueTop;
/**
* @param relation the relation to set
*/
public void setRelation(String relation) {
this.relation = relation;
}
public int getRevenueBottom() {
return this.revenueBottom;
/**
* @return the description
*/
public String getDescription() {
return description;
}
public void setRevenueBottom(int revenueBottom) {
this.revenueBottom = revenueBottom;
/**
* @param description the description to set
*/
public void setDescription(String description) {
this.description = description;
}
public Integer getCompanySize() {
return this.companySize;
@Override
public int hashCode() {
return Objects.hash(description, relation);
}
public void setCompanySize(Integer companySize) {
this.companySize = companySize;
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
WorkingGroupParticipationLevel other = (WorkingGroupParticipationLevel) obj;
return Objects.equals(description, other.description) && Objects.equals(relation, other.relation);
}
}
/**
* Copyright (c) 2021 Eclipse Foundation
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* Author: Martin Lowe <martin.lowe@eclipse-foundation.org>
*