Browse Source

Added additional entities

master
Jim Martens 10 months ago
parent
commit
6c6aee8317
  1. 58
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/AgendaItem.java
  2. 73
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/File.java
  3. 59
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Meeting.java
  4. 40
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Membership.java
  5. 67
      oparl-server/src/main/java/de/twomartens/oparlservice/entity/Person.java

58
oparl-server/src/main/java/de/twomartens/oparlservice/entity/AgendaItem.java

@ -0,0 +1,58 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class AgendaItem extends CommonFields {
@Schema(description = "URL to the meeting this agenda item is part of", nullable = true)
private final String meeting;
@Schema(description = "number of the agenda item", nullable = true, example = "10.1, A, ...")
private final String number;
@Schema(description = "position of the agenda item in the meeting based on 0", required = true)
private final int order;
@Schema(description = "the topic of the agenda item", nullable = true)
private final String name;
@JsonProperty("public")
@Schema(description = "True if the agenda item is public")
private final boolean isPublic;
@Schema(description = "URL to the consultation related to this agenda item", nullable = true)
private final String consultation;
@Schema(description = "categorical information about result of consultation of this agenda item", nullable = true)
private final String result;
@Schema(description = "resolution text of a decision in this agenda item", nullable = true)
private final String resolutionText;
@Schema(description = "resolution file of a decision in this agenda item", nullable = true)
private final File resolutionFile;
@Schema(description = "additional appendices to this agenda item", nullable = true)
private final List<File> auxiliaryFile;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date and time of the begin of the agenda item", nullable = true)
private final ZonedDateTime start;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date and time of the end of the agenda item", nullable = true)
private final ZonedDateTime end;
}

73
oparl-server/src/main/java/de/twomartens/oparlservice/entity/File.java

@ -0,0 +1,73 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
import java.util.List;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class File extends CommonFields {
@Schema(description = "name of the file without file ending", nullable = true)
private final String name;
@Schema(description = "file name of the file", nullable = true)
private final String fileName;
@Schema(description = "mime type of this file", nullable = true)
private final String mimeType;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date which is used, for example, as a reference for deadlines", nullable = true)
private final LocalDate date;
@Schema(description = "size of the file in bytes")
private final int size;
@Schema(description = "SHA1 checksum of the file content in hexadecimal form", deprecated = true, nullable = true)
private final String sha1Checksum;
@Schema(description = "SHA512 checksum of the file content in hexadecimal form", nullable = true)
private final String sha512Checksum;
@Schema(description = "pure text representation of the file content if possible", nullable = true)
private final String text;
@Schema(description = "URL to access the file", required = true)
private final String accessUrl;
@Schema(description = "URL to download the file", nullable = true)
private final String downloadUrl;
@Schema(description = "URL to an additional access possibility", nullable = true)
private final String externalServiceUrl;
@Schema(description = "URL to the master file from which this file was derived", nullable = true)
private final String masterFile;
@Schema(description = "List of URLs to files that were derived from this file", nullable = true)
private final List<String> derivativeFile;
@Schema(description = "URL to the license for this file", nullable = true)
private final String fileLicense;
@Schema(description = "List of URLs to meetings this file is referenced in", nullable = true)
private final List<String> meeting;
@Schema(description = "List of URLs to agenda items this file is referenced in", nullable = true)
private final List<String> agendaItem;
@Schema(description = "URL to the person which uses this file as image", nullable = true)
private final String person;
@Schema(description = "List of URLs to papers this file is referenced in", nullable = true)
private final List<String> paper;
}

59
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Meeting.java

@ -0,0 +1,59 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.ZonedDateTime;
import java.util.List;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Meeting extends CommonFields {
@Schema(description = "name of the meeting")
private final String name;
@Schema(description = "current status of the meeting", allowableValues = "terminiert, eingeladen, durchgeführt", nullable = true)
private final String meetingState;
@Schema(description = "True if this meeting was cancelled")
private final boolean cancelled;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date and time of the begin of the meeting", nullable = true)
private final ZonedDateTime start;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "date and time of the end of the meeting", nullable = true)
private final ZonedDateTime end;
@Schema(description = "location of the meeting", nullable = true)
private final Location location;
@Schema(description = "List of URLs to organizations that have this meeting", nullable = true)
private final List<String> organization;
@Schema(description = "List of URLs to persons that participated in the meeting", nullable = true)
private final List<String> participant;
@Schema(description = "invitation document of the meeting", nullable = true)
private final File invitation;
@Schema(description = "results protocol of the meeting", nullable = true)
private final File resultsProtocol;
@Schema(description = "verbatim protocol of the meeting", nullable = true)
private final File verbatimProtocol;
@Schema(description = "List of appendices to the invitation that are not part of agenda items", nullable = true)
private final List<File> auxiliaryFile;
@Schema(description = "List of agenda items in this meeting. Order is relevant", nullable = true)
private final List<AgendaItem> agendaItem;
}

40
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Membership.java

@ -0,0 +1,40 @@
package de.twomartens.oparlservice.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.time.LocalDate;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Membership extends CommonFields {
@Schema(description = "URL to the person related to this membership", nullable = true)
private final String person;
@Schema(description = "URL to the organization related to this membership", nullable = true)
private final String organization;
@Schema(description = "role of the person for the organization", nullable = true)
private final String role;
@Schema(description = "True if the person has a voting right in the organization")
private final boolean votingRight;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "first day of the membership", nullable = true)
private final LocalDate startDate;
@JsonFormat(shape = JsonFormat.Shape.STRING)
@Schema(description = "last day of the membership", nullable = true)
private final LocalDate endDate;
@Schema(description = "URL to the organization for which the person is member in the organization", nullable = true)
private final String onBehalfOf;
}

67
oparl-server/src/main/java/de/twomartens/oparlservice/entity/Person.java

@ -0,0 +1,67 @@
package de.twomartens.oparlservice.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import lombok.experimental.SuperBuilder;
import java.util.List;
@SuperBuilder
@Getter
@ToString
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@NoArgsConstructor(force = true, access = AccessLevel.PRIVATE)
@Schema(allOf = CommonFields.class)
public class Person extends CommonFields {
@Schema(description = "URL to the body this person belongs so", nullable = true)
private final String body;
@Schema(description = "full name of this person including academic title", nullable = true)
private final String name;
@Schema(description = "family name of this person", nullable = true)
private final String familyName;
@Schema(description = "given name of this person", nullable = true)
private final String givenName;
@Schema(description = "form of address of this person", nullable = true)
private final String formOfAddress;
@Schema(description = "applicable affix to the name of this person", nullable = true)
private final String affix;
@Schema(description = "List of academic titles", nullable = true)
private final List<String> title;
@Schema(description = "gender of this person in English", nullable = true, example = "female, male, ...")
private final String gender;
@Schema(description = "List of phone number of this person", nullable = true)
private final List<String> phone;
@Schema(description = "List of email addresses of this person", nullable = true)
private final List<String> email;
@Schema(description = "URL to the contact address of this person", nullable = true)
private final String location;
@Schema(description = "contact address of this person", nullable = true)
private final Location locationObject;
@Schema(description = "List of roles in the body", nullable = true)
private final List<String> status;
@Schema(description = "List of memberships of this person, both current and former", nullable = true)
private final List<Membership> membership;
@Schema(description = "image of this person", nullable = true)
private final File image;
@Schema(description = "short info text about this person", nullable = true, maxLength = 300)
private final String life;
@Schema(description = "source for the info in life field", nullable = true)
private final String lifeSource;
}
Loading…
Cancel
Save