Repository navigation
Conversation
Weekly job downloads the Population Register death open data (andmed.eesti.ee "surmaandmed") and builds a sorted, fixed-width file of Estonian personal identity codes and death dates. DeathRegistry::Lookup binary searches it on disk and raises FileUnavailable when the file is missing, stale or malformed, so a missing file never reads as "alive". The old file is kept when a download fails, the CSV format changes or the record count drops below death_registry_min_records. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Check new EE private contacts against the local death registry file when validate_deceased_contacts is enabled. A deceased person is rejected with EPP 2003 "Ident is invalid"; a missing or stale file logs a warning and lets the contact through. Add contacts.death_date and death_registry_checked_at with partial indexes, show them in admin, and add a death registry filter to the admin contact search. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DeathRegistryCheckJob checks each EE private contact linked to a domain once a year against the local death registry file. A deceased person gets a death_date; a deceased registrant whose death is less than six months old triggers a poll message to the registrar for each domain. The job rebuilds the file itself when it is older than seven days, so production needs a single cron line. Dry run mode, on by default, saves nothing and emails the admin a CSV report instead. File problems are emailed to the admin. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
DeathRegistryCheckJob starts a fast track force delete with reason deceased_person on the domains of a registrant who died at least six months ago. The person is looked up again before that and every day during the force delete; if they are no longer in the death registry, the death date is cleared and the force delete is cancelled. Domains that already have a force delete are left alone for now. Fast track force delete emails now use the template of the reason and store template_name, so a deleted company no longer gets the invalid email letter. A valid contact email no longer cancels a deceased registrant's force delete, and an admin cancelling it clears the death date. Show the force delete start date in admin, include status notes in the admin daily summary reason, and drop the Russian part of the force delete email subject.
A deceased tech contact, or an admin contact the domain can do without, is removed from the domain and the registrar gets a poll message. When the last required admin contact of an organisation's or a minor's domain has died, a soft force delete starts with reason deceased_admin_contact, blocking renewal and transfer until a new admin contact is added. CheckForceDeleteLift lifts it once the domain has enough living admin contacts. The person is looked up in the death registry again first; one who is no longer there has the death date cleared. A valid contact email no longer cancels the soft force delete, and an admin cancelling it clears the deceased admin contacts' death date.
A deceased registrant's fast track force delete replaces an existing force delete when it releases the domain earlier. The replaced force delete is saved and restored when the death force delete stops (the person is no longer in the death registry, or an admin cancels it), if its reason still exists. Its dates are not moved; when its outzone date has passed, the domain goes out of the zone at once. The registrar gets a poll message.
The reason selects the email to the registrant and administrative contacts. Before, the letter was guessed from the domain data: any private registrant got the "registrant has died" letter, and a contact with a failing email turned any letter into the invalid email one. "Other" sends no email. "Invalid email" is refused when no contact email fails, as CheckForceDeleteLift would lift it the next day. Mass action ENTITY_BURIED now uses the private or legal person letter by registrant type instead of the guessed one.
maricavor
force-pushed
the
feature/death-registry-check
branch
from
November 5, 2026 14:07
15308c5 to
845398e
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #2960
Checks Estonian private-person contacts (priv/EE) against the Population Register death open data and handles deceased registrants and contacts automatically, replacing the manual ENTITY_BURIED process. Full description, production setup and all message texts:
doc/death_registry.md.What was done
DeathRegistry::FileBuilder,DeathRegistry::Lookup): the opendata.smit.ee CSVs are reduced to a sortedident;datefile, replaced atomically, with a minimum record count check. Lookups use binary search and refuse a missing or stale file.validate_deceased_contacts(off by default).DeathRegistryCheckJob: checks each linked contact once a year, rebuilds the file when it is older than 7 days, so production needs one cron line. Dry run by default (death_registry_dry_run): only a CSV report is emailed to the admin.deceased_person) at death + 6 months + 1 day, after re-checking the person.deceased_admin_contact), lifted byCheckForceDeleteLiftonce a new admin contact is added.contacts.death_date,contacts.death_registry_checked_atand indexes.Before go-live
deceased_admin_contactemail (doc section 9).validate_deceased_contactsand setdeath_registry_dry_run: 'false'(doc section 6).