Repository navigation
[DT-4263][3/7] Add DAR codes and DUOS-IDs to email sends - #3147
Open
kevinmarete wants to merge 2 commits into
Open
kevinmarete wants to merge 2 commits into
kevinmarete wants to merge 2 commits into
Conversation
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
from
October 9, 2026 22:11
78e904c to
d1c6131
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
2 times, most recently
from
October 10, 2026 00:27
b1886dd to
f51c862
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
from
October 10, 2026 00:52
f51c862 to
922b9e2
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-sends
branch
from
October 10, 2026 01:09
162bef3 to
7617930
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
from
October 10, 2026 01:11
922b9e2 to
7b4ebf7
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-sends
branch
from
October 10, 2026 01:22
7617930 to
083c4ad
Compare
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
2 times, most recently
from
October 10, 2026 01:58
8945635 to
4e38d8c
Compare
Each send now carries the DAR code and the DUOS-IDs of the datasets it concerns, read from its entity reference according to what its email type stores there. EmailReference records that for every email type in an exhaustive switch, so a new type must be classified before it compiles, and the query receives it as one array indexed by type. Older rows that stored a different kind of reference (a DAR reference id on a DAR-code type, a DAR code on a reference-id type, a dataset name on a DUOS-ID type) are read as what they hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dataset.alias is bigint where Liquibase created it but numeric on databases older than that changeset, such as the dev copy, which made the mapper's Long[] cast throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kevinmarete
force-pushed
the
km-dt-4263-email-dar-dataset-ids
branch
from
October 10, 2026 03:25
ba208a2 to
1b6c635
Compare
kevinmarete
marked this pull request as ready for review
October 10, 2026 05:05
kevinmarete
requested review from
fboulnois,
otchet-broad and
rushtong
and removed request for
a team
October 10, 2026 05:05
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.
Addresses
https://broadworkbench.atlassian.net/browse/DT-4263
Security risk: low — adds DAR codes and dataset IDs to an admin-only read endpoint; both are already visible to admins elsewhere.
Summary
Stacked on #3142. Each send from
GET /api/mail/sendsnow carriesdarCodeanddatasetIdentifiers, for the Email Log's DAR-ID and DUOS-ID columns agreed on DT-4084 (one dataset shows its ID, several show "Multiple").email_entity.entity_reference_idholds a different thing per email type. The newEmailReferenceenum records which, in an exhaustive switch overEmailType, so a new email type doesn't compile until it's classified:Other types (digests, DAA, library card, study emails) come back with no DAR code and no datasets. #3148 narrows approval and progress-report emails and adds study emails.
EmailReferencereaches the query as onekindslist indexed by email type number (kinds[email_type]), not one list per kind, so the lists can't be passed in the wrong order.Dataset.parseAliasToIdentifier, so the DUOS-ID format has one definition.Reading the query
The CTEs up to
sendsare #3142's. The finalSELECTjoins each send todar_collectionby code, toelectionby id, then todata_access_requestby reference id (or the election's DAR), and theLATERALsubquery collects dataset aliases from whichever of those matched.Example: a REMINDER whose reference is
42joins election 42, reaches its DAR throughelection.reference_id, takesdarCodefrom that DAR's collection, and returns election 42's dataset as the one DUOS-ID.Have you read CONTRIBUTING.md lately? If not, do that first.
🤖 Generated with Claude Code