Added OrganizationType to symbolize limited options

This commit is contained in:
Jim Martens 2020-07-10 22:46:10 +02:00
parent 02efc1b76a
commit 75ad80e760
2 changed files with 22 additions and 1 deletions

View File

@ -73,7 +73,7 @@ public class Organization {
@Schema(description = "rough categorization of the organization", nullable = true,
allowableValues = "Gremium, Partei, Fraktion, Verwaltungsbereich, externes Gremium, Institution, Sonstiges")
private final String organizationType;
private final OrganizationType organizationType;
@Schema(description = "type of organization", nullable = true)
private final String classification;

View File

@ -0,0 +1,21 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.ToString;
@RequiredArgsConstructor
@Getter(onMethod_={@JsonValue})
@ToString
public enum OrganizationType {
BODY("Gremium"),
PARTY("Partei"),
FACTION("Fraktion"),
ADMINISTRATIVE_AREA("Verwaltungsbereich"),
EXTERNAL_BODY("externes Gremium"),
INSTITUTION("Institution"),
OTHER("Sonstiges");
private final String value;
}