Commit a8aef7b7 authored by Matija Obreza's avatar Matija Obreza
Browse files

Merge branch '301-type-of-container' into 'main'

Resolve "Type of Container"

Closes #301

See merge request grin-global/grin-global-server!399
parents e47ef600 8f5fafcd
......@@ -308,6 +308,12 @@ public class Inventory extends CooperatorOwnedModel implements Copyable<Inventor
@Lob
private String webAvailabilityNote;
@Basic
@Size(max = 20)
@Column(name = "container_type_code", length = 20)
@CodeValueField("CONTAINER_TYPE")
private String containerTypeCode;
@Formula("(SELECT name.plant_name FROM accession_inv_name name WHERE name.inventory_id = inventory_id ORDER BY name.plant_name_rank OFFSET 0 ROWS FETCH FIRST 1 ROWS ONLY)")
private String preferredName;
......@@ -741,6 +747,14 @@ public class Inventory extends CooperatorOwnedModel implements Copyable<Inventor
this.webAvailabilityNote = webAvailabilityNote;
}
public String getContainerTypeCode() {
return containerTypeCode;
}
public void setContainerTypeCode(String containerTypeCode) {
this.containerTypeCode = containerTypeCode;
}
public List<InventoryViability> getViability() {
return viability;
}
......
......@@ -18,6 +18,7 @@ package org.gringlobal.model;
import java.util.Date;
import javax.persistence.*;
import javax.validation.constraints.Size;
import org.genesys.blocks.model.Copyable;
import org.gringlobal.api.exception.InvalidApiUsageException;
......@@ -115,6 +116,12 @@ public class OrderRequestItem extends CooperatorOwnedModel implements Copyable<O
@Lob
private String webUserNote;
@Basic
@Size(max = 20)
@Column(name = "container_type_code", length = 20)
@CodeValueField("CONTAINER_TYPE")
private String containerTypeCode;
@PrePersist
@PreUpdate
private void checkOrderRequestItem() {
......@@ -266,6 +273,14 @@ public class OrderRequestItem extends CooperatorOwnedModel implements Copyable<O
this.webUserNote = webUserNote;
}
public String getContainerTypeCode() {
return containerTypeCode;
}
public void setContainerTypeCode(String containerTypeCode) {
this.containerTypeCode = containerTypeCode;
}
@JsonGetter
public Long getOrderRequestId() {
return this.orderRequest == null ? null : this.orderRequest.getId();
......
......@@ -585,6 +585,7 @@ public class OrderRequestServiceImpl extends FilteredCRUDServiceImpl<OrderReques
withdrawnInventory.setPollinationVectorCode(inventory.getPollinationVectorCode());
withdrawnInventory.setPropagationDate(inventory.getPropagationDate());
withdrawnInventory.setPropagationDateCode(inventory.getPropagationDateCode());
withdrawnInventory.setContainerTypeCode(item.getContainerTypeCode());
// withdrawnInventory.setIsAvailable("N"); // default = N
// withdrawnInventory.setIsDistributable("N"); // default = N
......
......@@ -9309,3 +9309,32 @@ databaseChangeLog:
(1, 'gg-ce', 'password_reset', 'password.reset.confirmation',
'<p>Dear {{username}}</p><p>The password for your GGCE account on <a href="{{url}}">{{url}}</a> was successfully reset on {{resetDate}}.</p><p>If you have any questions, please contact your GGCE administrator.</p><p>Regards</p><p>The GG-CE team</p>',
'Reset password confirmation', 1, GETDATE(), 1, GETDATE(), 1, GETDATE());
- changeSet:
id: 1652431136582-1
author: ahrybeniuk
changes:
- addColumn:
tableName: inventory
columns:
- column:
name: container_type_code
type: varchar(20)
- createIndex:
columns:
- column:
name: container_type_code
indexName: ndx_inv_container_type_code
tableName: inventory
- addColumn:
tableName: order_request_item
columns:
- column:
name: container_type_code
type: varchar(20)
- createIndex:
columns:
- column:
name: container_type_code
indexName: ndx_ori_container_type_code
tableName: order_request_item
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment