Refdata junction inserts check neither end of the link
Table of Contents
This page is a capture in the inbox bucket of the product backlog — a pre-sprint idea, not yet pulled into a sprint as a story.
1. What
The insert functions of currency_calendar, currency_country, currency_currency_group, currency_pair_convention_calendar, party_counterparty, party_country and party_currency validate the tenant and manage versions, but do not validate either code they link. Every other refdata write validates its soft foreign keys. Add the same existence checks to the junction inserts.
2. Why
A screen can only offer codes it read, but any other writer (the shell, an import, a script) can create a link to nothing, and the screens then show rows they cannot resolve. Found while writing the currency and desk group journeys.
3. References
projects/ores.sql/create/refdata/refdata_currency_currency_group_create.sqland the other junction create scripts- Journey: Group currencies for the desk, gap 2