AccessionDTO.java
/*
* Copyright 2026 Global Crop Diversity Trust
* Licensed under the Apache License, Version 2.0
* See LICENSE file in project root folder or http://www.apache.org/licenses/LICENSE-2.0
*/
package org.gringlobal.model.elastic;
import static org.gringlobal.model.community.CommunityCodeValues.ACCESSION_MLS_STATUS;
import java.time.Instant;
import java.util.Date;
import java.util.List;
import org.gringlobal.custom.elasticsearch.SearchField;
import org.gringlobal.custom.validation.javax.CodeValueField;
import org.gringlobal.model.community.CommunityCodeValues;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
@Getter
@Setter
@Document(indexName = "accession")
public class AccessionDTO {
private Long id;
private Long ownedBy;
private Instant ownedDate;
private Long createdBy;
private Instant createdDate;
private Long modifiedBy;
private Instant modifiedDate;
@Field(type = FieldType.Object)
private SiteInfo site;
@SearchField
@Field(type = FieldType.Keyword)
private String accessionNumber;
@CodeValueField(value = ACCESSION_MLS_STATUS, indexed = true)
private String mlsStatus;
@Field(type = FieldType.Keyword)
private String accessionNumberPart1;
private Long accessionNumberPart2;
@Field(type = FieldType.Keyword)
private String accessionNumberPart3;
@Field(type = FieldType.Object)
private SiteInfo backupLocation1Site;
@Field(type = FieldType.Object)
private SiteInfo backupLocation2Site;
@Field(type = FieldType.Keyword)
private String doi;
@CodeValueField(value = "IMPROVEMENT_LEVEL", indexed = true)
private String improvementStatusCode;
private Date initialReceivedDate;
@Field(type = FieldType.Keyword)
private String initialReceivedDateCode;
@CodeValueField(value = CommunityCodeValues.GERMPLASM_FORM, indexed = true)
private String initialReceivedFormCode;
@Field(type = FieldType.Keyword)
private String isBackedUp;
@Field(type = FieldType.Keyword)
private String isCore;
@Field(type = FieldType.Keyword)
private String isWebVisible;
@CodeValueField(value = "ACCESSION_LIFE_FORM", indexed = true)
private String lifeFormCode;
@SearchField
@Field(type = FieldType.Text)
private String note;
@CodeValueField(value = "REPRODUCTIVE_UNIFORMITY", indexed = true)
private String reproductiveUniformityCode;
@CodeValueField(value = CommunityCodeValues.ACCESSION_STATUS, indexed = true)
private String statusCode;
@CodeValueField(value = CommunityCodeValues.ACCESSION_CURATION_TYPE, indexed = true)
private String curationTypeCode;
@CodeValueField(value = CommunityCodeValues.ACCESSION_COLLECTION, indexed = true)
private String collectionCode;
@Field(type = FieldType.Object)
private TaxonomySpeciesDTO taxonomySpecies;
@Field(type = FieldType.Nested)
private List<AccessionSourceInfo> accessionSources;
@Field(type = FieldType.Nested)
private List<AccessionInvNameInfo> names;
@Field(type = FieldType.Object)
private ExplorationInfo exploration;
@Field(type = FieldType.Text)
private String preferredName;
}