ExternalRequestGenesysItemDTO.java

/*
 * Copyright 2025 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.genesys.server.api.v2.model.impl;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.genesys.server.api.v2.model.BasicModelDTO;
import org.genesys.spring.validation.javax.SimpleString;

/**
 * An accession requested by an external system.
 */
@Getter
@Setter
public class ExternalRequestGenesysItemDTO extends BasicModelDTO {

	/** FAO WIEWS code of the institute holding the material */
	@NotNull
	@Pattern(regexp = "[A-Z]{3}\\d{3,4}")
	private String instCode;

	/** Accession number */
	@NotNull
	@Size(max = 128)
	@SimpleString
	private String acceNumb;
	
	/** Optional genus of the accession */
	@SimpleString
	private String genus;

	/** Optional DOI of the accession */
	@Pattern(regexp = "^10\\.[0-9]+(\\.[0-9]+)*/.+")
	private String doi;

	private AccessionDTO accession;
}