2.6 KiB
Species Merge
The Species Merge tool replaces all obsolete species ids with a selected accepted species id, while preserving occurrence data, synonyms, and update logs. This flow is Admin-only and uses the same reference-selection and save procedures as other DetailView updates.
UI Flow Summary
- Select an Obsolete taxonomy and an Accepted taxonomy.
- Review the Selected taxonomies table (side-by-side values on the same row).
- Choose whether to copy selected parameters from obsolete to accepted.
- Decide whether to append the obsolete species name to locality-species
source_namevalues. - Resolve occurrence conflicts (only shown when obsolete values exist and differ from accepted).
- Decide whether to add the obsolete species as a synonym (optional comment).
- Proceed to Reference selection (staging view) and save.
After a successful merge, the UI navigates to the accepted species detail page.
Selected Taxonomies Table
- Displayed as a single table with columns: Field, Obsolete taxonomy, Accepted taxonomy.
- Field names are bold and rows are striped for quick comparison.
Copy Selected Parameters
The copy list is intentionally tight:
- Shows only fields where the obsolete value is non-empty and differs from the accepted value.
- Taxonomic fields are excluded (see list below).
- Additional excluded fields:
class_name,used_morph,used_now,used_gene,sp_status.
When the admin selects the obsolete value for a field, the accepted species is updated with that value during merge.
Taxonomic Fields Excluded
order_namefamily_namegenus_namespecies_namesubclass_or_superorder_namesuborder_or_superfamily_namesubfamily_nameunique_identifier
Occurrence Conflict Resolution
Occurrence conflicts are listed per locality only when:
- the obsolete value exists, and
- the obsolete value is different from the accepted value.
Selections are applied during merge to update accepted occurrence rows and migrate obsolete rows.
References and Save
The merge flow uses the same staging/reference selection flow as other entity edits:
- References are required.
- Save triggers the merge and logs updates in the update log tables.
API Endpoints
Backend endpoints are defined in backend/src/routes/speciesMerge.ts and implemented in
backend/src/services/speciesMerge.ts:
GET /admin/species-merge/summary?obsoleteId=<id>&acceptedId=<id>POST /admin/species-merge
Payload and response shapes are defined in frontend/src/shared/types under SpeciesMergeRequest,
SpeciesMergeSummary, and SpeciesMergeResponse.