Determine accession backup sites from inventory
MCPD determines the backup sites (FAO WIEWS codes in DUPLSITE, names in DUPLSITENAME) based on the values in accession.backupLocationSite1 and backupLocationSite2. This requires that genebanks manually configure the two backup sites and limits the number of sites to two.
Genebanks must keep detailed records of which germplasm has been backed up, where, how much, when, etc. This requires that the backups are recorded as inventories.
The Inventory maintenance policy determines managementType and one of the options is Backup CommunityCodeValues.MANAGEMENT_TYPE_BACKUP.
With this ticket, we introduce a new application setting ACCESSION_BACKUP_SITES with the default value legacy and the alternative value inventory. When set to inventory the MCPD converter uses inventory data (inv.imp.managementTypeCode == 'BACKUP' && (inv.quantityOnHand == null || inv.quantityOnHand > 0) to determine the sites where the accession is backed up.
The public visibility of the backup inventory is not considered. If genebanks wish to "hide" the backup sites, they can introduce managementTypeCode = 'BACKUP-PRIVATE' and use that inventory policy for such backups.
The app setting ACCESSION_BACKUP_SITES will be switched to inventory with version 2026.1, requiring that backups are properly registered in the system.
Accession isBackedUp
This setting also controls if accession.isBackedUp is automatically controlled by the system. Any time an inventory is updated, the system inspects the status of that accession's inventory records and updates isBackedUp flag according to the same rule:
var hasBackupInventory = accession.getInventories()
.stream()
.anyMatch((inv) =>
inv.imp.managementTypeCode.startsWith("BACKUP")
&& (inv.quantityOnHand == null || inv.quantityOnHand > 0)
);
accession.setIsBackedUp(hasBackupInventory);