Site locations
A controlled list of available storage locations for a Site
helps users with picking valid locations of Inventory recors.
Add a new entity SiteLocation
with:
class SiteLocation extends EmptyModel {
Long id;
Site site;
@Column(name = "storage_location_part1", length = 20, nullable = false)
private String storageLocationPart1;
@Column(name = "storage_location_part2", length = 20)
private String storageLocationPart2;
@Column(name = "storage_location_part3", length = 20)
private String storageLocationPart3;
@Column(name = "storage_location_part4", length = 20)
private String storageLocationPart4;
}
Only administrator can create, modify and delete SiteLocation
records, but all can read.
The filter class:
class SiteLocationFilter {
long site; // site id
Set<String> storageLocationPart1; // multiple values
Set<String> storageLocationPart2; // ..
Set<String> storageLocationPart3;
}
Add model, filter, repository, filtered CRUD service and extends SiteController API.
Additional properties
We also wish to record the "type" of storage location. This can be one of LTS
, MTS
, Cryo
, TC
, Backup
, ... We will use CodeValue
group LOCATION_TYPE, in the database this is @Column(length=20) String locationType
.