TaxonomySpeciesDTO.java

/*
 * Copyright 2026 Global Crop Diversity Trust
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.gringlobal.model.elastic;

import lombok.Getter;
import lombok.Setter;
import org.gringlobal.custom.elasticsearch.SearchField;
import org.gringlobal.custom.validation.javax.CodeValueField;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.Instant;

@Getter
@Setter
@Document(indexName = "taxonomyspecies")
public class TaxonomySpeciesDTO {

	private Long id;
	private Long ownedBy;
	private Instant ownedDate;
	private Long createdBy;
	private Instant createdDate;
	private Long modifiedBy;
	private Instant modifiedDate;
	private Long grinId;
	@Field(type = FieldType.Text)
	private String alternateName;
	@CodeValueField(value = "TAXONOMY_FERTILIZATION_METHOD", strict = false)
	private String commonFertilizationCode;

	@Field(type = FieldType.Object)
	private CooperatorInfo curator1Cooperator;

	@Field(type = FieldType.Object)
	private CooperatorInfo curator2Cooperator;

	@Field(index = false, type = FieldType.Long)
	private Long currentTaxonomySpecies;

	@Field(type = FieldType.Text)
	private String formaAuthority;
	@Field(type = FieldType.Text)
	private String formaName;
	@Field(type = FieldType.Text)
	private String formaRankType;
	@Field(type = FieldType.Keyword)
	private String isFormaHybrid;
	@Field(type = FieldType.Keyword)
	private String isNamePending;
	@Field(type = FieldType.Keyword)
	private String isSpecificHybrid;
	@Field(type = FieldType.Keyword)
	private String isSubspecificHybrid;
	@Field(type = FieldType.Keyword)
	private String isSubvarietalHybrid;
	@Field(type = FieldType.Keyword)
	private String isVarietalHybrid;
	@CodeValueField(value = "ACCESSION_LIFE_FORM", strict = false)
	private String lifeFormCode;
	@SearchField
	@Field(type = FieldType.Text)
	private String name;
	@Field(type = FieldType.Text)
	private String nameAuthority;
	private Instant nameVerifiedDate;
	private Integer nomenNumber;
	@Field(type = FieldType.Text)
	private String note;
	@Field(type = FieldType.Object)
	private SiteInfo priority1Site;
	@Field(type = FieldType.Object)
	private SiteInfo priority2Site;
	@Field(type = FieldType.Text)
	private String protologue;
	@Field(type = FieldType.Keyword)
	private String protologueVirtualPath;
	@CodeValueField(value = "TAXONOMY_RESTRICTION", strict = false)
	private String restrictionCode;
	@Field(type = FieldType.Text)
	private String siteNote;
	@Field(type = FieldType.Text)
	private String speciesAuthority;
	@Field(type = FieldType.Text)
	private String speciesName;
	@Field(type = FieldType.Text)
	private String subspeciesAuthority;
	@Field(type = FieldType.Text)
	private String subspeciesName;
	@Field(type = FieldType.Text)
	private String subvarietyAuthority;
	@Field(type = FieldType.Text)
	private String subvarietyName;
	@Field(type = FieldType.Text)
	private String varietaAuthority;
	@Field(type = FieldType.Text)
	private String varietyName;

	@Field(type = FieldType.Object)
	private CooperatorInfo verifierCooperator;
	private Instant verifiedDate;

	@Field(type = FieldType.Keyword)
	private String hybridParentage;
	@Field(type = FieldType.Keyword)
	private String isWebVisible;

	@Field(type = FieldType.Object)
	private TaxonomyGenusInfo taxonomyGenus;
}